@atlaskit/node-data-provider 8.2.0 → 8.3.1

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,21 @@
1
1
  # @atlaskit/node-data-provider
2
2
 
3
+ ## 8.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`fa62876ed1943`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fa62876ed1943) -
8
+ EDITOR-5134 Clean up platform_synced_block_patch_1
9
+ - Updated dependencies
10
+
11
+ ## 8.3.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`506d872ef2503`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/506d872ef2503) -
16
+ Add smartlink response caching to browser storage to reduce layoutshift on transition and page
17
+ load
18
+
3
19
  ## 8.2.0
4
20
 
5
21
  ### 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'
@@ -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
  }, {
@@ -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'
@@ -1,3 +1,4 @@
1
1
  export { NodeDataProvider } from './node-data-provider';
2
+ export type { CallbackPayload } from './node-data-provider';
2
3
  export { findNodesToPrefetch } from './utils/find-nodes-to-prefetch';
3
4
  export { prefetchNodeDataProvidersData } from './utils/prefetch-node-data-providers-data';
@@ -34,7 +34,7 @@ type CacheData<Data> = Record<string, {
34
34
  * Represents the payload passed to the callback function when data is fetched.
35
35
  * It can either contain an error or the fetched data.
36
36
  */
37
- type CallbackPayload<Data> = {
37
+ export type CallbackPayload<Data> = {
38
38
  data?: undefined;
39
39
  /** An error that occurred while fetching data. */
40
40
  error: Error;
@@ -1,3 +1,4 @@
1
1
  export { NodeDataProvider } from './node-data-provider';
2
+ export type { CallbackPayload } from './node-data-provider';
2
3
  export { findNodesToPrefetch } from './utils/find-nodes-to-prefetch';
3
4
  export { prefetchNodeDataProvidersData } from './utils/prefetch-node-data-providers-data';
@@ -34,7 +34,7 @@ type CacheData<Data> = Record<string, {
34
34
  * Represents the payload passed to the callback function when data is fetched.
35
35
  * It can either contain an error or the fetched data.
36
36
  */
37
- type CallbackPayload<Data> = {
37
+ export type CallbackPayload<Data> = {
38
38
  data?: undefined;
39
39
  /** An error that occurred while fetching data. */
40
40
  error: Error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/node-data-provider",
3
- "version": "8.2.0",
3
+ "version": "8.3.1",
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.0.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.12.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