@atlaskit/editor-synced-block-renderer 6.0.6 → 6.0.7
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/AGENTS.md +20 -66
- package/CHANGELOG.md +6 -0
- package/package.json +10 -10
package/AGENTS.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# Synced Block Renderer — Developer Agent Guide
|
|
2
2
|
|
|
3
|
-
> **Package**: `@atlaskit/editor-synced-block-renderer`
|
|
4
|
-
>
|
|
5
|
-
>
|
|
3
|
+
> **Package**: `@atlaskit/editor-synced-block-renderer`
|
|
4
|
+
>
|
|
5
|
+
> **For workflow guidance, debugging, and cross-package task guides, load the `synced-blocks` skill:**
|
|
6
|
+
> `get_skill(skill_name_or_path="platform/packages/editor/.rovodev/skills/synced-blocks/SKILL.md")`
|
|
6
7
|
|
|
7
8
|
---
|
|
8
9
|
|
|
@@ -18,12 +19,12 @@ SSR for performance-critical page loads.
|
|
|
18
19
|
|
|
19
20
|
```
|
|
20
21
|
src/
|
|
21
|
-
├── index.ts
|
|
22
|
-
├── useSyncedBlockNodeComponent.tsx
|
|
22
|
+
├── index.ts # Barrel exports
|
|
23
|
+
├── useSyncedBlockNodeComponent.tsx # Core hooks for node management and memoization
|
|
23
24
|
├── ui/
|
|
24
|
-
│ ├── renderSyncedBlockContent.tsx
|
|
25
|
-
│ └── SyncedBlockNodeComponentRenderer.tsx
|
|
26
|
-
└── types.ts
|
|
25
|
+
│ ├── renderSyncedBlockContent.tsx # Shared render branching logic (loading → error → success)
|
|
26
|
+
│ └── SyncedBlockNodeComponentRenderer.tsx # Renderer component with store manager + media SSR
|
|
27
|
+
└── types.ts # SyncedBlockRendererOptions type
|
|
27
28
|
```
|
|
28
29
|
|
|
29
30
|
---
|
|
@@ -31,25 +32,15 @@ src/
|
|
|
31
32
|
## Key Exports
|
|
32
33
|
|
|
33
34
|
```typescript
|
|
34
|
-
getSyncBlockNodesFromDoc;
|
|
35
|
-
useMemoizedSyncedBlockNodeComponent;
|
|
36
|
-
getSyncedBlockRenderer;
|
|
37
|
-
renderSyncedBlockContent;
|
|
35
|
+
getSyncBlockNodesFromDoc; // Extract SyncBlockNode[] from a DocNode
|
|
36
|
+
useMemoizedSyncedBlockNodeComponent; // Returns memoized component for rendering reference blocks
|
|
37
|
+
getSyncedBlockRenderer; // Factory for editor-mode synced block renderer
|
|
38
|
+
renderSyncedBlockContent; // Shared render branching logic
|
|
38
39
|
```
|
|
39
40
|
|
|
40
41
|
---
|
|
41
42
|
|
|
42
|
-
##
|
|
43
|
-
|
|
44
|
-
### `getSyncBlockNodesFromDoc(doc: DocNode)`
|
|
45
|
-
|
|
46
|
-
Extracts all `syncBlock` nodes from a document's content array. Maps through `doc.content`, converts
|
|
47
|
-
each via `convertSyncBlockJSONNodeToSyncBlockNode`, filters out undefined entries. Returns `[]` if
|
|
48
|
-
content is empty.
|
|
49
|
-
|
|
50
|
-
### `renderSyncedBlockContent(params)`
|
|
51
|
-
|
|
52
|
-
Central rendering decision tree (checked sequentially):
|
|
43
|
+
## Render Decision Tree (`renderSyncedBlockContent`)
|
|
53
44
|
|
|
54
45
|
1. **Offline + not SSR** → offline error component
|
|
55
46
|
2. **Loading + no instance** → loading skeleton
|
|
@@ -58,55 +49,18 @@ Central rendering decision tree (checked sequentially):
|
|
|
58
49
|
5. **Unpublished** → unpublished error component
|
|
59
50
|
6. **Success** → wraps content in `AKRendererWrapper` and renders
|
|
60
51
|
|
|
61
|
-
### `useMemoizedSyncedBlockNodeComponent(options)`
|
|
62
|
-
|
|
63
|
-
1. Creates memoized `SyncBlockStoreManager` via `useMemoizedSyncBlockStoreManager`
|
|
64
|
-
2. First `useEffect`: processes prefetched data via `getPrefetchedData()`
|
|
65
|
-
3. Second `useEffect`: triggers initial fetch of synced block data
|
|
66
|
-
4. Returns memoized callback wrapping `SyncedBlockNodeComponentRenderer` in `ErrorBoundary` +
|
|
67
|
-
`SyncBlockActionsProvider`
|
|
68
|
-
|
|
69
52
|
### SSR Behaviour
|
|
70
53
|
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
hydration
|
|
54
|
+
- Skips offline error in SSR; returns loading if SSR + error (deferred)
|
|
55
|
+
- Sets media SSR mode to `'server'` during SSR, `'client'` after hydration
|
|
74
56
|
- SSR errors tracked via `handleSSRErrorsAnalytics` in deferred `useEffect`
|
|
75
57
|
- Uses `isSSR()` from `@atlaskit/editor-common/core-utils`
|
|
76
58
|
|
|
77
59
|
---
|
|
78
60
|
|
|
79
|
-
## Common Tasks
|
|
80
|
-
|
|
81
|
-
### Fixing a rendering bug
|
|
82
|
-
|
|
83
|
-
1. Identify if it's a loading state, error state, or content rendering issue
|
|
84
|
-
2. Check `renderSyncedBlockContent` branching logic — which path is being hit?
|
|
85
|
-
3. For content issues, check if the ADF node type is supported:
|
|
86
|
-
[Supported nodes](https://hello.atlassian.net/wiki/spaces/egcuc/pages/5926568979)
|
|
87
|
-
4. For SSR issues, check if `isSSR()` detection and hydration timing are correct
|
|
88
|
-
|
|
89
|
-
### Adding a new error state
|
|
90
|
-
|
|
91
|
-
1. Add condition check in `renderSyncedBlockContent.tsx`
|
|
92
|
-
2. Create error component UI
|
|
93
|
-
3. Add analytics event for the new error state
|
|
94
|
-
4. Ensure SSR path handles it gracefully (deferred to client if needed)
|
|
95
|
-
|
|
96
|
-
### Performance considerations
|
|
97
|
-
|
|
98
|
-
- Reference blocks can regress VC90 due to content shift (CLS)
|
|
99
|
-
- SSR preloading mitigates this — ensure `getPrefetchedData()` is populated
|
|
100
|
-
- Use `SyncBlockInMemorySessionCache` for view→edit transitions
|
|
101
|
-
- Monitor: [VC90 investigation](https://hello.atlassian.net/wiki/spaces/egcuc/pages/6528071518)
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
61
|
## Related Packages
|
|
106
62
|
|
|
107
|
-
- **Plugin**: `platform/packages/editor/editor-plugin-synced-block/`
|
|
108
|
-
- **Provider**: `platform/packages/editor/editor-synced-block-provider/`
|
|
109
|
-
|
|
110
|
-
- **
|
|
111
|
-
- **Jira**: `jira/src/packages/issue/issue-view-synced-block-provider/` — uses
|
|
112
|
-
`useMemoizedSyncedBlockNodeComponent`
|
|
63
|
+
- **Plugin**: `platform/packages/editor/editor-plugin-synced-block/`
|
|
64
|
+
- **Provider**: `platform/packages/editor/editor-synced-block-provider/`
|
|
65
|
+
- **Confluence renderer**: `confluence/next/packages/adf-renderer/`
|
|
66
|
+
- **Jira**: `jira/src/packages/issue/issue-view-synced-block-provider/`
|
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-synced-block-renderer",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.7",
|
|
4
4
|
"description": "SyncedBlockRenderer for @atlaskit/editor-plugin-synced-block",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,19 +28,19 @@
|
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"atlaskit:src": "src/index.ts",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@atlaskit/button": "^23.
|
|
31
|
+
"@atlaskit/button": "^23.11.0",
|
|
32
32
|
"@atlaskit/css": "^0.19.0",
|
|
33
|
-
"@atlaskit/editor-plugin-synced-block": "^6.
|
|
34
|
-
"@atlaskit/editor-synced-block-provider": "^4.
|
|
35
|
-
"@atlaskit/heading": "^5.
|
|
33
|
+
"@atlaskit/editor-plugin-synced-block": "^6.1.0",
|
|
34
|
+
"@atlaskit/editor-synced-block-provider": "^4.4.0",
|
|
35
|
+
"@atlaskit/heading": "^5.4.0",
|
|
36
36
|
"@atlaskit/icon": "^34.0.0",
|
|
37
|
-
"@atlaskit/icon-lab": "^6.
|
|
37
|
+
"@atlaskit/icon-lab": "^6.4.0",
|
|
38
38
|
"@atlaskit/image": "^3.0.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
40
40
|
"@atlaskit/primitives": "^18.1.0",
|
|
41
|
-
"@atlaskit/renderer": "^128.
|
|
42
|
-
"@atlaskit/spinner": "^19.
|
|
43
|
-
"@atlaskit/tokens": "^
|
|
41
|
+
"@atlaskit/renderer": "^128.9.0",
|
|
42
|
+
"@atlaskit/spinner": "^19.1.0",
|
|
43
|
+
"@atlaskit/tokens": "^12.0.0",
|
|
44
44
|
"@atlaskit/tooltip": "^21.1.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@compiled/react": "^0.20.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"relay-runtime": "npm:atl-relay-runtime@0.0.0-main-39e79f66"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@atlaskit/editor-common": "^112.
|
|
51
|
+
"@atlaskit/editor-common": "^112.18.0",
|
|
52
52
|
"react": "^18.2.0",
|
|
53
53
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
54
54
|
},
|