@atlaskit/editor-ssr-renderer 3.2.0 → 3.2.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,17 @@
1
1
  # @atlaskit/editor-ssr-renderer
2
2
 
3
+ ## 3.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 3.2.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 3.2.0
4
16
 
5
17
  ### Minor Changes
@@ -379,14 +379,7 @@ function EditorSSRRenderer(_ref) {
379
379
  doc.descendants(function (node, pos) {
380
380
  nodePositions.set(node, pos);
381
381
  });
382
- if ((0, _expValEquals.expValEquals)('platform_editor_editor_ssr_streaming', 'isEnabled', true)) {
383
- var fragment = serializer.serializeFragment(doc.content);
384
- var wrapper = document.createElement('div');
385
- wrapper.appendChild(fragment);
386
- return wrapper.innerHTML;
387
- } else {
388
- return serializer.serializeFragment(doc.content);
389
- }
382
+ return serializer.serializeFragment(doc.content);
390
383
  };
391
384
  try {
392
385
  return (0, _ssrMeasures.profileSSROperation)("".concat(SSR_TRACE_SEGMENT_NAME, "/serializeFragment"), serializeFragment, onSSRMeasure);
@@ -397,11 +390,9 @@ function EditorSSRRenderer(_ref) {
397
390
  }, [doc, serializer, nodePositions, onSSRMeasure]);
398
391
  var containerRef = (0, _react.useRef)(null);
399
392
  (0, _react.useLayoutEffect)(function () {
400
- if (!(0, _expValEquals.expValEquals)('platform_editor_editor_ssr_streaming', 'isEnabled', true)) {
401
- if (containerRef.current && editorHTML && typeof editorHTML !== 'string') {
402
- containerRef.current.innerHTML = '';
403
- containerRef.current.appendChild(editorHTML);
404
- }
393
+ if (containerRef.current && editorHTML) {
394
+ containerRef.current.innerHTML = '';
395
+ containerRef.current.appendChild(editorHTML);
405
396
  }
406
397
  }, [editorHTML]);
407
398
  return /*#__PURE__*/_react.default.createElement(_ssrMeasures.SSRRenderMeasure, {
@@ -409,12 +400,8 @@ function EditorSSRRenderer(_ref) {
409
400
  startTimestampRef: firstRenderStartTimestampRef,
410
401
  onSSRMeasure: onSSRMeasure
411
402
  }, /*#__PURE__*/_react.default.createElement("div", {
403
+ ref: containerRef,
412
404
  id: divProps.id
413
- // eslint-disable-next-line react/no-danger -- It's intentional by design
414
- ,
415
- dangerouslySetInnerHTML: typeof editorHTML === 'string' && (0, _expValEquals.expValEquals)('platform_editor_editor_ssr_streaming', 'isEnabled', true) ? {
416
- __html: editorHTML
417
- } : undefined
418
405
  // For some reason on SSR, the result `class` has a trailing space, that broke UFO,
419
406
  // because ReactEditorView produces a div with `class` without space.
420
407
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -287,14 +287,7 @@ export function EditorSSRRenderer({
287
287
  doc.descendants((node, pos) => {
288
288
  nodePositions.set(node, pos);
289
289
  });
290
- if (expValEquals('platform_editor_editor_ssr_streaming', 'isEnabled', true)) {
291
- const fragment = serializer.serializeFragment(doc.content);
292
- const wrapper = document.createElement('div');
293
- wrapper.appendChild(fragment);
294
- return wrapper.innerHTML;
295
- } else {
296
- return serializer.serializeFragment(doc.content);
297
- }
290
+ return serializer.serializeFragment(doc.content);
298
291
  };
299
292
  try {
300
293
  return profileSSROperation(`${SSR_TRACE_SEGMENT_NAME}/serializeFragment`, serializeFragment, onSSRMeasure);
@@ -305,11 +298,9 @@ export function EditorSSRRenderer({
305
298
  }, [doc, serializer, nodePositions, onSSRMeasure]);
306
299
  const containerRef = useRef(null);
307
300
  useLayoutEffect(() => {
308
- if (!expValEquals('platform_editor_editor_ssr_streaming', 'isEnabled', true)) {
309
- if (containerRef.current && editorHTML && typeof editorHTML !== 'string') {
310
- containerRef.current.innerHTML = '';
311
- containerRef.current.appendChild(editorHTML);
312
- }
301
+ if (containerRef.current && editorHTML) {
302
+ containerRef.current.innerHTML = '';
303
+ containerRef.current.appendChild(editorHTML);
313
304
  }
314
305
  }, [editorHTML]);
315
306
  return /*#__PURE__*/React.createElement(SSRRenderMeasure, {
@@ -317,12 +308,8 @@ export function EditorSSRRenderer({
317
308
  startTimestampRef: firstRenderStartTimestampRef,
318
309
  onSSRMeasure: onSSRMeasure
319
310
  }, /*#__PURE__*/React.createElement("div", {
311
+ ref: containerRef,
320
312
  id: divProps.id
321
- // eslint-disable-next-line react/no-danger -- It's intentional by design
322
- ,
323
- dangerouslySetInnerHTML: typeof editorHTML === 'string' && expValEquals('platform_editor_editor_ssr_streaming', 'isEnabled', true) ? {
324
- __html: editorHTML
325
- } : undefined
326
313
  // For some reason on SSR, the result `class` has a trailing space, that broke UFO,
327
314
  // because ReactEditorView produces a div with `class` without space.
328
315
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -370,14 +370,7 @@ export function EditorSSRRenderer(_ref) {
370
370
  doc.descendants(function (node, pos) {
371
371
  nodePositions.set(node, pos);
372
372
  });
373
- if (expValEquals('platform_editor_editor_ssr_streaming', 'isEnabled', true)) {
374
- var fragment = serializer.serializeFragment(doc.content);
375
- var wrapper = document.createElement('div');
376
- wrapper.appendChild(fragment);
377
- return wrapper.innerHTML;
378
- } else {
379
- return serializer.serializeFragment(doc.content);
380
- }
373
+ return serializer.serializeFragment(doc.content);
381
374
  };
382
375
  try {
383
376
  return profileSSROperation("".concat(SSR_TRACE_SEGMENT_NAME, "/serializeFragment"), serializeFragment, onSSRMeasure);
@@ -388,11 +381,9 @@ export function EditorSSRRenderer(_ref) {
388
381
  }, [doc, serializer, nodePositions, onSSRMeasure]);
389
382
  var containerRef = useRef(null);
390
383
  useLayoutEffect(function () {
391
- if (!expValEquals('platform_editor_editor_ssr_streaming', 'isEnabled', true)) {
392
- if (containerRef.current && editorHTML && typeof editorHTML !== 'string') {
393
- containerRef.current.innerHTML = '';
394
- containerRef.current.appendChild(editorHTML);
395
- }
384
+ if (containerRef.current && editorHTML) {
385
+ containerRef.current.innerHTML = '';
386
+ containerRef.current.appendChild(editorHTML);
396
387
  }
397
388
  }, [editorHTML]);
398
389
  return /*#__PURE__*/React.createElement(SSRRenderMeasure, {
@@ -400,12 +391,8 @@ export function EditorSSRRenderer(_ref) {
400
391
  startTimestampRef: firstRenderStartTimestampRef,
401
392
  onSSRMeasure: onSSRMeasure
402
393
  }, /*#__PURE__*/React.createElement("div", {
394
+ ref: containerRef,
403
395
  id: divProps.id
404
- // eslint-disable-next-line react/no-danger -- It's intentional by design
405
- ,
406
- dangerouslySetInnerHTML: typeof editorHTML === 'string' && expValEquals('platform_editor_editor_ssr_streaming', 'isEnabled', true) ? {
407
- __html: editorHTML
408
- } : undefined
409
396
  // For some reason on SSR, the result `class` has a trailing space, that broke UFO,
410
397
  // because ReactEditorView produces a div with `class` without space.
411
398
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-ssr-renderer",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "description": "SSR Renderer based on Editor",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "atlassian": {
@@ -30,12 +30,12 @@
30
30
  "@atlaskit/adf-schema": "^52.4.0",
31
31
  "@atlaskit/editor-prosemirror": "^7.3.0",
32
32
  "@atlaskit/platform-feature-flags": "^1.1.0",
33
- "@atlaskit/tmp-editor-statsig": "^54.2.0",
33
+ "@atlaskit/tmp-editor-statsig": "^56.0.0",
34
34
  "@babel/runtime": "^7.0.0",
35
35
  "react-intl-next": "npm:react-intl@^5.18.1"
36
36
  },
37
37
  "peerDependencies": {
38
- "@atlaskit/editor-common": "^112.17.0",
38
+ "@atlaskit/editor-common": "^112.18.0",
39
39
  "react": "^18.2.0"
40
40
  }
41
41
  }