@warp-drive/legacy 5.7.0-alpha.8 → 5.7.0-beta.0
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/declarations/adapter/-private/build-url-mixin.d.ts +0 -13
- package/declarations/adapter/-private/utils/continue-on-reject.d.ts +1 -7
- package/declarations/adapter/-private/utils/serialize-query-params.d.ts +0 -4
- package/declarations/adapter/error.d.ts +0 -1
- package/declarations/adapter/rest.d.ts +0 -2
- package/declarations/adapter.d.ts +0 -5
- package/declarations/compat/builders/find-all.d.ts +2 -2
- package/declarations/compat/builders/query.d.ts +2 -2
- package/declarations/compat/builders/save-record.d.ts +3 -3
- package/declarations/compat/legacy-network-handler/fetch-manager.d.ts +24 -17
- package/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +2 -2
- package/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +5 -5
- package/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +3 -8
- package/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +40 -18
- package/declarations/compat/legacy-network-handler/snapshot.d.ts +63 -44
- package/declarations/compat.d.ts +3 -6
- package/declarations/model/-private/attr.d.ts +1 -14
- package/declarations/model/-private/belongs-to.d.ts +0 -11
- package/declarations/model/-private/debug/assert-polymorphic-type.d.ts +2 -14
- package/declarations/model/-private/errors.d.ts +0 -6
- package/declarations/model/-private/has-many.d.ts +0 -4
- package/declarations/model/-private/hooks.d.ts +2 -2
- package/declarations/model/-private/legacy-relationships-support.d.ts +18 -27
- package/declarations/model/-private/model-for-mixin.d.ts +0 -16
- package/declarations/model/-private/model-methods.d.ts +0 -4
- package/declarations/model/-private/model.d.ts +13 -69
- package/declarations/model/-private/notify-changes.d.ts +2 -2
- package/declarations/model/-private/promise-belongs-to.d.ts +0 -6
- package/declarations/model/-private/promise-many-array.d.ts +0 -11
- package/declarations/model/-private/record-state.d.ts +2 -25
- package/declarations/model/-private/references/belongs-to.d.ts +6 -7
- package/declarations/model/-private/references/has-many.d.ts +6 -13
- package/declarations/model/-private/schema-provider.d.ts +6 -10
- package/declarations/model/-private.d.ts +1 -2
- package/declarations/model/migration-support.d.ts +9 -33
- package/declarations/serializer/json-api.d.ts +0 -1
- package/declarations/serializer/json.d.ts +0 -1
- package/declarations/serializer/rest.d.ts +0 -1
- package/declarations/store/-private.d.ts +12 -24
- package/dist/{-private-CKrP0ogQ.js → -private-8UmnAf9J.js} +169 -141
- package/dist/adapter/-private.js +1 -1
- package/dist/adapter/json-api.js +1 -1
- package/dist/adapter/rest.js +1 -1
- package/dist/compat/-private.js +1 -1
- package/dist/compat/builders.js +3 -2
- package/dist/compat.js +7 -2
- package/dist/{errors-BX5wowuz.js → errors-8kD2mSe_.js} +66 -36
- package/dist/model/-private.js +1 -2
- package/dist/model/migration-support.js +7 -4
- package/dist/model.js +13 -11
- package/dist/{schema-provider-Cbnf6sKm.js → schema-provider-DQu4Rjco.js} +62 -26
- package/dist/{serialize-into-hash-Bp58npke.js → serialize-into-hash-CS0MIv4F.js} +2 -1
- package/dist/store.js +8 -6
- package/package.json +15 -15
package/dist/store.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineSignal, ensureStringId, recordIdentifierFor, constructResource, storeFor } from '@warp-drive/core/store/-private';
|
|
1
|
+
import { defineSignal, assertPrivateStore, ensureStringId, recordIdentifierFor, constructResource, storeFor } from '@warp-drive/core/store/-private';
|
|
2
2
|
import { SkipCache } from '@warp-drive/core/types/request';
|
|
3
3
|
import { i as isMaybeIdentifier } from "./utils-Cqw9eRj5.js";
|
|
4
4
|
import { n as normalizeModelName } from "./util-Dul6TZts.js";
|
|
@@ -37,6 +37,7 @@ function preloadData(store, identifier, preload) {
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
const cache = store.cache;
|
|
40
|
+
assertPrivateStore(store);
|
|
40
41
|
const hasRecord = Boolean(store._instanceCache.peek(identifier));
|
|
41
42
|
cache.upsert(identifier, jsonPayload, hasRecord);
|
|
42
43
|
}
|
|
@@ -399,8 +400,9 @@ function restoreDeprecatedStoreBehaviors(StoreKlass) {
|
|
|
399
400
|
const normalizedId = ensureStringId(id);
|
|
400
401
|
resource = constructResource(type, normalizedId);
|
|
401
402
|
}
|
|
402
|
-
const identifier = this.
|
|
403
|
+
const identifier = this.cacheKeyManager.getOrCreateRecordIdentifier(resource);
|
|
403
404
|
options = options || {};
|
|
405
|
+
assertPrivateStore(this);
|
|
404
406
|
if (options.preload) {
|
|
405
407
|
// force reload if we preload to ensure we don't resolve the promise
|
|
406
408
|
// until we are complete, else we will end up background-reloading
|
|
@@ -522,8 +524,6 @@ function restoreDeprecatedStoreBehaviors(StoreKlass) {
|
|
|
522
524
|
});
|
|
523
525
|
return promise.then(document => document.content);
|
|
524
526
|
};
|
|
525
|
-
|
|
526
|
-
// @ts-expect-error RecordReference private store shouldn't matter
|
|
527
527
|
StoreKlass.prototype.getReference = function (resource, id) {
|
|
528
528
|
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
529
529
|
if (!test) {
|
|
@@ -543,7 +543,8 @@ function restoreDeprecatedStoreBehaviors(StoreKlass) {
|
|
|
543
543
|
throw new Error('getReference expected to receive either a resource identifier or type and id as arguments');
|
|
544
544
|
}
|
|
545
545
|
})(isMaybeIdentifier(resourceIdentifier)) : {};
|
|
546
|
-
const identifier = this.
|
|
546
|
+
const identifier = this.cacheKeyManager.getOrCreateRecordIdentifier(resourceIdentifier);
|
|
547
|
+
assertPrivateStore(this);
|
|
547
548
|
const cache = upgradeInstanceCaches(this._instanceCache.__instances).reference;
|
|
548
549
|
let reference = cache.get(identifier);
|
|
549
550
|
if (!reference) {
|
|
@@ -582,7 +583,7 @@ function restoreDeprecatedStoreBehaviors(StoreKlass) {
|
|
|
582
583
|
if (!test) {
|
|
583
584
|
throw new Error(`Unable to initiate save for a record in a disconnected state`);
|
|
584
585
|
}
|
|
585
|
-
})(storeFor(record)) : {};
|
|
586
|
+
})(storeFor(record, true)) : {};
|
|
586
587
|
const identifier = recordIdentifierFor(record);
|
|
587
588
|
const cache = this.cache;
|
|
588
589
|
if (!identifier) {
|
|
@@ -590,6 +591,7 @@ function restoreDeprecatedStoreBehaviors(StoreKlass) {
|
|
|
590
591
|
// but just in case we reject here to prevent bad things.
|
|
591
592
|
return Promise.reject(new Error(`Record Is Disconnected`));
|
|
592
593
|
}
|
|
594
|
+
assertPrivateStore(this);
|
|
593
595
|
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
594
596
|
if (!test) {
|
|
595
597
|
throw new Error(`Cannot initiate a save request for an unloaded record: ${identifier.lid}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warp-drive/legacy",
|
|
3
|
-
"version": "5.7.0-
|
|
3
|
+
"version": "5.7.0-beta.0",
|
|
4
4
|
"description": "Decommissioned Packages for WarpDrive | Things your app might still want to maintain use of for a little longer.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -32,25 +32,25 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@warp-drive/core": "5.7.0-
|
|
36
|
-
"@warp-drive/utilities": "5.7.0-
|
|
35
|
+
"@warp-drive/core": "5.7.0-beta.0",
|
|
36
|
+
"@warp-drive/utilities": "5.7.0-beta.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@embroider/macros": "^1.
|
|
39
|
+
"@embroider/macros": "^1.18.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@babel/core": "^7.
|
|
43
|
-
"@babel/plugin-transform-typescript": "^7.
|
|
44
|
-
"@babel/preset-typescript": "^7.27.
|
|
45
|
-
"@types/jquery": "^3.5.
|
|
46
|
-
"@warp-drive/internal-config": "5.7.0-
|
|
47
|
-
"@warp-drive/core": "5.7.0-
|
|
48
|
-
"@warp-drive/utilities": "5.7.0-
|
|
49
|
-
"ember-source": "~6.
|
|
42
|
+
"@babel/core": "^7.28.3",
|
|
43
|
+
"@babel/plugin-transform-typescript": "^7.28.0",
|
|
44
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
45
|
+
"@types/jquery": "^3.5.33",
|
|
46
|
+
"@warp-drive/internal-config": "5.7.0-beta.0",
|
|
47
|
+
"@warp-drive/core": "5.7.0-beta.0",
|
|
48
|
+
"@warp-drive/utilities": "5.7.0-beta.0",
|
|
49
|
+
"ember-source": "~6.6.0",
|
|
50
50
|
"decorator-transforms": "^2.3.0",
|
|
51
|
-
"expect-type": "^1.2.
|
|
52
|
-
"typescript": "^5.
|
|
53
|
-
"vite": "^7.
|
|
51
|
+
"expect-type": "^1.2.2",
|
|
52
|
+
"typescript": "^5.9.2",
|
|
53
|
+
"vite": "^7.1.3"
|
|
54
54
|
},
|
|
55
55
|
"volta": {
|
|
56
56
|
"extends": "../../package.json"
|