@ember-data/store 5.5.0-alpha.11 → 5.5.0-alpha.13

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.
Files changed (105) hide show
  1. package/LICENSE.md +19 -7
  2. package/README.md +21 -12
  3. package/addon-main.cjs +5 -0
  4. package/dist/-private.js +1 -0
  5. package/{addon → dist}/index.js +4 -1
  6. package/{addon/store-service-b98547c2.js → dist/many-array-BwVo-2vv.js} +2757 -1384
  7. package/dist/many-array-BwVo-2vv.js.map +1 -0
  8. package/dist/types.js +0 -0
  9. package/dist/types.js.map +1 -0
  10. package/logos/NCC-1701-a-blue.svg +4 -0
  11. package/logos/NCC-1701-a-gold.svg +4 -0
  12. package/logos/NCC-1701-a-gold_100.svg +1 -0
  13. package/logos/NCC-1701-a-gold_base-64.txt +1 -0
  14. package/logos/NCC-1701-a.svg +4 -0
  15. package/logos/README.md +4 -0
  16. package/logos/docs-badge.svg +2 -0
  17. package/logos/github-header.svg +444 -0
  18. package/logos/social1.png +0 -0
  19. package/logos/social2.png +0 -0
  20. package/logos/warp-drive-logo-dark.svg +4 -0
  21. package/logos/warp-drive-logo-gold.svg +4 -0
  22. package/package.json +58 -51
  23. package/unstable-preview-types/-private/cache-handler/handler.d.ts +62 -0
  24. package/unstable-preview-types/-private/cache-handler/handler.d.ts.map +1 -0
  25. package/unstable-preview-types/-private/cache-handler/types.d.ts +107 -0
  26. package/unstable-preview-types/-private/cache-handler/types.d.ts.map +1 -0
  27. package/unstable-preview-types/-private/cache-handler/utils.d.ts +34 -0
  28. package/unstable-preview-types/-private/cache-handler/utils.d.ts.map +1 -0
  29. package/unstable-preview-types/-private/caches/cache-utils.d.ts +11 -0
  30. package/unstable-preview-types/-private/caches/cache-utils.d.ts.map +1 -0
  31. package/unstable-preview-types/-private/caches/identifier-cache.d.ts +180 -0
  32. package/unstable-preview-types/-private/caches/identifier-cache.d.ts.map +1 -0
  33. package/unstable-preview-types/-private/caches/instance-cache.d.ts +64 -0
  34. package/unstable-preview-types/-private/caches/instance-cache.d.ts.map +1 -0
  35. package/unstable-preview-types/-private/caches/resource-utils.d.ts +12 -0
  36. package/unstable-preview-types/-private/caches/resource-utils.d.ts.map +1 -0
  37. package/unstable-preview-types/-private/debug/utils.d.ts +9 -0
  38. package/unstable-preview-types/-private/debug/utils.d.ts.map +1 -0
  39. package/unstable-preview-types/-private/document.d.ts +155 -0
  40. package/unstable-preview-types/-private/document.d.ts.map +1 -0
  41. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts +179 -0
  42. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts.map +1 -0
  43. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +19 -0
  44. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts.map +1 -0
  45. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +31 -0
  46. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts.map +1 -0
  47. package/unstable-preview-types/-private/managers/cache-manager.d.ts +463 -0
  48. package/unstable-preview-types/-private/managers/cache-manager.d.ts.map +1 -0
  49. package/unstable-preview-types/-private/managers/notification-manager.d.ts +101 -0
  50. package/unstable-preview-types/-private/managers/notification-manager.d.ts.map +1 -0
  51. package/unstable-preview-types/-private/managers/record-array-manager.d.ts +101 -0
  52. package/unstable-preview-types/-private/managers/record-array-manager.d.ts.map +1 -0
  53. package/unstable-preview-types/-private/network/request-cache.d.ts +109 -0
  54. package/unstable-preview-types/-private/network/request-cache.d.ts.map +1 -0
  55. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +150 -0
  56. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts.map +1 -0
  57. package/unstable-preview-types/-private/record-arrays/many-array.d.ts +199 -0
  58. package/unstable-preview-types/-private/record-arrays/many-array.d.ts.map +1 -0
  59. package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts +118 -0
  60. package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts.map +1 -0
  61. package/unstable-preview-types/-private/store-service.d.ts +1595 -0
  62. package/unstable-preview-types/-private/store-service.d.ts.map +1 -0
  63. package/unstable-preview-types/-private/store-service.type-test.d.ts +4 -0
  64. package/unstable-preview-types/-private/store-service.type-test.d.ts.map +1 -0
  65. package/unstable-preview-types/-private/utils/coerce-id.d.ts +10 -0
  66. package/unstable-preview-types/-private/utils/coerce-id.d.ts.map +1 -0
  67. package/unstable-preview-types/-private/utils/construct-resource.d.ts +9 -0
  68. package/unstable-preview-types/-private/utils/construct-resource.d.ts.map +1 -0
  69. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts +4 -0
  70. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts.map +1 -0
  71. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts +4 -0
  72. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts.map +1 -0
  73. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts +4 -0
  74. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts.map +1 -0
  75. package/unstable-preview-types/-private.d.ts +28 -0
  76. package/unstable-preview-types/-private.d.ts.map +1 -0
  77. package/unstable-preview-types/-types/overview.d.ts +21 -0
  78. package/unstable-preview-types/-types/overview.d.ts.map +1 -0
  79. package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts +109 -0
  80. package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts.map +1 -0
  81. package/unstable-preview-types/-types/q/ds-model.d.ts +25 -0
  82. package/unstable-preview-types/-types/q/ds-model.d.ts.map +1 -0
  83. package/unstable-preview-types/-types/q/identifier.d.ts +193 -0
  84. package/unstable-preview-types/-types/q/identifier.d.ts.map +1 -0
  85. package/unstable-preview-types/-types/q/promise-proxies.d.ts +4 -0
  86. package/unstable-preview-types/-types/q/promise-proxies.d.ts.map +1 -0
  87. package/unstable-preview-types/-types/q/record-data-json-api.d.ts +36 -0
  88. package/unstable-preview-types/-types/q/record-data-json-api.d.ts.map +1 -0
  89. package/unstable-preview-types/-types/q/record-instance.d.ts +29 -0
  90. package/unstable-preview-types/-types/q/record-instance.d.ts.map +1 -0
  91. package/unstable-preview-types/-types/q/schema-service.d.ts +366 -0
  92. package/unstable-preview-types/-types/q/schema-service.d.ts.map +1 -0
  93. package/unstable-preview-types/-types/q/store.d.ts +38 -0
  94. package/unstable-preview-types/-types/q/store.d.ts.map +1 -0
  95. package/unstable-preview-types/index.d.ts +223 -0
  96. package/unstable-preview-types/index.d.ts.map +1 -0
  97. package/unstable-preview-types/types.d.ts +7 -0
  98. package/unstable-preview-types/types.d.ts.map +1 -0
  99. package/addon/-private.js +0 -1
  100. package/addon/store-service-b98547c2.js.map +0 -1
  101. package/addon-main.js +0 -93
  102. /package/{addon → dist}/-private.js.map +0 -0
  103. /package/{addon → dist}/index.js.map +0 -0
  104. /package/{ember-data-logo-dark.svg → logos/ember-data-logo-dark.svg} +0 -0
  105. /package/{ember-data-logo-light.svg → logos/ember-data-logo-light.svg} +0 -0
package/LICENSE.md CHANGED
@@ -1,11 +1,23 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
- Copyright (C) 2017-2023 Ember.js contributors
4
- Portions Copyright (C) 2011-2017 Tilde, Inc. and contributors.
5
- Portions Copyright (C) 2011 LivingSocial Inc.
3
+ Copyright (c) 2017-2025 Ember.js and contributors
4
+ Copyright (c) 2011-2017 Tilde, Inc. and contributors
5
+ Copyright (c) 2011 LivingSocial Inc.
6
6
 
7
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
8
13
 
9
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
10
16
 
11
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
package/README.md CHANGED
@@ -1,14 +1,14 @@
1
1
  <p align="center">
2
2
  <img
3
3
  class="project-logo"
4
- src="./ember-data-logo-dark.svg#gh-dark-mode-only"
4
+ src="./logos/ember-data-logo-dark.svg#gh-dark-mode-only"
5
5
  alt="EmberData Store"
6
6
  width="240px"
7
7
  title="EmberData Store"
8
8
  />
9
9
  <img
10
10
  class="project-logo"
11
- src="./ember-data-logo-light.svg#gh-light-mode-only"
11
+ src="./logos/ember-data-logo-light.svg#gh-light-mode-only"
12
12
  alt="EmberData Store"
13
13
  width="240px"
14
14
  title="EmberData Store"
@@ -55,12 +55,21 @@ pnpm add @ember-data/store
55
55
 
56
56
  After installing you will want to configure your first `Store`. Read more below for how to create and configure stores for your application.
57
57
 
58
+ **Tagged Releases**
59
+
60
+ - ![NPM Canary Version](https://img.shields.io/npm/v/%40ember-data/store/canary?label=%40canary&color=FFBF00)
61
+ - ![NPM Beta Version](https://img.shields.io/npm/v/%40ember-data/store/beta?label=%40beta&color=ff00ff)
62
+ - ![NPM Stable Version](https://img.shields.io/npm/v/%40ember-data/store/latest?label=%40latest&color=90EE90)
63
+ - ![NPM LTS Version](https://img.shields.io/npm/v/%40ember-data/store/lts?label=%40lts&color=0096FF)
64
+ - ![NPM LTS 4.12 Version](https://img.shields.io/npm/v/%40ember-data/store/lts-4-12?label=%40lts-4-12&color=bbbbbb)
65
+
58
66
 
59
67
  ## 🔨 Creating A Store
60
68
 
61
69
  To use a `Store` we will need to do few things: add a [Cache](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache) to store data **in-memory**, add a [Handler](https://github.com/emberjs/data/tree/main/packages/request#handling-requests) to fetch data from a source, and implement `instantiateRecord` to tell the store how to display the data for individual resources.
62
70
 
63
- > **Note** If you are using the package `ember-data` then a `JSON:API` cache and `instantiateRecord` are configured for you by default.
71
+ > **Note**
72
+ > If you are using the package `ember-data` then a `JSON:API` cache and `instantiateRecord` are configured for you by default.
64
73
 
65
74
  ### Configuring A Cache
66
75
 
@@ -81,7 +90,8 @@ class extends Store {
81
90
 
82
91
  Now that we have a `cache` let's setup something to handle fetching and saving data via our API.
83
92
 
84
- > **Note** The `ember-data` package automatically includes and configures the `@ember-data/json-api` cache for you.
93
+ > **Note**
94
+ > The `ember-data` package automatically includes and configures the `@ember-data/json-api` cache for you.
85
95
 
86
96
  ### Handling Requests
87
97
 
@@ -89,7 +99,8 @@ When *Ember***Data** needs to fetch or save data it will pass that request to yo
89
99
 
90
100
  To start, let's install the `RequestManager` from `@ember-data/request` and the basic `Fetch` handler from ``@ember-data/request/fetch`.
91
101
 
92
- > **Note** If your app uses `GraphQL`, `REST` or different conventions for `JSON:API` than your cache expects, other handlers may better fit your data. You can author your own handler by creating one that conforms to the [handler interface](https://github.com/emberjs/data/tree/main/packages/request#handling-requests).
102
+ > **Note**
103
+ > If your app uses `GraphQL`, `REST` or different conventions for `JSON:API` than your cache expects, other handlers may better fit your data. You can author your own handler by creating one that conforms to the [handler interface](https://github.com/emberjs/data/tree/main/packages/request#handling-requests).
93
104
 
94
105
  ```ts
95
106
  import Store, { CacheHandler } from '@ember-data/store';
@@ -97,12 +108,9 @@ import RequestManager from '@ember-data/request';
97
108
  import Fetch from '@ember-data/request/fetch';
98
109
 
99
110
  export default class extends Store {
100
- constructor() {
101
- super(...arguments);
102
- this.requestManager = new RequestManager();
103
- this.requestManager.use([Fetch]);
104
- this.requestManager.useCache(CacheHandler);
105
- }
111
+ requestManager = new RequestManager()
112
+ .use([Fetch])
113
+ .useCache(CacheHandler);
106
114
  }
107
115
  ```
108
116
 
@@ -185,5 +193,6 @@ Typically you will choose an existing record implementation such as `@ember-data
185
193
 
186
194
  Because of the boundaries around instantiation and the cache, record implementations should be capable of interop both with each other and with any `Cache`. Due to this, if needed an application can utilize multiple record implementations and multiple cache implementations either to support enhanced features for only a subset of records or to be able to incrementally migrate from one record/cache to another record or cache.
187
195
 
188
- > **Note:** The `ember-data` package automatically includes the `@ember-data/model`
196
+ > **Note**
197
+ > The `ember-data` package automatically includes the `@ember-data/model`
189
198
  > package and configures it for you.
package/addon-main.cjs ADDED
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const { addonShim } = require('@warp-drive/build-config/addon-shim.cjs');
4
+
5
+ module.exports = addonShim(__dirname);
@@ -0,0 +1 @@
1
+ export { A as ARRAY_SIGNAL, C as CacheHandler, k as CollectionRecordArray, I as LiveArray, M as MUTATE, R as RecordArrayManager, w as RelatedCollection, l as SOURCE, S as Store, t as StoreMap, _ as _clearCaches, v as _deprecatingNormalize, h as coerceId, g as constructResource, j as ensureStringId, m as fastPush, f as isDocumentIdentifier, i as isStableIdentifier, x as log, y as logGroup, n as notifyArray, p as peekCache, r as recordIdentifierFor, o as removeRecordDataFor, u as setCacheFor, q as setRecordIdentifier, s as storeFor } from "./many-array-BwVo-2vv.js";
@@ -1 +1,4 @@
1
- export { C as CacheHandler, S as default, r as recordIdentifierFor, c as setIdentifierForgetMethod, a as setIdentifierGenerationMethod, d as setIdentifierResetMethod, b as setIdentifierUpdateMethod, s as storeFor } from "./store-service-b98547c2";
1
+ export { C as CacheHandler, S as default, r as recordIdentifierFor, c as setIdentifierForgetMethod, a as setIdentifierGenerationMethod, d as setIdentifierResetMethod, b as setIdentifierUpdateMethod, e as setKeyInfoForResource, s as storeFor } from "./many-array-BwVo-2vv.js";
2
+ import '@ember/debug';
3
+ import '@embroider/macros';
4
+ import '@ember-data/request-utils/string';