@atlaskit/editor-synced-block-provider 22.0.0 → 22.0.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/editor-synced-block-provider
2
2
 
3
+ ## 22.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f53a04e7c8b40`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f53a04e7c8b40) -
8
+ Restore the editor-synced-block-same-page-sync experiment guards to prevent Jira fetch-only
9
+ renderers from entering the same-document write-provider path.
10
+ - Updated dependencies
11
+
12
+ ## 22.0.1
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 22.0.0
4
19
 
5
20
  ### Patch Changes
@@ -276,6 +276,9 @@ var ReferenceSyncBlockStoreManager = exports.ReferenceSyncBlockStoreManager = /*
276
276
  key: "getLocalReference",
277
277
  value: function getLocalReference(resourceId) {
278
278
  var _this$sourceManager;
279
+ if (!(0, _isExperimentEnabled.isExperimentEnabled)('editor-synced-block-same-page-sync')) {
280
+ return undefined;
281
+ }
279
282
  var parsed = this.getSameDocumentReferenceParts(resourceId);
280
283
  if (!parsed) {
281
284
  return undefined;
@@ -979,8 +982,9 @@ var ReferenceSyncBlockStoreManager = exports.ReferenceSyncBlockStoreManager = /*
979
982
  if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_blocks_patch_11')) {
980
983
  this.subscribedSinceLastFlush = true;
981
984
  }
982
- var sameDocumentParts = this.getSameDocumentReferenceParts(resourceId);
983
- var localReference = this.getLocalReference(resourceId);
985
+ var isSamePageSyncEnabled = (0, _isExperimentEnabled.isExperimentEnabled)('editor-synced-block-same-page-sync');
986
+ var sameDocumentParts = isSamePageSyncEnabled ? this.getSameDocumentReferenceParts(resourceId) : undefined;
987
+ var localReference = isSamePageSyncEnabled ? this.getLocalReference(resourceId) : undefined;
984
988
  var unsubscribeRemote = this._subscriptionManager.subscribeToSyncBlock(resourceId, localId, function (instance) {
985
989
  if (!localReference) {
986
990
  callback(instance);
@@ -14,6 +14,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
14
14
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
16
  var _monitoring = require("@atlaskit/editor-common/monitoring");
17
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
17
18
  var _types = require("../common/types");
18
19
  var _errorHandling = require("../utils/errorHandling");
19
20
  var _experienceTracking = require("../utils/experienceTracking");
@@ -416,6 +417,9 @@ var SourceSyncBlockStoreManager = exports.SourceSyncBlockStoreManager = /*#__PUR
416
417
  }, {
417
418
  key: "getLocalSourceSnapshot",
418
419
  value: function getLocalSourceSnapshot(resourceId) {
420
+ if (!(0, _isExperimentEnabled.isExperimentEnabled)('editor-synced-block-same-page-sync')) {
421
+ return undefined;
422
+ }
419
423
  var cached = this.syncBlockCache.get(resourceId);
420
424
  if (!cached || cached.status === 'deleted') {
421
425
  return undefined;
@@ -431,6 +435,9 @@ var SourceSyncBlockStoreManager = exports.SourceSyncBlockStoreManager = /*#__PUR
431
435
  key: "subscribeToLocalSource",
432
436
  value: function subscribeToLocalSource(resourceId, callback) {
433
437
  var _this3 = this;
438
+ if (!(0, _isExperimentEnabled.isExperimentEnabled)('editor-synced-block-same-page-sync')) {
439
+ return function () {};
440
+ }
434
441
  var subscribers = this.localSourceSubscribers.get(resourceId);
435
442
  if (!subscribers) {
436
443
  subscribers = new Set();
@@ -196,6 +196,9 @@ export class ReferenceSyncBlockStoreManager {
196
196
  }
197
197
  getLocalReference(resourceId) {
198
198
  var _this$sourceManager;
199
+ if (!isExperimentEnabled('editor-synced-block-same-page-sync')) {
200
+ return undefined;
201
+ }
199
202
  const parsed = this.getSameDocumentReferenceParts(resourceId);
200
203
  if (!parsed) {
201
204
  return undefined;
@@ -820,8 +823,9 @@ export class ReferenceSyncBlockStoreManager {
820
823
  if (isExperimentEnabled('platform_editor_blocks_patch_11')) {
821
824
  this.subscribedSinceLastFlush = true;
822
825
  }
823
- const sameDocumentParts = this.getSameDocumentReferenceParts(resourceId);
824
- let localReference = this.getLocalReference(resourceId);
826
+ const isSamePageSyncEnabled = isExperimentEnabled('editor-synced-block-same-page-sync');
827
+ const sameDocumentParts = isSamePageSyncEnabled ? this.getSameDocumentReferenceParts(resourceId) : undefined;
828
+ let localReference = isSamePageSyncEnabled ? this.getLocalReference(resourceId) : undefined;
825
829
  const unsubscribeRemote = this._subscriptionManager.subscribeToSyncBlock(resourceId, localId, instance => {
826
830
  if (!localReference) {
827
831
  callback(instance);
@@ -1,5 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { logException } from '@atlaskit/editor-common/monitoring';
3
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
3
4
  import { SyncBlockError } from '../common/types';
4
5
  import { updateErrorPayload, createErrorPayload, deleteErrorPayload, updateCacheErrorPayload, getSourceInfoErrorPayload, updateSuccessPayload, createSuccessPayload, createSuccessOperationalPayload, addContentSuccessPayload, deleteSuccessPayload, fetchReferencesErrorPayload, buildErrorAttribution } from '../utils/errorHandling';
5
6
  import { getCreateSourceExperience, getDeleteSourceExperience, getSaveSourceExperience, getFetchSourceInfoExperience } from '../utils/experienceTracking';
@@ -334,6 +335,9 @@ export class SourceSyncBlockStoreManager {
334
335
  return (_this$syncBlockCache$ = this.syncBlockCache.get(resourceId)) === null || _this$syncBlockCache$ === void 0 ? void 0 : _this$syncBlockCache$.status;
335
336
  }
336
337
  getLocalSourceSnapshot(resourceId) {
338
+ if (!isExperimentEnabled('editor-synced-block-same-page-sync')) {
339
+ return undefined;
340
+ }
337
341
  const cached = this.syncBlockCache.get(resourceId);
338
342
  if (!cached || cached.status === 'deleted') {
339
343
  return undefined;
@@ -349,6 +353,9 @@ export class SourceSyncBlockStoreManager {
349
353
  };
350
354
  }
351
355
  subscribeToLocalSource(resourceId, callback) {
356
+ if (!isExperimentEnabled('editor-synced-block-same-page-sync')) {
357
+ return () => {};
358
+ }
352
359
  let subscribers = this.localSourceSubscribers.get(resourceId);
353
360
  if (!subscribers) {
354
361
  subscribers = new Set();
@@ -269,6 +269,9 @@ export var ReferenceSyncBlockStoreManager = /*#__PURE__*/function () {
269
269
  key: "getLocalReference",
270
270
  value: function getLocalReference(resourceId) {
271
271
  var _this$sourceManager;
272
+ if (!isExperimentEnabled('editor-synced-block-same-page-sync')) {
273
+ return undefined;
274
+ }
272
275
  var parsed = this.getSameDocumentReferenceParts(resourceId);
273
276
  if (!parsed) {
274
277
  return undefined;
@@ -972,8 +975,9 @@ export var ReferenceSyncBlockStoreManager = /*#__PURE__*/function () {
972
975
  if (isExperimentEnabled('platform_editor_blocks_patch_11')) {
973
976
  this.subscribedSinceLastFlush = true;
974
977
  }
975
- var sameDocumentParts = this.getSameDocumentReferenceParts(resourceId);
976
- var localReference = this.getLocalReference(resourceId);
978
+ var isSamePageSyncEnabled = isExperimentEnabled('editor-synced-block-same-page-sync');
979
+ var sameDocumentParts = isSamePageSyncEnabled ? this.getSameDocumentReferenceParts(resourceId) : undefined;
980
+ var localReference = isSamePageSyncEnabled ? this.getLocalReference(resourceId) : undefined;
977
981
  var unsubscribeRemote = this._subscriptionManager.subscribeToSyncBlock(resourceId, localId, function (instance) {
978
982
  if (!localReference) {
979
983
  callback(instance);
@@ -13,6 +13,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
13
13
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
14
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
15
15
  import { logException } from '@atlaskit/editor-common/monitoring';
16
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
16
17
  import { SyncBlockError } from '../common/types';
17
18
  import { updateErrorPayload, createErrorPayload, deleteErrorPayload, updateCacheErrorPayload, getSourceInfoErrorPayload, updateSuccessPayload, createSuccessPayload, createSuccessOperationalPayload, addContentSuccessPayload, deleteSuccessPayload, fetchReferencesErrorPayload, buildErrorAttribution } from '../utils/errorHandling';
18
19
  import { getCreateSourceExperience, getDeleteSourceExperience, getSaveSourceExperience, getFetchSourceInfoExperience } from '../utils/experienceTracking';
@@ -409,6 +410,9 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
409
410
  }, {
410
411
  key: "getLocalSourceSnapshot",
411
412
  value: function getLocalSourceSnapshot(resourceId) {
413
+ if (!isExperimentEnabled('editor-synced-block-same-page-sync')) {
414
+ return undefined;
415
+ }
412
416
  var cached = this.syncBlockCache.get(resourceId);
413
417
  if (!cached || cached.status === 'deleted') {
414
418
  return undefined;
@@ -424,6 +428,9 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
424
428
  key: "subscribeToLocalSource",
425
429
  value: function subscribeToLocalSource(resourceId, callback) {
426
430
  var _this3 = this;
431
+ if (!isExperimentEnabled('editor-synced-block-same-page-sync')) {
432
+ return function () {};
433
+ }
427
434
  var subscribers = this.localSourceSubscribers.get(resourceId);
428
435
  if (!subscribers) {
429
436
  subscribers = new Set();
package/package.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "@atlaskit/node-data-provider": "^27.0.0",
24
24
  "@atlaskit/platform-feature-experiments": "^0.3.0",
25
25
  "@atlaskit/platform-feature-flags": "^2.2.0",
26
- "@atlaskit/tmp-editor-statsig": "^227.0.0",
26
+ "@atlaskit/tmp-editor-statsig": "^229.0.0",
27
27
  "@babel/runtime": "^7.0.0",
28
28
  "@compiled/react": "^1.0.2",
29
29
  "bind-event-listener": "^3.0.0",
@@ -33,7 +33,7 @@
33
33
  "uuid": "^11.1.1"
34
34
  },
35
35
  "peerDependencies": {
36
- "@atlaskit/editor-common": "^130.0.0",
36
+ "@atlaskit/editor-common": "^130.3.0",
37
37
  "react": "^18.2.0 || ^19.2.0"
38
38
  },
39
39
  "devDependencies": {
@@ -42,7 +42,7 @@
42
42
  "react-dom": "^19.2.0"
43
43
  },
44
44
  "name": "@atlaskit/editor-synced-block-provider",
45
- "version": "22.0.0",
45
+ "version": "22.0.2",
46
46
  "description": "Synced Block Provider for @atlaskit/editor-plugin-synced-block",
47
47
  "author": "Atlassian Pty Ltd",
48
48
  "license": "Apache-2.0",