@warp-drive/core 5.7.0-alpha.31 → 5.7.0-alpha.33

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.
@@ -16,7 +16,6 @@ import type { Meta, PaginationLinks } from "../../types/spec/json-api-raw.js";
16
16
  * @hideconstructor
17
17
  */
18
18
  export declare class ReactiveDocument<T> {
19
- #private;
20
19
  /**
21
20
  * The links object for this document, if any
22
21
  *
@@ -61,11 +60,6 @@ export declare class ReactiveDocument<T> {
61
60
  * @public
62
61
  */
63
62
  readonly identifier: RequestKey | null;
64
- protected readonly _store: Store;
65
- protected readonly _localCache: {
66
- document: ResourceDocument;
67
- request: ImmutableRequestInfo;
68
- } | null;
69
63
  constructor(store: Store, cacheKey: RequestKey | null, localCache: {
70
64
  document: ResourceDocument;
71
65
  request: ImmutableRequestInfo;
@@ -26,16 +26,14 @@ export declare class ContextOwner {
26
26
  setResponse(response: ResponseInfo | Response | null): void;
27
27
  }
28
28
  export declare class Context {
29
- private ___owner;
30
29
  request: ImmutableRequestInfo;
31
30
  id: number;
32
- private _isCacheHandler;
33
- private _finalized;
34
31
  constructor(owner: ContextOwner, isCacheHandler: boolean);
35
32
  setStream(stream: ReadableStream | Promise<ReadableStream | null>): void;
36
33
  setResponse(response: ResponseInfo | Response | null): void;
37
34
  setIdentifier(identifier: RequestKey): void;
38
35
  get hasRequestedStream(): boolean;
36
+ /** @private */
39
37
  _finalize(): void;
40
38
  }
41
39
  export type HandlerRequestContext = Context;
@@ -29,7 +29,6 @@ import type { StoreRequestContext } from "../cache-handler/handler.js";
29
29
  */
30
30
  export declare class CacheManager implements Cache {
31
31
  version: "2";
32
- private ___cache;
33
32
  constructor(cache: Cache);
34
33
  // Cache Management
35
34
  // ================
@@ -72,7 +72,6 @@ export default class NotificationManager {
72
72
  notify(cacheKey: ResourceKey, value: "errors" | "meta" | "identity" | "state", key?: null): boolean;
73
73
  notify(cacheKey: ResourceKey, value: CacheOperation, key?: null): boolean;
74
74
  notify(cacheKey: RequestKey, value: DocumentCacheOperation, key?: null): boolean;
75
- private _scheduleNotify;
76
75
  }
77
76
  /**
78
77
  * This type exists for internal use only for
@@ -75,7 +75,6 @@ export declare class RecordArrayManager {
75
75
  getCollection(config: LegacyQueryInit): LegacyQueryArray;
76
76
  getCollection(config: AnonymousRequestCollectionInit): ReactiveResourceArray;
77
77
  getCollection(config: RequestCollectionInit): ReactiveResourceArray;
78
- private dirtyArray;
79
78
  /**
80
79
  * @private
81
80
  */
@@ -43,9 +43,6 @@ export type RequestSubscription = (requestState: RequestCacheRequestState) => vo
43
43
  */
44
44
  export declare class RequestStateService {
45
45
  constructor(store: Store);
46
- private _flushRequest;
47
- private _dequeue;
48
- private _addDone;
49
46
  /**
50
47
  * Subscribe to requests for a given resource identity.
51
48
  *
@@ -10,21 +10,6 @@ import type { PendingPromise, RejectedPromise, ResolvedPromise } from "./promise
10
10
  * @hideconstructor
11
11
  */
12
12
  export declare class RequestLoadingState {
13
- private _sizeHint;
14
- private _bytesLoaded;
15
- private _startTime;
16
- private _endTime;
17
- private _lastPacketTime;
18
- private _isPending;
19
- private _isStarted;
20
- private _isComplete;
21
- private _isCancelled;
22
- private _isErrored;
23
- private _error;
24
- private _stream;
25
- private _future;
26
- private _triggered;
27
- private _trigger;
28
13
  promise: Promise<void> | null;
29
14
  get isPending(): boolean;
30
15
  get sizeHint(): number;
@@ -153,16 +153,6 @@ export declare class RequestSubscription<
153
153
  constructor(store: Store | RequestManager, args: SubscriptionArgs<RT, E>);
154
154
  get isIdle(): boolean;
155
155
  get autorefreshTypes(): Set<AutorefreshBehaviorType>;
156
- // we only run this function on component creation
157
- // and when an update is triggered, so it does not
158
- // react to changes in the autorefreshThreshold
159
- // or autorefresh args.
160
- //
161
- // if we need to react to those changes, we can
162
- // use a modifier or internal component or some
163
- // such to trigger a re-run of this function.
164
- private _scheduleInterval;
165
- private _clearInterval;
166
156
  /**
167
157
  * Retry the request, reloading it from the server.
168
158
  */
@@ -639,6 +639,12 @@ class ContextOwner {
639
639
  }
640
640
  }
641
641
  class Context {
642
+ /** @internal */
643
+
644
+ /** @internal */
645
+
646
+ /** @internal */
647
+
642
648
  constructor(owner, isCacheHandler) {
643
649
  this.id = owner.requestId;
644
650
  this.___owner = owner;
@@ -663,6 +669,8 @@ class Context {
663
669
  get hasRequestedStream() {
664
670
  return this.___owner.hasRequestedStream;
665
671
  }
672
+
673
+ /** @private */
666
674
  _finalize() {
667
675
  this._finalized = true;
668
676
  }
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { setLogging, getRuntimeConfig } from './types/runtime.js';
2
- import { a as cloneResponseProperties, I as IS_CACHE_HANDLER, b as assertValidRequest, e as executeNextHandler, d as getRequestResult, u as upgradePromise, s as setPromiseResult, f as clearRequestResult } from "./context-Bh-MA_tH.js";
2
+ import { a as cloneResponseProperties, I as IS_CACHE_HANDLER, b as assertValidRequest, e as executeNextHandler, d as getRequestResult, u as upgradePromise, s as setPromiseResult, f as clearRequestResult } from "./context-C_7OLieY.js";
3
3
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
4
4
  import { w as waitFor } from "./configure-C3x8YXzL.js";
5
5
  import { peekUniversalTransient, setUniversalTransient } from './types/-private.js';
6
6
  import { EnableHydration } from './types/request.js';
7
- export { C as CacheHandler, S as Store, r as recordIdentifierFor, U as setIdentifierForgetMethod, Q as setIdentifierGenerationMethod, V as setIdentifierResetMethod, T as setIdentifierUpdateMethod, W as setKeyInfoForResource, s as storeFor } from "./request-state-DGyt5EV8.js";
7
+ export { C as CacheHandler, S as Store, r as recordIdentifierFor, U as setIdentifierForgetMethod, Q as setIdentifierGenerationMethod, V as setIdentifierResetMethod, T as setIdentifierUpdateMethod, W as setKeyInfoForResource, s as storeFor } from "./request-state-CxDzTjFX.js";
8
8
  import '@ember/debug';
9
9
  import './utils/string.js';
10
10
  import "./symbols-sql1_mdx.js";
package/dist/reactive.js CHANGED
@@ -1,5 +1,5 @@
1
- import { L as ReactiveResource, M as isNonIdentityCacheableField, N as getFieldCacheKeyStrict, r as recordIdentifierFor, H as withSignalStore, G as createInternalMemo } from "./request-state-DGyt5EV8.js";
2
- export { O as checkout, P as commit } from "./request-state-DGyt5EV8.js";
1
+ import { L as ReactiveResource, M as isNonIdentityCacheableField, N as getFieldCacheKeyStrict, r as recordIdentifierFor, H as withSignalStore, G as createInternalMemo } from "./request-state-CxDzTjFX.js";
2
+ export { O as checkout, P as commit } from "./request-state-CxDzTjFX.js";
3
3
  import { isResourceSchema } from './types/schema/fields.js';
4
4
  import { D as Destroy, C as Context } from "./symbols-sql1_mdx.js";
5
5
  export { a as Checkout } from "./symbols-sql1_mdx.js";
@@ -7,7 +7,7 @@ import { CACHE_OWNER, DEBUG_STALE_CACHE_OWNER, DEBUG_KEY_TYPE, DEBUG_CLIENT_ORIG
7
7
  import { dasherize } from './utils/string.js';
8
8
  import { S as SOURCE, C as Context, D as Destroy, a as Checkout, b as Commit } from "./symbols-sql1_mdx.js";
9
9
  import { c as createSignal, a as consumeSignal, n as notifySignal, b as createMemo, A as ARRAY_SIGNAL, O as OBJECT_SIGNAL, d as willSyncFlushWatchers } from "./configure-C3x8YXzL.js";
10
- import { g as getPromiseResult, s as setPromiseResult } from "./context-Bh-MA_tH.js";
10
+ import { g as getPromiseResult, s as setPromiseResult } from "./context-C_7OLieY.js";
11
11
  import { RecordStore } from './types/symbols.js';
12
12
  const INITIALIZER_PROTO = {
13
13
  isInitializer: true
@@ -535,6 +535,10 @@ class ReactiveDocument {
535
535
  * @public
536
536
  */
537
537
 
538
+ /** @internal */
539
+
540
+ /** @internal */
541
+
538
542
  constructor(store, cacheKey, localCache) {
539
543
  this._store = store;
540
544
  this._localCache = localCache;
@@ -558,6 +562,8 @@ class ReactiveDocument {
558
562
  });
559
563
  }
560
564
  }
565
+
566
+ /** @internal */
561
567
  async #request(link, options = withBrand({
562
568
  url: '',
563
569
  method: 'GET'
@@ -4462,6 +4468,9 @@ function unloadRecord(instances, identifier) {
4462
4468
  */
4463
4469
  class CacheManager {
4464
4470
  version = '2';
4471
+
4472
+ /** @internal */
4473
+
4465
4474
  constructor(cache) {
4466
4475
  this.___cache = cache;
4467
4476
  }
@@ -5140,6 +5149,8 @@ class NotificationManager {
5140
5149
  _onNextFlush(cb) {
5141
5150
  this._onFlushCB = cb;
5142
5151
  }
5152
+
5153
+ /** @internal */
5143
5154
  _scheduleNotify() {
5144
5155
  const asyncFlush = this.store._enableAsyncFlush;
5145
5156
  if (this._hasFlush) {
@@ -6057,6 +6068,8 @@ class RecordArrayManager {
6057
6068
  this._managed.add(array);
6058
6069
  return array;
6059
6070
  }
6071
+
6072
+ /** @internal */
6060
6073
  dirtyArray(array, delta, shouldSyncFromCache) {
6061
6074
  if (array === FAKE_ARR) {
6062
6075
  return;
@@ -6421,6 +6434,8 @@ class RequestStateService {
6421
6434
  });
6422
6435
  this._toFlush = [];
6423
6436
  }
6437
+
6438
+ /** @internal */
6424
6439
  _flushRequest(req) {
6425
6440
  req[Touching].forEach(identifier => {
6426
6441
  const subscriptions = this._subscriptions.get(identifier);
@@ -6429,10 +6444,14 @@ class RequestStateService {
6429
6444
  }
6430
6445
  });
6431
6446
  }
6447
+
6448
+ /** @internal */
6432
6449
  _dequeue(identifier, request) {
6433
6450
  const pending = this._pending.get(identifier);
6434
6451
  this._pending.set(identifier, pending.filter(req => req !== request));
6435
6452
  }
6453
+
6454
+ /** @internal */
6436
6455
  _addDone(request) {
6437
6456
  request[Touching].forEach(identifier => {
6438
6457
  // TODO add support for multiple
@@ -9623,6 +9642,7 @@ class RequestSubscription {
9623
9642
  // if we need to react to those changes, we can
9624
9643
  // use a modifier or internal component or some
9625
9644
  // such to trigger a re-run of this function.
9645
+ /** @internal */
9626
9646
  static {
9627
9647
  decorateMethodV2(this.prototype, "autorefreshTypes", [memoized]);
9628
9648
  }
@@ -9662,6 +9682,8 @@ class RequestSubscription {
9662
9682
  this._maybeUpdate();
9663
9683
  }, autorefreshThreshold);
9664
9684
  }
9685
+
9686
+ /** @internal */
9665
9687
  _clearInterval() {
9666
9688
  if (this._nextInterval) {
9667
9689
  clearTimeout(this._nextInterval);
@@ -10135,9 +10157,35 @@ async function watchStream(stream, loadingState) {
10135
10157
  * @hideconstructor
10136
10158
  */
10137
10159
  class RequestLoadingState {
10160
+ /** @internal */
10161
+
10162
+ /** @internal */
10163
+
10164
+ /** @internal */
10165
+
10166
+ /** @internal */
10167
+
10168
+ /** @internal */
10169
+
10170
+ /** @internal */
10171
+
10172
+ /** @internal */
10173
+
10174
+ /** @internal */
10175
+
10176
+ /** @internal */
10177
+
10178
+ /** @internal */
10179
+
10180
+ /** @internal */
10181
+
10182
+ /** @internal */
10138
10183
  _stream = null;
10184
+ /** @internal */
10139
10185
  _future;
10186
+ /** @internal */
10140
10187
  _triggered = false;
10188
+ /** @internal */
10141
10189
  _trigger() {
10142
10190
  if (this._triggered) {
10143
10191
  return;
package/dist/request.js CHANGED
@@ -1 +1 @@
1
- export { c as createDeferred, g as getPromiseResult, s as setPromiseResult } from "./context-Bh-MA_tH.js";
1
+ export { c as createDeferred, g as getPromiseResult, s as setPromiseResult } from "./context-C_7OLieY.js";
@@ -1,2 +1,2 @@
1
- export { C as CacheHandler, D as DISPOSE, R as RecordArrayManager, E as Signals, S as Store, k as StoreMap, _ as _clearCaches, n as _deprecatingNormalize, h as assertPrivateCapabilities, d as assertPrivateStore, b as coerceId, c as constructResource, J as consumeInternalSignal, G as createInternalMemo, l as createLegacyManyArray, q as createRequestSubscription, A as defineGate, B as defineNonEnumerableSignal, z as defineSignal, e as ensureStringId, y as entangleInitiallyStaleSignal, x as entangleSignal, f as fastPush, w as gate, K as getOrCreateInternalSignal, p as getPromiseState, t as getRequestState, g as isPrivateStore, a as isRequestKey, i as isResourceKey, m as log, o as logGroup, v as memoized, I as notifyInternalSignal, F as peekInternalSignal, r as recordIdentifierFor, j as setRecordIdentifier, u as signal, s as storeFor, H as withSignalStore } from "../request-state-DGyt5EV8.js";
1
+ export { C as CacheHandler, D as DISPOSE, R as RecordArrayManager, E as Signals, S as Store, k as StoreMap, _ as _clearCaches, n as _deprecatingNormalize, h as assertPrivateCapabilities, d as assertPrivateStore, b as coerceId, c as constructResource, J as consumeInternalSignal, G as createInternalMemo, l as createLegacyManyArray, q as createRequestSubscription, A as defineGate, B as defineNonEnumerableSignal, z as defineSignal, e as ensureStringId, y as entangleInitiallyStaleSignal, x as entangleSignal, f as fastPush, w as gate, K as getOrCreateInternalSignal, p as getPromiseState, t as getRequestState, g as isPrivateStore, a as isRequestKey, i as isResourceKey, m as log, o as logGroup, v as memoized, I as notifyInternalSignal, F as peekInternalSignal, r as recordIdentifierFor, j as setRecordIdentifier, u as signal, s as storeFor, H as withSignalStore } from "../request-state-CxDzTjFX.js";
2
2
  export { A as ARRAY_SIGNAL, O as OBJECT_SIGNAL, w as waitFor } from "../configure-C3x8YXzL.js";
@@ -1,6 +1,6 @@
1
1
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
2
2
  const name = "@warp-drive/core";
3
- const version = "5.7.0-alpha.31";
3
+ const version = "5.7.0-alpha.33";
4
4
 
5
5
  // in testing mode, we utilize globals to ensure only one copy exists of
6
6
  // these maps, due to bugs in ember-auto-import
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warp-drive/core",
3
- "version": "5.7.0-alpha.31",
3
+ "version": "5.7.0-alpha.33",
4
4
  "description": "Core package for WarpDrive | All the Universal Basics",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -37,13 +37,13 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@embroider/macros": "^1.18.1",
40
- "@warp-drive/build-config": "5.7.0-alpha.31"
40
+ "@warp-drive/build-config": "5.7.0-alpha.33"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@babel/core": "^7.28.0",
44
44
  "@babel/plugin-transform-typescript": "^7.28.0",
45
45
  "@babel/preset-typescript": "^7.27.1",
46
- "@warp-drive/internal-config": "5.7.0-alpha.31",
46
+ "@warp-drive/internal-config": "5.7.0-alpha.33",
47
47
  "decorator-transforms": "^2.3.0",
48
48
  "ember-source": "~6.6.0",
49
49
  "expect-type": "^1.2.1",