@atlaskit/editor-synced-block-renderer 10.0.2 → 10.2.0
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 +39 -1
- package/afm-cc/tsconfig.json +3 -3
- package/afm-products/tsconfig.json +3 -3
- package/dist/cjs/useSyncedBlockNodeComponent.js +14 -0
- package/dist/es2019/useSyncedBlockNodeComponent.js +14 -0
- package/dist/esm/useSyncedBlockNodeComponent.js +14 -0
- package/package.json +21 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,49 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-renderer
|
|
2
2
|
|
|
3
|
+
## 10.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`f13db8731461d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f13db8731461d) -
|
|
8
|
+
[EDITOR-7860] Gate synced block reference fetch and subscribe on data-provider readiness so
|
|
9
|
+
reference blocks no longer attempt to fetch before the (asynchronously wired) provider is ready.
|
|
10
|
+
This removes spurious "Data provider not set" fetch errors on Jira and keeps reference blocks
|
|
11
|
+
loading correctly once the provider resolves.
|
|
12
|
+
|
|
13
|
+
This also hardens the not-ready / torn-down window: a teardown-aware `hasDataProvider()` (also
|
|
14
|
+
checks `isDestroyed`), a tagged `ProviderNotReadyError` thrown at the fetch source, and catch-site
|
|
15
|
+
suppression in the hook, store manager and batch fetcher so an in-flight or queued fetch on an
|
|
16
|
+
orphaned manager re-queues for retry instead of emitting a false fetch error. All behaviour is
|
|
17
|
+
behind the `platform_editor_blocks_patch_3` feature gate.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
23
|
+
## 10.1.0
|
|
24
|
+
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- [`cd097a2111788`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cd097a2111788) -
|
|
28
|
+
Republish packages depending on `@atlaskit/react-compiler-gating` so their published dependency
|
|
29
|
+
reference is updated to the renamed `@atlaskit/react-compiler-gating` scope.
|
|
30
|
+
|
|
31
|
+
The earlier rename of `@atlassian/react-compiler-gating` to `@atlaskit/react-compiler-gating` only
|
|
32
|
+
bumped the renamed package itself, so dependent packages were never republished and their
|
|
33
|
+
published versions still referenced the old `@atlassian/react-compiler-gating` name, which is not
|
|
34
|
+
available in the public npm registry. This minor bump republishes all affected packages with the
|
|
35
|
+
corrected dependency.
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Updated dependencies
|
|
40
|
+
|
|
3
41
|
## 10.0.2
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
|
6
44
|
|
|
7
45
|
- [`ee28cf33718b0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ee28cf33718b0) -
|
|
8
|
-
Add @
|
|
46
|
+
Add @atlaskit/react-compiler-gating as a runtime dependency to enable React Compiler platform
|
|
9
47
|
gating.
|
|
10
48
|
- Updated dependencies
|
|
11
49
|
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -52,6 +52,9 @@
|
|
|
52
52
|
{
|
|
53
53
|
"path": "../../../design-system/primitives/afm-cc/tsconfig.json"
|
|
54
54
|
},
|
|
55
|
+
{
|
|
56
|
+
"path": "../../../react-compiler/react-compiler-gating/afm-cc/tsconfig.json"
|
|
57
|
+
},
|
|
55
58
|
{
|
|
56
59
|
"path": "../../renderer/afm-cc/tsconfig.json"
|
|
57
60
|
},
|
|
@@ -64,9 +67,6 @@
|
|
|
64
67
|
{
|
|
65
68
|
"path": "../../../design-system/tooltip/afm-cc/tsconfig.json"
|
|
66
69
|
},
|
|
67
|
-
{
|
|
68
|
-
"path": "../../../react-compiler/react-compiler-gating/afm-cc/tsconfig.json"
|
|
69
|
-
},
|
|
70
70
|
{
|
|
71
71
|
"path": "../../editor-common/afm-cc/tsconfig.json"
|
|
72
72
|
}
|
|
@@ -52,6 +52,9 @@
|
|
|
52
52
|
{
|
|
53
53
|
"path": "../../../design-system/primitives/afm-products/tsconfig.json"
|
|
54
54
|
},
|
|
55
|
+
{
|
|
56
|
+
"path": "../../../react-compiler/react-compiler-gating/afm-products/tsconfig.json"
|
|
57
|
+
},
|
|
55
58
|
{
|
|
56
59
|
"path": "../../renderer/afm-products/tsconfig.json"
|
|
57
60
|
},
|
|
@@ -64,9 +67,6 @@
|
|
|
64
67
|
{
|
|
65
68
|
"path": "../../../design-system/tooltip/afm-products/tsconfig.json"
|
|
66
69
|
},
|
|
67
|
-
{
|
|
68
|
-
"path": "../../../react-compiler/react-compiler-gating/afm-products/tsconfig.json"
|
|
69
|
-
},
|
|
70
70
|
{
|
|
71
71
|
"path": "../../editor-common/afm-products/tsconfig.json"
|
|
72
72
|
}
|
|
@@ -10,6 +10,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
10
10
|
var _errorBoundary = require("@atlaskit/editor-common/error-boundary");
|
|
11
11
|
var _syncBlock = require("@atlaskit/editor-common/sync-block");
|
|
12
12
|
var _editorSyncedBlockProvider = require("@atlaskit/editor-synced-block-provider");
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
14
|
var _SyncedBlockNodeComponentRenderer = require("./ui/SyncedBlockNodeComponentRenderer");
|
|
14
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
16
|
var getSyncBlockNodesFromDoc = exports.getSyncBlockNodesFromDoc = function getSyncBlockNodesFromDoc(doc) {
|
|
@@ -45,6 +46,19 @@ var useMemoizedSyncedBlockNodeComponent = exports.useMemoizedSyncedBlockNodeComp
|
|
|
45
46
|
|
|
46
47
|
// Initial fetch sync block data (will use SSR data as initial cache, or the prefetched data if available)
|
|
47
48
|
(0, _react.useEffect)(function () {
|
|
49
|
+
// On Jira the data provider resolves asynchronously (and is nulled on
|
|
50
|
+
// `destroy()`), so an eager fetch can throw `Data provider not set`
|
|
51
|
+
// (EDITOR-7860). Skip until ready; the effect re-runs (referenceManager
|
|
52
|
+
// identity changes) once the provider resolves, fetching exactly once.
|
|
53
|
+
// Readiness is nested under the gate so it is not consulted when the gate
|
|
54
|
+
// is off (today's behaviour), while `fg()` stays a standalone condition so
|
|
55
|
+
// gate exposure is tracked (@atlaskit/platform/no-preconditioning).
|
|
56
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_blocks_patch_3')) {
|
|
57
|
+
var _syncBlockStoreManage, _syncBlockStoreManage2, _syncBlockStoreManage3;
|
|
58
|
+
if (!((_syncBlockStoreManage = (_syncBlockStoreManage2 = (_syncBlockStoreManage3 = syncBlockStoreManager.referenceManager).hasDataProvider) === null || _syncBlockStoreManage2 === void 0 ? void 0 : _syncBlockStoreManage2.call(_syncBlockStoreManage3)) !== null && _syncBlockStoreManage !== void 0 ? _syncBlockStoreManage : false)) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
48
62
|
syncBlockStoreManager.referenceManager.fetchSyncBlocksData(syncBlockNodes);
|
|
49
63
|
}, [syncBlockNodes, syncBlockStoreManager.referenceManager]);
|
|
50
64
|
return (0, _react.useCallback)(function (props) {
|
|
@@ -3,6 +3,7 @@ import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
4
4
|
import { SyncBlockActionsProvider } from '@atlaskit/editor-common/sync-block';
|
|
5
5
|
import { convertSyncBlockJSONNodeToSyncBlockNode, useMemoizedSyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { SyncedBlockNodeComponentRenderer } from './ui/SyncedBlockNodeComponentRenderer';
|
|
7
8
|
export const getSyncBlockNodesFromDoc = doc => {
|
|
8
9
|
const {
|
|
@@ -36,6 +37,19 @@ export const useMemoizedSyncedBlockNodeComponent = ({
|
|
|
36
37
|
|
|
37
38
|
// Initial fetch sync block data (will use SSR data as initial cache, or the prefetched data if available)
|
|
38
39
|
useEffect(() => {
|
|
40
|
+
// On Jira the data provider resolves asynchronously (and is nulled on
|
|
41
|
+
// `destroy()`), so an eager fetch can throw `Data provider not set`
|
|
42
|
+
// (EDITOR-7860). Skip until ready; the effect re-runs (referenceManager
|
|
43
|
+
// identity changes) once the provider resolves, fetching exactly once.
|
|
44
|
+
// Readiness is nested under the gate so it is not consulted when the gate
|
|
45
|
+
// is off (today's behaviour), while `fg()` stays a standalone condition so
|
|
46
|
+
// gate exposure is tracked (@atlaskit/platform/no-preconditioning).
|
|
47
|
+
if (fg('platform_editor_blocks_patch_3')) {
|
|
48
|
+
var _syncBlockStoreManage, _syncBlockStoreManage2, _syncBlockStoreManage3;
|
|
49
|
+
if (!((_syncBlockStoreManage = (_syncBlockStoreManage2 = (_syncBlockStoreManage3 = syncBlockStoreManager.referenceManager).hasDataProvider) === null || _syncBlockStoreManage2 === void 0 ? void 0 : _syncBlockStoreManage2.call(_syncBlockStoreManage3)) !== null && _syncBlockStoreManage !== void 0 ? _syncBlockStoreManage : false)) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
39
53
|
syncBlockStoreManager.referenceManager.fetchSyncBlocksData(syncBlockNodes);
|
|
40
54
|
}, [syncBlockNodes, syncBlockStoreManager.referenceManager]);
|
|
41
55
|
return useCallback(props => /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
@@ -3,6 +3,7 @@ import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
4
4
|
import { SyncBlockActionsProvider } from '@atlaskit/editor-common/sync-block';
|
|
5
5
|
import { convertSyncBlockJSONNodeToSyncBlockNode, useMemoizedSyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { SyncedBlockNodeComponentRenderer } from './ui/SyncedBlockNodeComponentRenderer';
|
|
7
8
|
export var getSyncBlockNodesFromDoc = function getSyncBlockNodesFromDoc(doc) {
|
|
8
9
|
var content = doc.content;
|
|
@@ -37,6 +38,19 @@ export var useMemoizedSyncedBlockNodeComponent = function useMemoizedSyncedBlock
|
|
|
37
38
|
|
|
38
39
|
// Initial fetch sync block data (will use SSR data as initial cache, or the prefetched data if available)
|
|
39
40
|
useEffect(function () {
|
|
41
|
+
// On Jira the data provider resolves asynchronously (and is nulled on
|
|
42
|
+
// `destroy()`), so an eager fetch can throw `Data provider not set`
|
|
43
|
+
// (EDITOR-7860). Skip until ready; the effect re-runs (referenceManager
|
|
44
|
+
// identity changes) once the provider resolves, fetching exactly once.
|
|
45
|
+
// Readiness is nested under the gate so it is not consulted when the gate
|
|
46
|
+
// is off (today's behaviour), while `fg()` stays a standalone condition so
|
|
47
|
+
// gate exposure is tracked (@atlaskit/platform/no-preconditioning).
|
|
48
|
+
if (fg('platform_editor_blocks_patch_3')) {
|
|
49
|
+
var _syncBlockStoreManage, _syncBlockStoreManage2, _syncBlockStoreManage3;
|
|
50
|
+
if (!((_syncBlockStoreManage = (_syncBlockStoreManage2 = (_syncBlockStoreManage3 = syncBlockStoreManager.referenceManager).hasDataProvider) === null || _syncBlockStoreManage2 === void 0 ? void 0 : _syncBlockStoreManage2.call(_syncBlockStoreManage3)) !== null && _syncBlockStoreManage !== void 0 ? _syncBlockStoreManage : false)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
40
54
|
syncBlockStoreManager.referenceManager.fetchSyncBlocksData(syncBlockNodes);
|
|
41
55
|
}, [syncBlockNodes, syncBlockStoreManager.referenceManager]);
|
|
42
56
|
return useCallback(function (props) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-synced-block-renderer",
|
|
3
|
-
"version": "10.0
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"description": "SyncedBlockRenderer for @atlaskit/editor-plugin-synced-block",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"react-compiler": {
|
|
12
12
|
"enabled": true,
|
|
13
13
|
"gating": {
|
|
14
|
-
"source": "@
|
|
14
|
+
"source": "@atlaskit/react-compiler-gating",
|
|
15
15
|
"importSpecifierName": "isReactCompilerActivePlatform"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
@@ -27,28 +27,28 @@
|
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"atlaskit:src": "src/index.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atlaskit/button": "^24.
|
|
30
|
+
"@atlaskit/button": "^24.2.0",
|
|
31
31
|
"@atlaskit/css": "^1.0.0",
|
|
32
32
|
"@atlaskit/editor-plugin-synced-block": "^10.0.0",
|
|
33
|
-
"@atlaskit/editor-synced-block-provider": "^8.
|
|
34
|
-
"@atlaskit/heading": "^6.
|
|
35
|
-
"@atlaskit/icon": "^36.
|
|
36
|
-
"@atlaskit/icon-lab": "^7.
|
|
37
|
-
"@atlaskit/image": "^4.
|
|
33
|
+
"@atlaskit/editor-synced-block-provider": "^8.2.0",
|
|
34
|
+
"@atlaskit/heading": "^6.1.0",
|
|
35
|
+
"@atlaskit/icon": "^36.1.0",
|
|
36
|
+
"@atlaskit/icon-lab": "^7.2.0",
|
|
37
|
+
"@atlaskit/image": "^4.1.0",
|
|
38
38
|
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
39
|
-
"@atlaskit/primitives": "^20.
|
|
40
|
-
"@atlaskit/
|
|
41
|
-
"@atlaskit/
|
|
42
|
-
"@atlaskit/
|
|
43
|
-
"@atlaskit/
|
|
44
|
-
"@
|
|
39
|
+
"@atlaskit/primitives": "^20.1.0",
|
|
40
|
+
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
41
|
+
"@atlaskit/renderer": "^133.7.0",
|
|
42
|
+
"@atlaskit/spinner": "^20.1.0",
|
|
43
|
+
"@atlaskit/tokens": "^15.1.0",
|
|
44
|
+
"@atlaskit/tooltip": "^23.1.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@compiled/react": "^0.20.0",
|
|
47
47
|
"react-relay": "^20.1.1",
|
|
48
48
|
"relay-runtime": "^20.1.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@atlaskit/editor-common": "^116.
|
|
51
|
+
"@atlaskit/editor-common": "^116.15.0",
|
|
52
52
|
"react": "^18.2.0",
|
|
53
53
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
54
54
|
},
|
|
@@ -89,5 +89,11 @@
|
|
|
89
89
|
"import-no-extraneous-disable-for-examples-and-docs"
|
|
90
90
|
]
|
|
91
91
|
}
|
|
92
|
+
},
|
|
93
|
+
"platform-feature-flags": {
|
|
94
|
+
"platform_editor_blocks_patch_3": {
|
|
95
|
+
"type": "boolean",
|
|
96
|
+
"referenceOnly": true
|
|
97
|
+
}
|
|
92
98
|
}
|
|
93
99
|
}
|