Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
746 changes: 567 additions & 179 deletions README.md

Large diffs are not rendered by default.

60 changes: 16 additions & 44 deletions dist/_state.d.ts
Original file line number Diff line number Diff line change
@@ -1,53 +1,25 @@
import type { PropKey, SignalMetadata, SignalOrMemoType } from './decorators/types.js';
import type { AnyObject, MemberStat, MetadataMembers, PropKey, ClassySolidMetadata, SignalOrMemoType } from './decorators/types.js';
import { Effects } from './mixins/Effectful.js';
export declare const isSignalGetter: WeakSet<Function>;
export declare const isMemoGetter: WeakSet<Function>;
export declare function getSignalsAndMemos(metadata: SignalMetadata): [key: PropKey, stat: {
type: SignalOrMemoType;
applied: WeakMap<object, boolean>;
}][];
export declare function getMembers(metadata: ClassySolidMetadata): MetadataMembers;
export declare function getMemberStat(name: PropKey, type: SignalOrMemoType, members: MetadataMembers): MemberStat;
export declare function signalifyIfNeeded(obj: AnyObject, name: PropKey, stat: MemberStat): void;
export declare function memoifyIfNeeded(obj: AnyObject, name: PropKey, stat: MemberStat): void;
/** @private internal state */
export declare const effects__: WeakMap<AnyObject, Effects>;
export declare function effectifyIfNeeded(obj: AnyObject, name: PropKey, stat: MemberStat): void;
/**
* Sort certain members tracked in metadata in the order of
*
* 1. signal fields
* 2. memo fields
* 3. memo auto-accessors
* 4. memo accessors
* 5. memo methods
*
* so that any members that are normally initialized *after*
* getters/setters/methods (fields and accessors, such as signal fields, and
* memo fields and auto-accessors) will be initialized before
* getters/setters/methods (memo accessors and methods).
*
* This ensures proper initialization order which we cannot currently achieve
* with the default ordering of EcmaScript decorators alone.
*/
export declare function sortSignalsMemosInMetadata(metadata: SignalMetadata): void;
export declare function getMemberStat(name: PropKey, type: SignalOrMemoType, signalsAndMemos: any[]): any;
export declare function memoifyIfNeeded(obj: object, name: PropKey, stat: any, isAutoAccessor?: boolean): void;
/**
* If any signal-fields, memo-fields, or memo-auto-accessors are defined on the
* class (thus sorted before the given memo field), skip memoifying now (true
* return). We'll memoify later after signal fields are initialized.
*/
export declare function isPriorSignalOrMemoDefined(obj: object, name: PropKey, signalsAndMemos: any[]): boolean;
/**
* This finalizes memo initialization for memo accessors and methods that
* were waiting for all signal fields, memo fields, and memo auto-accessors
* to be initialized first.
*
* Basically we ensure that memo initialization happens in this order:
* 1. signal fields
* 2. memo fields
* 3. memo auto-accessors
* 4. memo accessors
* 5. memo methods
* This finalizes memo initialization for the members tracked, in our custom
* ordering.
*
* This is important because memos may depend on signals or other memos, and we
* cannot rely on EcmaScript decorator application order alone, since accessor
* and method before field decorators no matter the order in source code.
* cannot rely on EcmaScript decorator order, or extra initializer order alone,
* because accessor and method decorators/initializers run before field
* decorators no matter the order in source code (give or take some details
* regarding auto accessor ordering).
*
* See: https://github.com/tc39/proposal-decorators/issues/566
*/
export declare function finalizeMemos(obj: object, stat: any, signalsAndMemos: any[]): void;
export declare function finalizeMembersIfLast(obj: AnyObject, members: MetadataMembers): void;
//# sourceMappingURL=_state.d.ts.map
2 changes: 1 addition & 1 deletion dist/_state.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

181 changes: 111 additions & 70 deletions dist/_state.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading