@atlaskit/node-data-provider 8.3.0 → 8.3.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/node-data-provider
2
2
 
3
+ ## 8.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`53c9f85806f98`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/53c9f85806f98) -
8
+ EDITOR-5275 Store synced blocks data in session storage for look up during page transitions
9
+
10
+ ## 8.3.1
11
+
12
+ ### Patch Changes
13
+
14
+ - [`fa62876ed1943`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fa62876ed1943) -
15
+ EDITOR-5134 Clean up platform_synced_block_patch_1
16
+ - Updated dependencies
17
+
3
18
  ## 8.3.0
4
19
 
5
20
  ### Minor Changes
@@ -12,7 +12,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
12
12
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
13
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
14
14
  var _coreUtils = require("@atlaskit/editor-common/core-utils");
15
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
16
16
  /**
17
17
  * Represents the SSR data for a single provider.
18
18
  * It's a map where each key is a unique node data key and the value is the prefetched data for that node.
@@ -71,7 +71,7 @@ var NodeDataProvider = exports.NodeDataProvider = /*#__PURE__*/function () {
71
71
  key: "setSSRData",
72
72
  value: function setSSRData() {
73
73
  var ssrData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
74
- if ((0, _platformFeatureFlags.fg)('platform_synced_block_patch_1')) {
74
+ if ((0, _experiments.editorExperiment)('platform_synced_block', true)) {
75
75
  this.updateCache(ssrData, {
76
76
  strategy: 'replace',
77
77
  source: 'ssr'
@@ -227,7 +227,7 @@ var NodeDataProvider = exports.NodeDataProvider = /*#__PURE__*/function () {
227
227
  // because it could be stale data.
228
228
  if (cacheVersionBeforeRequest === this.cacheVersion) {
229
229
  // Replace promise with the resolved data in the cache
230
- if ((0, _platformFeatureFlags.fg)('platform_synced_block_patch_1')) {
230
+ if ((0, _experiments.editorExperiment)('platform_synced_block', true)) {
231
231
  this.updateCache((0, _defineProperty2.default)({}, dataKey, _data), {
232
232
  strategy: 'merge',
233
233
  source: 'network'
@@ -336,6 +336,17 @@ var NodeDataProvider = exports.NodeDataProvider = /*#__PURE__*/function () {
336
336
  return this.cache[dataKey];
337
337
  }
338
338
 
339
+ /**
340
+ * Returns the keys of the cache.
341
+ *
342
+ * @returns An array of the keys of the cache.
343
+ */
344
+ }, {
345
+ key: "getNodeDataCacheKeys",
346
+ value: function getNodeDataCacheKeys() {
347
+ return Object.keys(this.cache);
348
+ }
349
+
339
350
  /**
340
351
  * Updates the cache with new records using merge or replace strategies.
341
352
  * This method should be the only way to modify the cache directly.
@@ -1,5 +1,5 @@
1
1
  import { isSSR } from '@atlaskit/editor-common/core-utils';
2
- import { fg } from '@atlaskit/platform-feature-flags';
2
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
3
 
4
4
  /**
5
5
  * Represents the SSR data for a single provider.
@@ -84,7 +84,7 @@ export class NodeDataProvider {
84
84
  * @param ssrData A map of node data keys to their corresponding data.
85
85
  */
86
86
  setSSRData(ssrData = {}) {
87
- if (fg('platform_synced_block_patch_1')) {
87
+ if (editorExperiment('platform_synced_block', true)) {
88
88
  this.updateCache(ssrData, {
89
89
  strategy: 'replace',
90
90
  source: 'ssr'
@@ -210,7 +210,7 @@ export class NodeDataProvider {
210
210
  // because it could be stale data.
211
211
  if (cacheVersionBeforeRequest === this.cacheVersion) {
212
212
  // Replace promise with the resolved data in the cache
213
- if (fg('platform_synced_block_patch_1')) {
213
+ if (editorExperiment('platform_synced_block', true)) {
214
214
  this.updateCache({
215
215
  [dataKey]: data
216
216
  }, {
@@ -301,6 +301,15 @@ export class NodeDataProvider {
301
301
  return this.cache[dataKey];
302
302
  }
303
303
 
304
+ /**
305
+ * Returns the keys of the cache.
306
+ *
307
+ * @returns An array of the keys of the cache.
308
+ */
309
+ getNodeDataCacheKeys() {
310
+ return Object.keys(this.cache);
311
+ }
312
+
304
313
  /**
305
314
  * Updates the cache with new records using merge or replace strategies.
306
315
  * This method should be the only way to modify the cache directly.
@@ -5,7 +5,7 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
5
5
  import _createClass from "@babel/runtime/helpers/createClass";
6
6
  import _regeneratorRuntime from "@babel/runtime/regenerator";
7
7
  import { isSSR } from '@atlaskit/editor-common/core-utils';
8
- import { fg } from '@atlaskit/platform-feature-flags';
8
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
9
9
 
10
10
  /**
11
11
  * Represents the SSR data for a single provider.
@@ -68,7 +68,7 @@ export var NodeDataProvider = /*#__PURE__*/function () {
68
68
  key: "setSSRData",
69
69
  value: function setSSRData() {
70
70
  var ssrData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
71
- if (fg('platform_synced_block_patch_1')) {
71
+ if (editorExperiment('platform_synced_block', true)) {
72
72
  this.updateCache(ssrData, {
73
73
  strategy: 'replace',
74
74
  source: 'ssr'
@@ -224,7 +224,7 @@ export var NodeDataProvider = /*#__PURE__*/function () {
224
224
  // because it could be stale data.
225
225
  if (cacheVersionBeforeRequest === this.cacheVersion) {
226
226
  // Replace promise with the resolved data in the cache
227
- if (fg('platform_synced_block_patch_1')) {
227
+ if (editorExperiment('platform_synced_block', true)) {
228
228
  this.updateCache(_defineProperty({}, dataKey, _data), {
229
229
  strategy: 'merge',
230
230
  source: 'network'
@@ -333,6 +333,17 @@ export var NodeDataProvider = /*#__PURE__*/function () {
333
333
  return this.cache[dataKey];
334
334
  }
335
335
 
336
+ /**
337
+ * Returns the keys of the cache.
338
+ *
339
+ * @returns An array of the keys of the cache.
340
+ */
341
+ }, {
342
+ key: "getNodeDataCacheKeys",
343
+ value: function getNodeDataCacheKeys() {
344
+ return Object.keys(this.cache);
345
+ }
346
+
336
347
  /**
337
348
  * Updates the cache with new records using merge or replace strategies.
338
349
  * This method should be the only way to modify the cache directly.
@@ -171,6 +171,12 @@ export declare abstract class NodeDataProvider<Node extends JSONNode, Data> {
171
171
  * @returns The cached data object containing `data` and `source`, or `undefined` if no cache entry exists.
172
172
  */
173
173
  getNodeDataFromCache(node: JSONNode | PMNode): CacheData<Data>[string] | undefined;
174
+ /**
175
+ * Returns the keys of the cache.
176
+ *
177
+ * @returns An array of the keys of the cache.
178
+ */
179
+ getNodeDataCacheKeys(): string[];
174
180
  /**
175
181
  * Updates the cache with new records using merge or replace strategies.
176
182
  * This method should be the only way to modify the cache directly.
@@ -171,6 +171,12 @@ export declare abstract class NodeDataProvider<Node extends JSONNode, Data> {
171
171
  * @returns The cached data object containing `data` and `source`, or `undefined` if no cache entry exists.
172
172
  */
173
173
  getNodeDataFromCache(node: JSONNode | PMNode): CacheData<Data>[string] | undefined;
174
+ /**
175
+ * Returns the keys of the cache.
176
+ *
177
+ * @returns An array of the keys of the cache.
178
+ */
179
+ getNodeDataCacheKeys(): string[];
174
180
  /**
175
181
  * Updates the cache with new records using merge or replace strategies.
176
182
  * This method should be the only way to modify the cache directly.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/node-data-provider",
3
- "version": "8.3.0",
3
+ "version": "8.3.2",
4
4
  "description": "Node data provider for @atlaskit/editor-core plugins and @atlaskit/renderer",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -22,10 +22,11 @@
22
22
  "@atlaskit/editor-json-transformer": "^8.31.0",
23
23
  "@atlaskit/editor-prosemirror": "^7.3.0",
24
24
  "@atlaskit/platform-feature-flags": "^1.1.0",
25
+ "@atlaskit/tmp-editor-statsig": "^25.2.0",
25
26
  "@babel/runtime": "^7.0.0"
26
27
  },
27
28
  "peerDependencies": {
28
- "@atlaskit/editor-common": "^111.11.0"
29
+ "@atlaskit/editor-common": "^111.14.0"
29
30
  },
30
31
  "techstack": {
31
32
  "@atlassian/frontend": {
@@ -50,11 +51,6 @@
50
51
  ]
51
52
  }
52
53
  },
53
- "platform-feature-flags": {
54
- "platform_synced_block_patch_1": {
55
- "type": "boolean"
56
- }
57
- },
58
54
  "stricter": {
59
55
  "no-unused-dependencies": {
60
56
  "checkDevDependencies": true