@ember-data-types/store 5.6.0-alpha.1 → 5.6.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/package.json +1 -1
- package/unstable-preview-types/-private.d.ts +1 -30
- package/unstable-preview-types/-private.d.ts.map +1 -1
- package/unstable-preview-types/configure.d.ts +2 -6
- package/unstable-preview-types/configure.d.ts.map +1 -1
- package/unstable-preview-types/index.d.ts +2 -224
- package/unstable-preview-types/index.d.ts.map +1 -1
- package/unstable-preview-types/types.d.ts +1 -4
- package/unstable-preview-types/types.d.ts.map +1 -1
- package/unstable-preview-types/-private/cache-handler/handler.d.ts +0 -62
- package/unstable-preview-types/-private/cache-handler/handler.d.ts.map +0 -1
- package/unstable-preview-types/-private/cache-handler/types.d.ts +0 -107
- package/unstable-preview-types/-private/cache-handler/types.d.ts.map +0 -1
- package/unstable-preview-types/-private/cache-handler/utils.d.ts +0 -34
- package/unstable-preview-types/-private/cache-handler/utils.d.ts.map +0 -1
- package/unstable-preview-types/-private/caches/cache-utils.d.ts +0 -11
- package/unstable-preview-types/-private/caches/cache-utils.d.ts.map +0 -1
- package/unstable-preview-types/-private/caches/identifier-cache.d.ts +0 -180
- package/unstable-preview-types/-private/caches/identifier-cache.d.ts.map +0 -1
- package/unstable-preview-types/-private/caches/instance-cache.d.ts +0 -64
- package/unstable-preview-types/-private/caches/instance-cache.d.ts.map +0 -1
- package/unstable-preview-types/-private/caches/resource-utils.d.ts +0 -12
- package/unstable-preview-types/-private/caches/resource-utils.d.ts.map +0 -1
- package/unstable-preview-types/-private/debug/utils.d.ts +0 -9
- package/unstable-preview-types/-private/debug/utils.d.ts.map +0 -1
- package/unstable-preview-types/-private/document.d.ts +0 -155
- package/unstable-preview-types/-private/document.d.ts.map +0 -1
- package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts +0 -179
- package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts.map +0 -1
- package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +0 -19
- package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts.map +0 -1
- package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +0 -31
- package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts.map +0 -1
- package/unstable-preview-types/-private/managers/cache-manager.d.ts +0 -463
- package/unstable-preview-types/-private/managers/cache-manager.d.ts.map +0 -1
- package/unstable-preview-types/-private/managers/notification-manager.d.ts +0 -101
- package/unstable-preview-types/-private/managers/notification-manager.d.ts.map +0 -1
- package/unstable-preview-types/-private/managers/record-array-manager.d.ts +0 -101
- package/unstable-preview-types/-private/managers/record-array-manager.d.ts.map +0 -1
- package/unstable-preview-types/-private/network/request-cache.d.ts +0 -109
- package/unstable-preview-types/-private/network/request-cache.d.ts.map +0 -1
- package/unstable-preview-types/-private/new-core-tmp/promise-state.d.ts +0 -289
- package/unstable-preview-types/-private/new-core-tmp/promise-state.d.ts.map +0 -1
- package/unstable-preview-types/-private/new-core-tmp/reactivity/configure.d.ts +0 -92
- package/unstable-preview-types/-private/new-core-tmp/reactivity/configure.d.ts.map +0 -1
- package/unstable-preview-types/-private/new-core-tmp/reactivity/internal.d.ts +0 -172
- package/unstable-preview-types/-private/new-core-tmp/reactivity/internal.d.ts.map +0 -1
- package/unstable-preview-types/-private/new-core-tmp/reactivity/signal.d.ts +0 -32
- package/unstable-preview-types/-private/new-core-tmp/reactivity/signal.d.ts.map +0 -1
- package/unstable-preview-types/-private/new-core-tmp/request-state.d.ts +0 -276
- package/unstable-preview-types/-private/new-core-tmp/request-state.d.ts.map +0 -1
- package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +0 -145
- package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts.map +0 -1
- package/unstable-preview-types/-private/record-arrays/many-array.d.ts +0 -203
- package/unstable-preview-types/-private/record-arrays/many-array.d.ts.map +0 -1
- package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts +0 -118
- package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts.map +0 -1
- package/unstable-preview-types/-private/store-service.d.ts +0 -1601
- package/unstable-preview-types/-private/store-service.d.ts.map +0 -1
- package/unstable-preview-types/-private/store-service.type-test.d.ts +0 -4
- package/unstable-preview-types/-private/store-service.type-test.d.ts.map +0 -1
- package/unstable-preview-types/-private/utils/coerce-id.d.ts +0 -10
- package/unstable-preview-types/-private/utils/coerce-id.d.ts.map +0 -1
- package/unstable-preview-types/-private/utils/construct-resource.d.ts +0 -9
- package/unstable-preview-types/-private/utils/construct-resource.d.ts.map +0 -1
- package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts +0 -4
- package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts.map +0 -1
- package/unstable-preview-types/-private/utils/normalize-model-name.d.ts +0 -4
- package/unstable-preview-types/-private/utils/normalize-model-name.d.ts.map +0 -1
- package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts +0 -4
- package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts.map +0 -1
- package/unstable-preview-types/-types/overview.d.ts +0 -21
- package/unstable-preview-types/-types/overview.d.ts.map +0 -1
- package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts +0 -110
- package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts.map +0 -1
- package/unstable-preview-types/-types/q/ds-model.d.ts +0 -25
- package/unstable-preview-types/-types/q/ds-model.d.ts.map +0 -1
- package/unstable-preview-types/-types/q/identifier.d.ts +0 -193
- package/unstable-preview-types/-types/q/identifier.d.ts.map +0 -1
- package/unstable-preview-types/-types/q/promise-proxies.d.ts +0 -4
- package/unstable-preview-types/-types/q/promise-proxies.d.ts.map +0 -1
- package/unstable-preview-types/-types/q/record-data-json-api.d.ts +0 -36
- package/unstable-preview-types/-types/q/record-data-json-api.d.ts.map +0 -1
- package/unstable-preview-types/-types/q/record-instance.d.ts +0 -29
- package/unstable-preview-types/-types/q/record-instance.d.ts.map +0 -1
- package/unstable-preview-types/-types/q/schema-service.d.ts +0 -354
- package/unstable-preview-types/-types/q/schema-service.d.ts.map +0 -1
- package/unstable-preview-types/-types/q/store.d.ts +0 -38
- package/unstable-preview-types/-types/q/store.d.ts.map +0 -1
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
declare module '@ember-data/store/-private/managers/record-array-manager' {
|
|
2
|
-
import type { LocalRelationshipOperation } from '@warp-drive/core-types/graph';
|
|
3
|
-
import type { StableDocumentIdentifier, StableRecordIdentifier } from '@warp-drive/core-types/identifier';
|
|
4
|
-
import type { ImmutableRequestInfo } from '@warp-drive/core-types/request';
|
|
5
|
-
import type { CollectionResourceDocument } from '@warp-drive/core-types/spec/json-api-raw';
|
|
6
|
-
import { Collection, IdentifierArray } from '@ember-data/store/-private/record-arrays/identifier-array';
|
|
7
|
-
import type { Store } from '@ember-data/store/-private/store-service';
|
|
8
|
-
import type { UnsubscribeToken } from '@ember-data/store/-private/managers/notification-manager';
|
|
9
|
-
/**
|
|
10
|
-
* This is a clever optimization.
|
|
11
|
-
*
|
|
12
|
-
* clever optimizations rarely stand the test of time, so if you're
|
|
13
|
-
* ever curious or think something better is possible please benchmark
|
|
14
|
-
* and discuss. The benchmark for this at the time of writing is in
|
|
15
|
-
* `scripts/benchmark-push.js`
|
|
16
|
-
*
|
|
17
|
-
* This approach turns out to be 150x faster in Chrome and node than
|
|
18
|
-
* simply using push or concat. It's highly susceptible to the specifics
|
|
19
|
-
* of the batch size, and may require tuning.
|
|
20
|
-
*
|
|
21
|
-
* Clever optimizations should always come with a `why`. This optimization
|
|
22
|
-
* exists for two reasons.
|
|
23
|
-
*
|
|
24
|
-
* 1) array.push(...objects) and Array.prototype.push.apply(arr, objects)
|
|
25
|
-
* are susceptible to stack overflows. The size of objects at which this
|
|
26
|
-
* occurs varies by environment, browser, and current stack depth and memory
|
|
27
|
-
* pressure; however, it occurs in all browsers in fairly pristine conditions
|
|
28
|
-
* somewhere around 125k to 200k elements. Since EmberData regularly encounters
|
|
29
|
-
* arrays larger than this in size, we cannot use push.
|
|
30
|
-
*
|
|
31
|
-
* 2) `array.concat` or simply setting the array to a new reference is often an
|
|
32
|
-
* easier approach; however, native Proxy to an array cannot swap it's target array
|
|
33
|
-
* and attempts at juggling multiple array sources have proven to be victim to a number
|
|
34
|
-
* of browser implementation bugs. Should these bugs be addressed then we could
|
|
35
|
-
* simplify to using `concat`, however, do note this is currently 150x faster
|
|
36
|
-
* than concat, and due to the overloaded signature of concat will likely always
|
|
37
|
-
* be faster.
|
|
38
|
-
*
|
|
39
|
-
* Sincerely,
|
|
40
|
-
* - runspired (Chris Thoburn) 08/21/2022
|
|
41
|
-
*
|
|
42
|
-
* @function fastPush
|
|
43
|
-
* @internal
|
|
44
|
-
* @param target the array to push into
|
|
45
|
-
* @param source the items to push into target
|
|
46
|
-
*/
|
|
47
|
-
export function fastPush<T>(target: T[], source: T[]): void;
|
|
48
|
-
type ChangeSet = Map<StableRecordIdentifier, 'add' | 'del'>;
|
|
49
|
-
/**
|
|
50
|
-
@class RecordArrayManager
|
|
51
|
-
@internal
|
|
52
|
-
*/
|
|
53
|
-
export class RecordArrayManager {
|
|
54
|
-
store: Store;
|
|
55
|
-
isDestroying: boolean;
|
|
56
|
-
isDestroyed: boolean;
|
|
57
|
-
_set: Map<IdentifierArray, Set<StableRecordIdentifier>>;
|
|
58
|
-
_live: Map<string, IdentifierArray>;
|
|
59
|
-
_managed: Set<IdentifierArray>;
|
|
60
|
-
_pending: Map<IdentifierArray, ChangeSet>;
|
|
61
|
-
_identifiers: Map<StableRecordIdentifier, Set<Collection>>;
|
|
62
|
-
_staged: Map<string, ChangeSet>;
|
|
63
|
-
_subscription: UnsubscribeToken;
|
|
64
|
-
_documentSubscription: UnsubscribeToken;
|
|
65
|
-
_keyedArrays: Map<string, Collection>;
|
|
66
|
-
_visibilitySet: Map<StableRecordIdentifier, boolean>;
|
|
67
|
-
constructor(options: {
|
|
68
|
-
store: Store;
|
|
69
|
-
});
|
|
70
|
-
_syncArray(array: IdentifierArray | Collection): void;
|
|
71
|
-
mutate(mutation: LocalRelationshipOperation): void;
|
|
72
|
-
/**
|
|
73
|
-
Get the `RecordArray` for a modelName, which contains all loaded records of
|
|
74
|
-
given modelName.
|
|
75
|
-
|
|
76
|
-
@method liveArrayFor
|
|
77
|
-
@internal
|
|
78
|
-
@param {String} modelName
|
|
79
|
-
@return {RecordArray}
|
|
80
|
-
*/
|
|
81
|
-
liveArrayFor(type: string): IdentifierArray;
|
|
82
|
-
getCollection(config: {
|
|
83
|
-
type?: string;
|
|
84
|
-
query?: ImmutableRequestInfo | Record<string, unknown>;
|
|
85
|
-
identifiers?: StableRecordIdentifier[];
|
|
86
|
-
doc?: CollectionResourceDocument;
|
|
87
|
-
identifier?: StableDocumentIdentifier | null;
|
|
88
|
-
}): Collection;
|
|
89
|
-
dirtyArray(array: IdentifierArray, delta: number, shouldSyncFromCache: boolean): void;
|
|
90
|
-
_getPendingFor(identifier: StableRecordIdentifier, includeManaged: boolean, isRemove?: boolean): Map<IdentifierArray, ChangeSet> | void;
|
|
91
|
-
populateManagedArray(array: Collection, identifiers: StableRecordIdentifier[], payload: CollectionResourceDocument | null): void;
|
|
92
|
-
identifierAdded(identifier: StableRecordIdentifier): void;
|
|
93
|
-
identifierRemoved(identifier: StableRecordIdentifier): void;
|
|
94
|
-
identifierChanged(identifier: StableRecordIdentifier): void;
|
|
95
|
-
clear(isClear?: boolean): void;
|
|
96
|
-
destroy(): void;
|
|
97
|
-
}
|
|
98
|
-
export function disassociateIdentifier(ArraysCache: Map<StableRecordIdentifier, Set<Collection>>, array: Collection, identifier: StableRecordIdentifier): void;
|
|
99
|
-
export {};
|
|
100
|
-
}
|
|
101
|
-
//# sourceMappingURL=record-array-manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"record-array-manager.d.ts","sourceRoot":"","sources":["../../../src/-private/managers/record-array-manager.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,0B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AA4BD,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,GAAG,CAAC,sBAAsB,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,EACzD,KAAK,EAAE,UAAU,EACjB,UAAU,EAAE,sBAAsB,QAMnC"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
declare module '@ember-data/store/-private/network/request-cache' {
|
|
2
|
-
import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
|
|
3
|
-
import type { FindRecordOptions } from '@ember-data/store/-types/q/store';
|
|
4
|
-
import type { Store } from '@ember-data/store/-private/store-service';
|
|
5
|
-
const Touching: "___(unique) Symbol(Touching)";
|
|
6
|
-
export const RequestPromise: "___(unique) Symbol(RequestPromise)";
|
|
7
|
-
export interface Operation {
|
|
8
|
-
op: string;
|
|
9
|
-
options: FindRecordOptions | undefined;
|
|
10
|
-
recordIdentifier: StableRecordIdentifier;
|
|
11
|
-
}
|
|
12
|
-
export interface FindRecordQuery extends Operation {
|
|
13
|
-
op: 'findRecord';
|
|
14
|
-
}
|
|
15
|
-
export interface SaveRecordMutation extends Operation {
|
|
16
|
-
op: 'saveRecord';
|
|
17
|
-
}
|
|
18
|
-
export interface Request {
|
|
19
|
-
data: Operation[];
|
|
20
|
-
options?: Record<string, unknown>;
|
|
21
|
-
}
|
|
22
|
-
export type RequestStates = 'pending' | 'fulfilled' | 'rejected';
|
|
23
|
-
export interface RequestCacheRequestState {
|
|
24
|
-
state: RequestStates;
|
|
25
|
-
type: 'query' | 'mutation';
|
|
26
|
-
request: Request;
|
|
27
|
-
response?: Response;
|
|
28
|
-
}
|
|
29
|
-
export interface Response {
|
|
30
|
-
data: unknown;
|
|
31
|
-
}
|
|
32
|
-
interface InternalRequest extends RequestCacheRequestState {
|
|
33
|
-
[Touching]: StableRecordIdentifier[];
|
|
34
|
-
[RequestPromise]?: Promise<unknown>;
|
|
35
|
-
}
|
|
36
|
-
export type RequestSubscription = (requestState: RequestCacheRequestState) => void;
|
|
37
|
-
/**
|
|
38
|
-
* The RequestStateService is used to track the state of requests
|
|
39
|
-
* for fetching or updating known resource identifies that are inflight.
|
|
40
|
-
*
|
|
41
|
-
* @class RequestStateService
|
|
42
|
-
* @public
|
|
43
|
-
*/
|
|
44
|
-
export class RequestStateService {
|
|
45
|
-
_pending: Map<StableRecordIdentifier, InternalRequest[]>;
|
|
46
|
-
_done: Map<StableRecordIdentifier, InternalRequest[]>;
|
|
47
|
-
_subscriptions: Map<StableRecordIdentifier, RequestSubscription[]>;
|
|
48
|
-
_toFlush: InternalRequest[];
|
|
49
|
-
_store: Store;
|
|
50
|
-
constructor(store: Store);
|
|
51
|
-
_clearEntries(identifier: StableRecordIdentifier): void;
|
|
52
|
-
_enqueue<T>(promise: Promise<T>, queryRequest: Request): Promise<T>;
|
|
53
|
-
_triggerSubscriptions(req: InternalRequest): void;
|
|
54
|
-
_flush(): void;
|
|
55
|
-
_flushRequest(req: InternalRequest): void;
|
|
56
|
-
_dequeue(identifier: StableRecordIdentifier, request: InternalRequest): void;
|
|
57
|
-
_addDone(request: InternalRequest): void;
|
|
58
|
-
/**
|
|
59
|
-
* Subscribe to requests for a given resource identity.
|
|
60
|
-
*
|
|
61
|
-
* The callback will receive the current state of the request.
|
|
62
|
-
*
|
|
63
|
-
* ```ts
|
|
64
|
-
* interface RequestState {
|
|
65
|
-
* state: 'pending' | 'fulfilled' | 'rejected';
|
|
66
|
-
* type: 'query' | 'mutation';
|
|
67
|
-
* request: Request;
|
|
68
|
-
* response?: { data: unknown };
|
|
69
|
-
* }
|
|
70
|
-
* ```
|
|
71
|
-
*
|
|
72
|
-
* Note: It should be considered dangerous to use this API for more than simple
|
|
73
|
-
* state derivation or debugging. The `request` and `response` properties are poorly
|
|
74
|
-
* spec'd and may change unexpectedly when shifting what Handlers are in use or how
|
|
75
|
-
* requests are issued from the Store.
|
|
76
|
-
*
|
|
77
|
-
* We expect to revisit this API in the near future as we continue to refine the
|
|
78
|
-
* RequestManager ergonomics, as a simpler but more powerful direct integration
|
|
79
|
-
* with the RequestManager for these purposes is likely to be a better long-term
|
|
80
|
-
* design.
|
|
81
|
-
*
|
|
82
|
-
* @method subscribeForRecord
|
|
83
|
-
* @public
|
|
84
|
-
* @param {StableRecordIdentifier} identifier
|
|
85
|
-
* @param {(state: RequestCacheRequestState) => void} callback
|
|
86
|
-
*/
|
|
87
|
-
subscribeForRecord(identifier: StableRecordIdentifier, callback: RequestSubscription): void;
|
|
88
|
-
/**
|
|
89
|
-
* Retrieve all active requests for a given resource identity.
|
|
90
|
-
*
|
|
91
|
-
* @method getPendingRequestsForRecord
|
|
92
|
-
* @public
|
|
93
|
-
* @param {StableRecordIdentifier} identifier
|
|
94
|
-
* @return {RequestCacheRequestState[]} an array of request states for any pending requests for the given identifier
|
|
95
|
-
*/
|
|
96
|
-
getPendingRequestsForRecord(identifier: StableRecordIdentifier): RequestCacheRequestState[];
|
|
97
|
-
/**
|
|
98
|
-
* Retrieve the last completed request for a given resource identity.
|
|
99
|
-
*
|
|
100
|
-
* @method getLastRequestForRecord
|
|
101
|
-
* @public
|
|
102
|
-
* @param {StableRecordIdentifier} identifier
|
|
103
|
-
* @return {RequestCacheRequestState | null} the state of the most recent request for the given identifier
|
|
104
|
-
*/
|
|
105
|
-
getLastRequestForRecord(identifier: StableRecordIdentifier): RequestCacheRequestState | null;
|
|
106
|
-
}
|
|
107
|
-
export {};
|
|
108
|
-
}
|
|
109
|
-
//# sourceMappingURL=request-cache.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-cache.d.ts","sourceRoot":"","sources":["../../../src/-private/network/request-cache.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEhF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,QAAA,MAAM,QAAQ,gCAAiD,CAAC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,CAAC,CAAa;IAC/E,QAAQ,EAAE,eAAe,EAAE,CAAM;IACjC,MAAM,EAAE,KAAK,CAAC;gBAEF,KAAK,EAAE,KAAK;IAIxB,aAAa,CAAC,UAAU,EAAE,sBAAsB;IAIhD,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAiDnE,qBAAqB,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IAcjD,MAAM,IAAI,IAAI;IAOd,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IASzC,QAAQ,CAAC,UAAU,EAAE,sBAAsB,EAAE,OAAO,EAAE,eAAe;IAQrE,QAAQ,CAAC,OAAO,EAAE,eAAe;IAwBjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,kBAAkB,CAAC,UAAU,EAAE,sBAAsB,EAAE,QAAQ,EAAE,mBAAmB;IASpF;;;;;;;OAOG;IACH,2BAA2B,CAAC,UAAU,EAAE,sBAAsB,GAAG,wBAAwB,EAAE;IAI3F;;;;;;;OAOG;IACH,uBAAuB,CAAC,UAAU,EAAE,sBAAsB,GAAG,wBAAwB,GAAG,IAAI;CAO7F"}
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
declare module '@ember-data/store/-private/new-core-tmp/promise-state' {
|
|
2
|
-
import type { Awaitable } from '@ember-data/request';
|
|
3
|
-
/**
|
|
4
|
-
* The state of a promise in the "pending"
|
|
5
|
-
* state. This is the default initial state.
|
|
6
|
-
*
|
|
7
|
-
* @typedoc
|
|
8
|
-
*/
|
|
9
|
-
export interface PendingPromise {
|
|
10
|
-
/**
|
|
11
|
-
* The status of the promise.
|
|
12
|
-
*
|
|
13
|
-
* @typedoc
|
|
14
|
-
*/
|
|
15
|
-
status: 'pending';
|
|
16
|
-
/**
|
|
17
|
-
* Whether the promise is pending.
|
|
18
|
-
*
|
|
19
|
-
* @typedoc
|
|
20
|
-
*/
|
|
21
|
-
isPending: true;
|
|
22
|
-
/**
|
|
23
|
-
* Whether the promise is pending.
|
|
24
|
-
*
|
|
25
|
-
* @deprecated use `isPending` instead
|
|
26
|
-
* @typedoc
|
|
27
|
-
*/
|
|
28
|
-
isLoading: true;
|
|
29
|
-
/**
|
|
30
|
-
* Whether the promise has resolved
|
|
31
|
-
* successfully.
|
|
32
|
-
*
|
|
33
|
-
* @typedoc
|
|
34
|
-
*/
|
|
35
|
-
isSuccess: false;
|
|
36
|
-
/**
|
|
37
|
-
* Whether the promise has rejected
|
|
38
|
-
* with an error.
|
|
39
|
-
*
|
|
40
|
-
* @typedoc
|
|
41
|
-
*/
|
|
42
|
-
isError: false;
|
|
43
|
-
/**
|
|
44
|
-
* Once the promise has resolved, this will
|
|
45
|
-
* be the value the promise resolved to.
|
|
46
|
-
*
|
|
47
|
-
* @typedoc
|
|
48
|
-
*/
|
|
49
|
-
value: null;
|
|
50
|
-
/**
|
|
51
|
-
* Once the promise has resolved, this will
|
|
52
|
-
* be the value the promise resolved to.
|
|
53
|
-
*
|
|
54
|
-
* @deprecated use `value` instead
|
|
55
|
-
* @typedoc
|
|
56
|
-
*/
|
|
57
|
-
result: null;
|
|
58
|
-
/**
|
|
59
|
-
* Once the promise has rejected, this will
|
|
60
|
-
* be the error the promise rejected with.
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* @deprecated use `reason` instead
|
|
64
|
-
* @typedoc
|
|
65
|
-
*/
|
|
66
|
-
error: null;
|
|
67
|
-
/**
|
|
68
|
-
* Once the promise has rejected, this will
|
|
69
|
-
* be the error the promise rejected with.
|
|
70
|
-
*
|
|
71
|
-
* @typedoc
|
|
72
|
-
*/
|
|
73
|
-
reason: null;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* The state of a promise in the "fulfilled" state.
|
|
77
|
-
* This is the state of a promise that has resolved
|
|
78
|
-
* successfully.
|
|
79
|
-
*
|
|
80
|
-
* @typedoc
|
|
81
|
-
*/
|
|
82
|
-
export interface ResolvedPromise<T> {
|
|
83
|
-
/**
|
|
84
|
-
* The status of the promise.
|
|
85
|
-
*
|
|
86
|
-
* @typedoc
|
|
87
|
-
*/
|
|
88
|
-
status: 'fulfilled';
|
|
89
|
-
/**
|
|
90
|
-
* Whether the promise is pending.
|
|
91
|
-
*
|
|
92
|
-
* @typedoc
|
|
93
|
-
*/
|
|
94
|
-
isPending: false;
|
|
95
|
-
/**
|
|
96
|
-
* Whether the promise is pending.
|
|
97
|
-
*
|
|
98
|
-
* @deprecated use `isPending` instead
|
|
99
|
-
* @typedoc
|
|
100
|
-
*/
|
|
101
|
-
isLoading: false;
|
|
102
|
-
/**
|
|
103
|
-
* Whether the promise has resolved
|
|
104
|
-
* successfully.
|
|
105
|
-
*
|
|
106
|
-
* @typedoc
|
|
107
|
-
*/
|
|
108
|
-
isSuccess: true;
|
|
109
|
-
/**
|
|
110
|
-
* Whether the promise has rejected
|
|
111
|
-
* with an error.
|
|
112
|
-
*
|
|
113
|
-
* @typedoc
|
|
114
|
-
*/
|
|
115
|
-
isError: false;
|
|
116
|
-
/**
|
|
117
|
-
* Once the promise has resolved, this will
|
|
118
|
-
* be the value the promise resolved to.
|
|
119
|
-
*
|
|
120
|
-
* @typedoc
|
|
121
|
-
*/
|
|
122
|
-
value: T;
|
|
123
|
-
/**
|
|
124
|
-
* Once the promise has resolved, this will
|
|
125
|
-
* be the value the promise resolved to.
|
|
126
|
-
*
|
|
127
|
-
* @deprecated use `value` instead
|
|
128
|
-
* @typedoc
|
|
129
|
-
*/
|
|
130
|
-
result: T;
|
|
131
|
-
/**
|
|
132
|
-
* Once the promise has rejected, this will
|
|
133
|
-
* be the error the promise rejected with.
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* @deprecated use `reason` instead
|
|
137
|
-
* @typedoc
|
|
138
|
-
*/
|
|
139
|
-
error: null;
|
|
140
|
-
/**
|
|
141
|
-
* Once the promise has rejected, this will
|
|
142
|
-
* be the error the promise rejected with.
|
|
143
|
-
*
|
|
144
|
-
* @typedoc
|
|
145
|
-
*/
|
|
146
|
-
reason: null;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* The state of a promise in the "rejected" state.
|
|
150
|
-
* This is the state of a promise that has rejected
|
|
151
|
-
* with an error.
|
|
152
|
-
*
|
|
153
|
-
* @typedoc
|
|
154
|
-
*/
|
|
155
|
-
export interface RejectedPromise<E> {
|
|
156
|
-
/**
|
|
157
|
-
* The status of the promise.
|
|
158
|
-
*
|
|
159
|
-
* @typedoc
|
|
160
|
-
*/
|
|
161
|
-
status: 'rejected';
|
|
162
|
-
/**
|
|
163
|
-
* Whether the promise is pending.
|
|
164
|
-
*
|
|
165
|
-
* @typedoc
|
|
166
|
-
*/
|
|
167
|
-
isPending: false;
|
|
168
|
-
/**
|
|
169
|
-
* Whether the promise is pending.
|
|
170
|
-
*
|
|
171
|
-
* @deprecated use `isPending` instead
|
|
172
|
-
* @typedoc
|
|
173
|
-
*/
|
|
174
|
-
isLoading: false;
|
|
175
|
-
/**
|
|
176
|
-
* Whether the promise has resolved
|
|
177
|
-
* successfully.
|
|
178
|
-
*
|
|
179
|
-
* @typedoc
|
|
180
|
-
*/
|
|
181
|
-
isSuccess: false;
|
|
182
|
-
/**
|
|
183
|
-
* Whether the promise has rejected
|
|
184
|
-
* with an error.
|
|
185
|
-
*
|
|
186
|
-
* @typedoc
|
|
187
|
-
*/
|
|
188
|
-
isError: true;
|
|
189
|
-
/**
|
|
190
|
-
* Once the promise has resolved, this will
|
|
191
|
-
* be the value the promise resolved to.
|
|
192
|
-
*
|
|
193
|
-
* @typedoc
|
|
194
|
-
*/
|
|
195
|
-
value: null;
|
|
196
|
-
/**
|
|
197
|
-
* Once the promise has resolved, this will
|
|
198
|
-
* be the value the promise resolved to.
|
|
199
|
-
*
|
|
200
|
-
* @deprecated use `value` instead
|
|
201
|
-
* @typedoc
|
|
202
|
-
*/
|
|
203
|
-
result: null;
|
|
204
|
-
/**
|
|
205
|
-
* Once the promise has rejected, this will
|
|
206
|
-
* be the error the promise rejected with.
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
* @deprecated use `reason` instead
|
|
210
|
-
* @typedoc
|
|
211
|
-
*/
|
|
212
|
-
error: E;
|
|
213
|
-
/**
|
|
214
|
-
* Once the promise has rejected, this will
|
|
215
|
-
* be the error the promise rejected with.
|
|
216
|
-
*
|
|
217
|
-
* @typedoc
|
|
218
|
-
*/
|
|
219
|
-
reason: E;
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* The state of a promise. This is the type that is returned
|
|
223
|
-
* from `getPromiseState`.
|
|
224
|
-
*
|
|
225
|
-
* See also:
|
|
226
|
-
* - {@link PendingPromise}
|
|
227
|
-
* - {@link ResolvedPromise}
|
|
228
|
-
* - {@link RejectedPromise}
|
|
229
|
-
*
|
|
230
|
-
* @typedoc
|
|
231
|
-
*/
|
|
232
|
-
export type PromiseState<T = unknown, E = unknown> = PendingPromise | ResolvedPromise<T> | RejectedPromise<E>;
|
|
233
|
-
export function createPromiseState<T, E>(promise: Promise<T> | Awaitable<T, E>): Readonly<PromiseState<T, E>>;
|
|
234
|
-
/**
|
|
235
|
-
* Returns a reactive state-machine for the provided promise or awaitable.
|
|
236
|
-
*
|
|
237
|
-
* Repeat calls to `getPromiseState` with the same promise will return the same state object
|
|
238
|
-
* making is safe and easy to use in templates and JavaScript code to produce reactive
|
|
239
|
-
* behaviors around promises.
|
|
240
|
-
*
|
|
241
|
-
* `getPromiseState` can be used in both JavaScript and Template contexts.
|
|
242
|
-
*
|
|
243
|
-
* ```ts
|
|
244
|
-
* import { getPromiseState } from '@warp-drive/ember';
|
|
245
|
-
*
|
|
246
|
-
* const state = getPromiseState(promise);
|
|
247
|
-
* ```
|
|
248
|
-
*
|
|
249
|
-
* For instance, we could write a getter on a component that updates whenever
|
|
250
|
-
* the promise state advances or the promise changes, by combining the function
|
|
251
|
-
* with the use of `@cached`
|
|
252
|
-
*
|
|
253
|
-
* ```ts
|
|
254
|
-
* class Component {
|
|
255
|
-
* @cached
|
|
256
|
-
* get title() {
|
|
257
|
-
* const state = getPromiseState(this.args.request);
|
|
258
|
-
* if (state.isPending) {
|
|
259
|
-
* return 'loading...';
|
|
260
|
-
* }
|
|
261
|
-
* if (state.isError) { return null; }
|
|
262
|
-
* return state.result.title;
|
|
263
|
-
* }
|
|
264
|
-
* }
|
|
265
|
-
* ```
|
|
266
|
-
*
|
|
267
|
-
* Or in a template as a helper:
|
|
268
|
-
*
|
|
269
|
-
* ```gjs
|
|
270
|
-
* import { getPromiseState } from '@warp-drive/ember';
|
|
271
|
-
*
|
|
272
|
-
* <template>
|
|
273
|
-
* {{#let (getPromiseState @request) as |state|}}
|
|
274
|
-
* {{#if state.isPending}} <Spinner />
|
|
275
|
-
* {{else if state.isError}} <ErrorForm @error={{state.error}} />
|
|
276
|
-
* {{else}}
|
|
277
|
-
* <h1>{{state.result.title}}</h1>
|
|
278
|
-
* {{/if}}
|
|
279
|
-
* {{/let}}
|
|
280
|
-
* </template>
|
|
281
|
-
* ```
|
|
282
|
-
*
|
|
283
|
-
* If looking to use in a template, consider also the `<Await />` component.
|
|
284
|
-
*
|
|
285
|
-
* @typedoc
|
|
286
|
-
*/
|
|
287
|
-
export function getPromiseState<T = unknown, E = unknown>(promise: Promise<T> | Awaitable<T, E>): Readonly<PromiseState<T, E>>;
|
|
288
|
-
}
|
|
289
|
-
//# sourceMappingURL=promise-state.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promise-state.d.ts","sourceRoot":"","sources":["../../../src/-private/new-core-tmp/promise-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAOrD;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,MAAM,EAAE,SAAS,CAAC;IAElB;;;;OAIG;IACH,SAAS,EAAE,IAAI,CAAC;I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ET;;;;;OAKG;IACH,MAAM,EAAE,CAAC,CAAC;CACX;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,IAAI,cAAc,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;AAgB9G,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CA4C5G;AAaD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EACtD,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAU9B"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
declare module '@ember-data/store/-private/new-core-tmp/reactivity/configure' {
|
|
2
|
-
export const ARRAY_SIGNAL: "___(unique) Symbol(#[])";
|
|
3
|
-
export const OBJECT_SIGNAL: "___(unique) Symbol(#{})";
|
|
4
|
-
/**
|
|
5
|
-
* Requirements:
|
|
6
|
-
*
|
|
7
|
-
* Signal:
|
|
8
|
-
*
|
|
9
|
-
* - signal: a way of creating a reference that we can dirty when we desire to notify
|
|
10
|
-
* - @signal: a way of creating an accessor on an object that subscribes to a signal on access
|
|
11
|
-
* and notifies the signal on set, or of upgrading a descriptor to be such an accessor
|
|
12
|
-
* - defineSignal: a way of creating a signal on an object
|
|
13
|
-
* - notifySignal: a way of notifying the underlying signal that it has been dirtied
|
|
14
|
-
* - peekSignal: a way of inspecting the signal without notifying it
|
|
15
|
-
*
|
|
16
|
-
* - gate: a memoized getter function that re-runs when on access if its signal is dirty
|
|
17
|
-
* conceptually, a gate is a tightly coupled signal and memo
|
|
18
|
-
* - @gate: a way of creating a gate on an object or upgrading a descriptor with a getter
|
|
19
|
-
* to be a gate
|
|
20
|
-
* - defineGate: a way of creating a gate on an object
|
|
21
|
-
* - notifySignal: a way of notifying the signal for a gate that it has been dirtied
|
|
22
|
-
*
|
|
23
|
-
* - memo:
|
|
24
|
-
* - @memo: a way of creating a memoized getter on an object or upgrading a descriptor with a getter
|
|
25
|
-
* to be a memo
|
|
26
|
-
* - defineMemo: a way of creating a memo on an object
|
|
27
|
-
*
|
|
28
|
-
* - signalStore: storage bucket for signals associated to an object
|
|
29
|
-
* - withSignalStore: a way of pre-creating a signal store on an object
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
/**
|
|
35
|
-
* An Opaque type that represents a framework specific or TC39 signal.
|
|
36
|
-
*
|
|
37
|
-
* It may be an array of signals or a single signal.
|
|
38
|
-
*
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
export type SignalRef = unknown;
|
|
42
|
-
/**
|
|
43
|
-
* The hooks which MUST be configured in order to use this library,
|
|
44
|
-
* either for framework specfic signals or TC39 signals.
|
|
45
|
-
*
|
|
46
|
-
* Support for multiple frameworks simultaneously can be done via
|
|
47
|
-
* this abstraction by returning multiple signals from the `createSignal`
|
|
48
|
-
* method, and consuming the correct one via the correct framework via
|
|
49
|
-
* the `consumeSignal` and `notifySignal` methods.
|
|
50
|
-
*
|
|
51
|
-
* @typedoc
|
|
52
|
-
*/
|
|
53
|
-
export interface SignalHooks<T = SignalRef> {
|
|
54
|
-
createSignal: (obj: object, key: string | symbol) => T;
|
|
55
|
-
consumeSignal: (signal: T) => void;
|
|
56
|
-
notifySignal: (signal: T) => void;
|
|
57
|
-
createMemo: <F>(obj: object, key: string | symbol, fn: () => F) => () => F;
|
|
58
|
-
willSyncFlushWatchers: () => boolean;
|
|
59
|
-
}
|
|
60
|
-
export interface HooksOptions {
|
|
61
|
-
wellknown: {
|
|
62
|
-
Array: symbol | string;
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* The public API for configuring the signal hooks.
|
|
67
|
-
*
|
|
68
|
-
* @internal
|
|
69
|
-
*/
|
|
70
|
-
export function setupSignals<T>(buildConfig: (options: HooksOptions) => SignalHooks<T>): void;
|
|
71
|
-
/**
|
|
72
|
-
* Internal method for consuming the configured `createSignal` hook
|
|
73
|
-
*
|
|
74
|
-
* @internal
|
|
75
|
-
*/
|
|
76
|
-
export function createSignal(obj: object, key: string | symbol): SignalRef;
|
|
77
|
-
/**
|
|
78
|
-
* Internal method for consuming the configured `consumeSignal` hook
|
|
79
|
-
*
|
|
80
|
-
* @internal
|
|
81
|
-
*/
|
|
82
|
-
export function consumeSignal(signal: SignalRef): void;
|
|
83
|
-
/**
|
|
84
|
-
* Internal method for consuming the configured `notifySignal` hook
|
|
85
|
-
*
|
|
86
|
-
* @internal
|
|
87
|
-
*/
|
|
88
|
-
export function notifySignal(signal: SignalRef): void;
|
|
89
|
-
export function createMemo<T>(object: object, key: string | symbol, fn: () => T): () => T;
|
|
90
|
-
export function willSyncFlushWatchers(): boolean;
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=configure.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../../src/-private/new-core-tmp/reactivity/configure.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY,2BAAuC,CAAC;AACjE,eAAO,MAAM,aAAa,2BAAuC,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC;AAChC;;;;;;;;;;GAUG;AACH,MAAM,WAAW,WAAW,CA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