@atlaskit/editor-core 238.0.2 → 238.0.3

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,16 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 238.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`fc2f6ea92bf86`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fc2f6ea92bf86) -
8
+ Behind `platform_editor_reduce_memory_leaks`: stop `editorStateNotificationPlugin` accumulating
9
+ every transaction in an array that is never read. The array kept each transaction, its documents
10
+ and any closures stored in transaction meta alive for the life of the editor, which in turn
11
+ retained deleted node views and their DOM.
12
+ - Updated dependencies
13
+
3
14
  ## 238.0.2
4
15
 
5
16
  ### Patch Changes
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.createEditorStateNotificationPlugin = void 0;
7
7
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
8
  var _state = require("@atlaskit/editor-prosemirror/state");
9
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
9
10
  var key = new _state.PluginKey('editorStateNotificationPlugin');
10
11
  var createEditorStateNotificationPlugin = exports.createEditorStateNotificationPlugin = function createEditorStateNotificationPlugin(onEditorStateUpdated, onEditorViewStateUpdatedCallbacks) {
11
12
  var transactions = [];
@@ -18,7 +19,11 @@ var createEditorStateNotificationPlugin = exports.createEditorStateNotificationP
18
19
  };
19
20
  },
20
21
  apply: function apply(tr) {
21
- transactions.push(tr);
22
+ if (!(0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_memory_leaks')) {
23
+ // Dead accumulator: nothing reads it, so it pins every transaction for the
24
+ // editor's lifetime. Delete it when the experiment ships.
25
+ transactions.push(tr);
26
+ }
22
27
  return {
23
28
  latestTransaction: tr
24
29
  };
@@ -1,5 +1,6 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
3
4
  const key = new PluginKey('editorStateNotificationPlugin');
4
5
  export const createEditorStateNotificationPlugin = (onEditorStateUpdated, onEditorViewStateUpdatedCallbacks) => {
5
6
  const transactions = [];
@@ -12,7 +13,11 @@ export const createEditorStateNotificationPlugin = (onEditorStateUpdated, onEdit
12
13
  };
13
14
  },
14
15
  apply(tr) {
15
- transactions.push(tr);
16
+ if (!isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
17
+ // Dead accumulator: nothing reads it, so it pins every transaction for the
18
+ // editor's lifetime. Delete it when the experiment ships.
19
+ transactions.push(tr);
20
+ }
16
21
  return {
17
22
  latestTransaction: tr
18
23
  };
@@ -1,5 +1,6 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
3
4
  var key = new PluginKey('editorStateNotificationPlugin');
4
5
  export var createEditorStateNotificationPlugin = function createEditorStateNotificationPlugin(onEditorStateUpdated, onEditorViewStateUpdatedCallbacks) {
5
6
  var transactions = [];
@@ -12,7 +13,11 @@ export var createEditorStateNotificationPlugin = function createEditorStateNotif
12
13
  };
13
14
  },
14
15
  apply: function apply(tr) {
15
- transactions.push(tr);
16
+ if (!isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
17
+ // Dead accumulator: nothing reads it, so it pins every transaction for the
18
+ // editor's lifetime. Delete it when the experiment ships.
19
+ transactions.push(tr);
20
+ }
16
21
  return {
17
22
  latestTransaction: tr
18
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "238.0.2",
3
+ "version": "238.0.3",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -77,7 +77,7 @@
77
77
  "@atlaskit/react-compiler-gating": "^0.2.0",
78
78
  "@atlaskit/react-ufo": "^8.1.0",
79
79
  "@atlaskit/task-decision": "^21.12.0",
80
- "@atlaskit/tmp-editor-statsig": "^240.0.0",
80
+ "@atlaskit/tmp-editor-statsig": "^241.0.0",
81
81
  "@atlaskit/tokens": "^20.6.0",
82
82
  "@atlaskit/tooltip": "^24.4.0",
83
83
  "@atlaskit/width-detector": "^7.2.0",
@@ -163,7 +163,7 @@
163
163
  "@atlaskit/navigation-system": "^11.3.0",
164
164
  "@atlaskit/popper": "^9.4.0",
165
165
  "@atlaskit/portal": "^7.0.0",
166
- "@atlaskit/profilecard": "^27.1.0",
166
+ "@atlaskit/profilecard": "^27.2.0",
167
167
  "@atlaskit/radio": "^10.2.0",
168
168
  "@atlaskit/renderer": "^151.0.0",
169
169
  "@atlaskit/section-message": "^10.2.0",
@@ -184,7 +184,7 @@
184
184
  "@atlassian/search-provider": "^29.0.0",
185
185
  "@atlassian/structured-docs-types": "workspace:^",
186
186
  "@atlassian/testing-library": "^0.12.0",
187
- "@atlassian/user-profile-card": "^1.45.0",
187
+ "@atlassian/user-profile-card": "^1.46.0",
188
188
  "@emotion/jest": "^11.8.0",
189
189
  "@testing-library/react": "^16.3.0",
190
190
  "@types/diff": "^5.0.2",