@atlaskit/editor-ssr-renderer 6.0.1 → 6.1.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,24 @@
|
|
|
1
1
|
# @atlaskit/editor-ssr-renderer
|
|
2
2
|
|
|
3
|
+
## 6.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 6.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`6e3b4e2317b34`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6e3b4e2317b34) -
|
|
14
|
+
[EDITOR-7476](https://hello.jira.atlassian.cloud/browse/EDITOR-7476) - centralize SSR streaming
|
|
15
|
+
checks behind `isSSRStreaming()` so SSR eligibility is checked before emitting exposure for the
|
|
16
|
+
`platform_editor_editor_ssr_streaming` experiment.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 6.0.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -20,8 +20,8 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
20
20
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
21
21
|
var _eventDispatcher = require("@atlaskit/editor-common/event-dispatcher");
|
|
22
22
|
var _providerFactory = require("@atlaskit/editor-common/provider-factory");
|
|
23
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
24
23
|
var _ssrMeasures = require("@atlaskit/editor-common/performance/ssr-measures");
|
|
24
|
+
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
25
25
|
var _excluded = ["plugins", "schema", "doc", "portalProviderAPI", "intl", "onSSRMeasure", "onEditorStateChanged"];
|
|
26
26
|
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); }
|
|
27
27
|
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; }
|
|
@@ -402,7 +402,7 @@ function EditorSSRRenderer(_ref) {
|
|
|
402
402
|
doc.descendants(function (node, pos) {
|
|
403
403
|
nodePositions.set(node, pos);
|
|
404
404
|
});
|
|
405
|
-
if ((0,
|
|
405
|
+
if ((0, _coreUtils.isSSRStreaming)()) {
|
|
406
406
|
var fragment = serializer.serializeFragment(doc.content);
|
|
407
407
|
var wrapper = document.createElement('div');
|
|
408
408
|
wrapper.appendChild(fragment);
|
|
@@ -424,7 +424,7 @@ function EditorSSRRenderer(_ref) {
|
|
|
424
424
|
}, [doc, serializer, nodePositions, onSSRMeasure]);
|
|
425
425
|
var containerRef = (0, _react.useRef)(null);
|
|
426
426
|
(0, _react.useLayoutEffect)(function () {
|
|
427
|
-
if (!(0,
|
|
427
|
+
if (!(0, _coreUtils.isSSRStreaming)()) {
|
|
428
428
|
if (containerRef.current && editorHTML && typeof editorHTML !== 'string') {
|
|
429
429
|
containerRef.current.innerHTML = '';
|
|
430
430
|
containerRef.current.appendChild(editorHTML);
|
|
@@ -440,7 +440,7 @@ function EditorSSRRenderer(_ref) {
|
|
|
440
440
|
id: divProps.id
|
|
441
441
|
// eslint-disable-next-line react/no-danger -- It's intentional by design
|
|
442
442
|
,
|
|
443
|
-
dangerouslySetInnerHTML: typeof editorHTML === 'string' && (0,
|
|
443
|
+
dangerouslySetInnerHTML: typeof editorHTML === 'string' && (0, _coreUtils.isSSRStreaming)() ? {
|
|
444
444
|
__html: editorHTML
|
|
445
445
|
} : undefined
|
|
446
446
|
// For some reason on SSR, the result `class` has a trailing space, that broke UFO,
|
|
@@ -4,8 +4,8 @@ import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
|
4
4
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import { EventDispatcher, createDispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
6
6
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
7
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
7
|
import { profileSSROperation, SSRRenderMeasure } from '@atlaskit/editor-common/performance/ssr-measures';
|
|
8
|
+
import { isSSRStreaming } from '@atlaskit/editor-common/core-utils';
|
|
9
9
|
const SSR_TRACE_SEGMENT_NAME = 'reactEditorView/editorSSRRenderer';
|
|
10
10
|
|
|
11
11
|
// The copy of type from prosemirror-view.
|
|
@@ -310,7 +310,7 @@ export function EditorSSRRenderer({
|
|
|
310
310
|
doc.descendants((node, pos) => {
|
|
311
311
|
nodePositions.set(node, pos);
|
|
312
312
|
});
|
|
313
|
-
if (
|
|
313
|
+
if (isSSRStreaming()) {
|
|
314
314
|
const fragment = serializer.serializeFragment(doc.content);
|
|
315
315
|
const wrapper = document.createElement('div');
|
|
316
316
|
wrapper.appendChild(fragment);
|
|
@@ -332,7 +332,7 @@ export function EditorSSRRenderer({
|
|
|
332
332
|
}, [doc, serializer, nodePositions, onSSRMeasure]);
|
|
333
333
|
const containerRef = useRef(null);
|
|
334
334
|
useLayoutEffect(() => {
|
|
335
|
-
if (!
|
|
335
|
+
if (!isSSRStreaming()) {
|
|
336
336
|
if (containerRef.current && editorHTML && typeof editorHTML !== 'string') {
|
|
337
337
|
containerRef.current.innerHTML = '';
|
|
338
338
|
containerRef.current.appendChild(editorHTML);
|
|
@@ -348,7 +348,7 @@ export function EditorSSRRenderer({
|
|
|
348
348
|
id: divProps.id
|
|
349
349
|
// eslint-disable-next-line react/no-danger -- It's intentional by design
|
|
350
350
|
,
|
|
351
|
-
dangerouslySetInnerHTML: typeof editorHTML === 'string' &&
|
|
351
|
+
dangerouslySetInnerHTML: typeof editorHTML === 'string' && isSSRStreaming() ? {
|
|
352
352
|
__html: editorHTML
|
|
353
353
|
} : undefined
|
|
354
354
|
// For some reason on SSR, the result `class` has a trailing space, that broke UFO,
|
|
@@ -17,8 +17,8 @@ import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
|
17
17
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
18
18
|
import { EventDispatcher, createDispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
19
19
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
20
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
21
20
|
import { profileSSROperation, SSRRenderMeasure } from '@atlaskit/editor-common/performance/ssr-measures';
|
|
21
|
+
import { isSSRStreaming } from '@atlaskit/editor-common/core-utils';
|
|
22
22
|
var SSR_TRACE_SEGMENT_NAME = 'reactEditorView/editorSSRRenderer';
|
|
23
23
|
|
|
24
24
|
// The copy of type from prosemirror-view.
|
|
@@ -393,7 +393,7 @@ export function EditorSSRRenderer(_ref) {
|
|
|
393
393
|
doc.descendants(function (node, pos) {
|
|
394
394
|
nodePositions.set(node, pos);
|
|
395
395
|
});
|
|
396
|
-
if (
|
|
396
|
+
if (isSSRStreaming()) {
|
|
397
397
|
var fragment = serializer.serializeFragment(doc.content);
|
|
398
398
|
var wrapper = document.createElement('div');
|
|
399
399
|
wrapper.appendChild(fragment);
|
|
@@ -415,7 +415,7 @@ export function EditorSSRRenderer(_ref) {
|
|
|
415
415
|
}, [doc, serializer, nodePositions, onSSRMeasure]);
|
|
416
416
|
var containerRef = useRef(null);
|
|
417
417
|
useLayoutEffect(function () {
|
|
418
|
-
if (!
|
|
418
|
+
if (!isSSRStreaming()) {
|
|
419
419
|
if (containerRef.current && editorHTML && typeof editorHTML !== 'string') {
|
|
420
420
|
containerRef.current.innerHTML = '';
|
|
421
421
|
containerRef.current.appendChild(editorHTML);
|
|
@@ -431,7 +431,7 @@ export function EditorSSRRenderer(_ref) {
|
|
|
431
431
|
id: divProps.id
|
|
432
432
|
// eslint-disable-next-line react/no-danger -- It's intentional by design
|
|
433
433
|
,
|
|
434
|
-
dangerouslySetInnerHTML: typeof editorHTML === 'string' &&
|
|
434
|
+
dangerouslySetInnerHTML: typeof editorHTML === 'string' && isSSRStreaming() ? {
|
|
435
435
|
__html: editorHTML
|
|
436
436
|
} : undefined
|
|
437
437
|
// For some reason on SSR, the result `class` has a trailing space, that broke UFO,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-ssr-renderer",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.1",
|
|
4
4
|
"description": "SSR Renderer based on Editor",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"atlassian": {
|
|
@@ -34,14 +34,13 @@
|
|
|
34
34
|
"sideEffects": false,
|
|
35
35
|
"atlaskit:src": "src/index.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@atlaskit/adf-schema": "^
|
|
37
|
+
"@atlaskit/adf-schema": "^53.0.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
40
|
-
"@atlaskit/tmp-editor-statsig": "^89.0.0",
|
|
41
40
|
"@babel/runtime": "^7.0.0"
|
|
42
41
|
},
|
|
43
42
|
"peerDependencies": {
|
|
44
|
-
"@atlaskit/editor-common": "^115.
|
|
43
|
+
"@atlaskit/editor-common": "^115.10.0",
|
|
45
44
|
"react": "^18.2.0",
|
|
46
45
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
47
46
|
},
|