@bleedingdev/modern-js-runtime 3.9.0-ultramodern.13 → 3.9.0-ultramodern.14

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.
@@ -245,6 +245,7 @@ const createReadableStreamFromElement = async (request, rootElement, options)=>{
245
245
  reactStream = renderToPipeableStream(processedRootElement, {
246
246
  nonce: config.nonce,
247
247
  identifierPrefix: constants_namespaceObject.SSR_HYDRATION_ID_PREFIX,
248
+ progressiveChunkSize: external_shared_js_namespaceObject_1.SHELL_PROGRESSIVE_CHUNK_SIZE,
248
249
  [onReady] () {
249
250
  startOutput().catch(fail);
250
251
  },
@@ -93,6 +93,7 @@ const createReadableStreamFromElement = async (request, rootElement, options)=>{
93
93
  request,
94
94
  signal: request.signal,
95
95
  nonce: config.nonce,
96
+ progressiveChunkSize: external_shared_js_namespaceObject_1.SHELL_PROGRESSIVE_CHUNK_SIZE,
96
97
  rscManifest,
97
98
  rscRoot: rscRoot,
98
99
  routes: runtimeContext.routes,
@@ -28,6 +28,7 @@ var __webpack_require__ = {};
28
28
  var __webpack_exports__ = {};
29
29
  __webpack_require__.r(__webpack_exports__);
30
30
  __webpack_require__.d(__webpack_exports__, {
31
+ SHELL_PROGRESSIVE_CHUNK_SIZE: ()=>SHELL_PROGRESSIVE_CHUNK_SIZE,
31
32
  ShellChunkStatus: ()=>shared_ShellChunkStatus,
32
33
  createRenderStreaming: ()=>createRenderStreaming,
33
34
  encodeForWebStream: ()=>encodeForWebStream,
@@ -46,6 +47,7 @@ var shared_ShellChunkStatus = /*#__PURE__*/ function(ShellChunkStatus) {
46
47
  ShellChunkStatus[ShellChunkStatus["FINISH"] = 1] = "FINISH";
47
48
  return ShellChunkStatus;
48
49
  }({});
50
+ const SHELL_PROGRESSIVE_CHUNK_SIZE = Number.MAX_SAFE_INTEGER;
49
51
  const SHOULD_STREAM_ALL_HEADER = 'x-should-stream-all';
50
52
  function parseShouldStreamAllFlag(value) {
51
53
  if (!value) return;
@@ -143,12 +145,14 @@ function createRenderStreaming(createReadableStreamPromise) {
143
145
  return stream;
144
146
  };
145
147
  }
148
+ exports.SHELL_PROGRESSIVE_CHUNK_SIZE = __webpack_exports__.SHELL_PROGRESSIVE_CHUNK_SIZE;
146
149
  exports.ShellChunkStatus = __webpack_exports__.ShellChunkStatus;
147
150
  exports.createRenderStreaming = __webpack_exports__.createRenderStreaming;
148
151
  exports.encodeForWebStream = __webpack_exports__.encodeForWebStream;
149
152
  exports.getReadableStreamFromString = __webpack_exports__.getReadableStreamFromString;
150
153
  exports.resolveStreamingMode = __webpack_exports__.resolveStreamingMode;
151
154
  for(var __rspack_i in __webpack_exports__)if (-1 === [
155
+ "SHELL_PROGRESSIVE_CHUNK_SIZE",
152
156
  "ShellChunkStatus",
153
157
  "createRenderStreaming",
154
158
  "encodeForWebStream",
@@ -9,7 +9,7 @@ import { wrapRuntimeComponentResolver } from "../../react/wrapper.mjs";
9
9
  import { createReplaceHelemt, getHelmetData } from "../helmet.mjs";
10
10
  import { createSSRRenderLifecycle, createSSRStreamErrorReporter, observeSSRStream, orderSSRStreamTransforms } from "../shared.mjs";
11
11
  import { enqueueFromEntries } from "./deferredScript.mjs";
12
- import { ShellChunkStatus, getReadableStreamFromString, resolveStreamingMode } from "./shared.mjs";
12
+ import { SHELL_PROGRESSIVE_CHUNK_SIZE, ShellChunkStatus, getReadableStreamFromString, resolveStreamingMode } from "./shared.mjs";
13
13
  import { getTemplates } from "./template.mjs";
14
14
  const createReadableStreamFromElement = async (request, rootElement, options)=>{
15
15
  const { renderToPipeableStream } = await import("react-dom/server");
@@ -213,6 +213,7 @@ const createReadableStreamFromElement = async (request, rootElement, options)=>{
213
213
  reactStream = renderToPipeableStream(processedRootElement, {
214
214
  nonce: config.nonce,
215
215
  identifierPrefix: SSR_HYDRATION_ID_PREFIX,
216
+ progressiveChunkSize: SHELL_PROGRESSIVE_CHUNK_SIZE,
216
217
  [onReady] () {
217
218
  startOutput().catch(fail);
218
219
  },
@@ -8,7 +8,7 @@ import { wrapRuntimeComponentResolver } from "../../react/wrapper.mjs";
8
8
  import { createReplaceHelemt, getHelmetData } from "../helmet.mjs";
9
9
  import { createSSRRenderLifecycle, createSSRStreamErrorReporter, observeSSRStream, orderSSRStreamTransforms } from "../shared.mjs";
10
10
  import { enqueueFromEntries } from "./deferredScript.mjs";
11
- import { ShellChunkStatus, getReadableStreamFromString, resolveStreamingMode } from "./shared.mjs";
11
+ import { SHELL_PROGRESSIVE_CHUNK_SIZE, ShellChunkStatus, getReadableStreamFromString, resolveStreamingMode } from "./shared.mjs";
12
12
  import { getTemplates } from "./template.mjs";
13
13
  const createReadableStreamFromElement = async (request, rootElement, options)=>{
14
14
  const { htmlTemplate, runtimeContext, config, ssrConfig, entryName, resource, rscManifest, rscRoot } = options;
@@ -51,6 +51,7 @@ const createReadableStreamFromElement = async (request, rootElement, options)=>{
51
51
  request,
52
52
  signal: request.signal,
53
53
  nonce: config.nonce,
54
+ progressiveChunkSize: SHELL_PROGRESSIVE_CHUNK_SIZE,
54
55
  rscManifest,
55
56
  rscRoot: rscRoot,
56
57
  routes: runtimeContext.routes,
@@ -10,6 +10,7 @@ var shared_ShellChunkStatus = /*#__PURE__*/ function(ShellChunkStatus) {
10
10
  ShellChunkStatus[ShellChunkStatus["FINISH"] = 1] = "FINISH";
11
11
  return ShellChunkStatus;
12
12
  }({});
13
+ const SHELL_PROGRESSIVE_CHUNK_SIZE = Number.MAX_SAFE_INTEGER;
13
14
  const SHOULD_STREAM_ALL_HEADER = 'x-should-stream-all';
14
15
  function parseShouldStreamAllFlag(value) {
15
16
  if (!value) return;
@@ -107,4 +108,4 @@ function createRenderStreaming(createReadableStreamPromise) {
107
108
  return stream;
108
109
  };
109
110
  }
110
- export { createRenderStreaming, encodeForWebStream, getReadableStreamFromString, resolveStreamingMode, shared_ShellChunkStatus as ShellChunkStatus };
111
+ export { SHELL_PROGRESSIVE_CHUNK_SIZE, createRenderStreaming, encodeForWebStream, getReadableStreamFromString, resolveStreamingMode, shared_ShellChunkStatus as ShellChunkStatus };
@@ -10,7 +10,7 @@ import { wrapRuntimeComponentResolver } from "../../react/wrapper.mjs";
10
10
  import { createReplaceHelemt, getHelmetData } from "../helmet.mjs";
11
11
  import { createSSRRenderLifecycle, createSSRStreamErrorReporter, observeSSRStream, orderSSRStreamTransforms } from "../shared.mjs";
12
12
  import { enqueueFromEntries } from "./deferredScript.mjs";
13
- import { ShellChunkStatus, getReadableStreamFromString, resolveStreamingMode } from "./shared.mjs";
13
+ import { SHELL_PROGRESSIVE_CHUNK_SIZE, ShellChunkStatus, getReadableStreamFromString, resolveStreamingMode } from "./shared.mjs";
14
14
  import { getTemplates } from "./template.mjs";
15
15
  const createReadableStreamFromElement = async (request, rootElement, options)=>{
16
16
  const { renderToPipeableStream } = await import("react-dom/server");
@@ -214,6 +214,7 @@ const createReadableStreamFromElement = async (request, rootElement, options)=>{
214
214
  reactStream = renderToPipeableStream(processedRootElement, {
215
215
  nonce: config.nonce,
216
216
  identifierPrefix: SSR_HYDRATION_ID_PREFIX,
217
+ progressiveChunkSize: SHELL_PROGRESSIVE_CHUNK_SIZE,
217
218
  [onReady] () {
218
219
  startOutput().catch(fail);
219
220
  },
@@ -9,7 +9,7 @@ import { wrapRuntimeComponentResolver } from "../../react/wrapper.mjs";
9
9
  import { createReplaceHelemt, getHelmetData } from "../helmet.mjs";
10
10
  import { createSSRRenderLifecycle, createSSRStreamErrorReporter, observeSSRStream, orderSSRStreamTransforms } from "../shared.mjs";
11
11
  import { enqueueFromEntries } from "./deferredScript.mjs";
12
- import { ShellChunkStatus, getReadableStreamFromString, resolveStreamingMode } from "./shared.mjs";
12
+ import { SHELL_PROGRESSIVE_CHUNK_SIZE, ShellChunkStatus, getReadableStreamFromString, resolveStreamingMode } from "./shared.mjs";
13
13
  import { getTemplates } from "./template.mjs";
14
14
  const createReadableStreamFromElement = async (request, rootElement, options)=>{
15
15
  const { htmlTemplate, runtimeContext, config, ssrConfig, entryName, resource, rscManifest, rscRoot } = options;
@@ -52,6 +52,7 @@ const createReadableStreamFromElement = async (request, rootElement, options)=>{
52
52
  request,
53
53
  signal: request.signal,
54
54
  nonce: config.nonce,
55
+ progressiveChunkSize: SHELL_PROGRESSIVE_CHUNK_SIZE,
55
56
  rscManifest,
56
57
  rscRoot: rscRoot,
57
58
  routes: runtimeContext.routes,
@@ -11,6 +11,7 @@ var shared_ShellChunkStatus = /*#__PURE__*/ function(ShellChunkStatus) {
11
11
  ShellChunkStatus[ShellChunkStatus["FINISH"] = 1] = "FINISH";
12
12
  return ShellChunkStatus;
13
13
  }({});
14
+ const SHELL_PROGRESSIVE_CHUNK_SIZE = Number.MAX_SAFE_INTEGER;
14
15
  const SHOULD_STREAM_ALL_HEADER = 'x-should-stream-all';
15
16
  function parseShouldStreamAllFlag(value) {
16
17
  if (!value) return;
@@ -108,4 +109,4 @@ function createRenderStreaming(createReadableStreamPromise) {
108
109
  return stream;
109
110
  };
110
111
  }
111
- export { createRenderStreaming, encodeForWebStream, getReadableStreamFromString, resolveStreamingMode, shared_ShellChunkStatus as ShellChunkStatus };
112
+ export { SHELL_PROGRESSIVE_CHUNK_SIZE, createRenderStreaming, encodeForWebStream, getReadableStreamFromString, resolveStreamingMode, shared_ShellChunkStatus as ShellChunkStatus };
@@ -32,6 +32,15 @@ export declare enum ShellChunkStatus {
32
32
  START = 0,
33
33
  FINISH = 1
34
34
  }
35
+ /**
36
+ * The document head is sealed when the shell end mark is written, so only head
37
+ * tags emitted before it reach `<head>`. React writes a completed Suspense
38
+ * boundary after the shell once the flushed bytes exceed `progressiveChunkSize`,
39
+ * which drops the head of every large route and keeps its content hidden until
40
+ * the inline `$RC` script runs. Completed boundaries therefore stay inline in
41
+ * the shell; pending boundaries still stream when they resolve.
42
+ */
43
+ export declare const SHELL_PROGRESSIVE_CHUNK_SIZE: number;
35
44
  export declare function resolveStreamingMode(request: Request, forceStreamToString: boolean): {
36
45
  onReady: 'onAllReady' | 'onShellReady';
37
46
  waitForAllReady: boolean;
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "modern",
18
18
  "modern.js"
19
19
  ],
20
- "version": "3.9.0-ultramodern.13",
20
+ "version": "3.9.0-ultramodern.14",
21
21
  "engines": {
22
22
  "node": ">=20"
23
23
  },
@@ -217,14 +217,14 @@
217
217
  "dependencies": {
218
218
  "@loadable/component": "5.16.7",
219
219
  "@loadable/server": "5.16.7",
220
- "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.0-ultramodern.13",
221
- "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.9.0-ultramodern.13",
222
- "@modern-js/render": "npm:@bleedingdev/modern-js-render@3.9.0-ultramodern.13",
223
- "@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.9.0-ultramodern.13",
224
- "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.0-ultramodern.13",
225
- "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.9.0-ultramodern.13",
226
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.0-ultramodern.13",
227
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.13",
220
+ "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.0-ultramodern.14",
221
+ "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.9.0-ultramodern.14",
222
+ "@modern-js/render": "npm:@bleedingdev/modern-js-render@3.9.0-ultramodern.14",
223
+ "@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.9.0-ultramodern.14",
224
+ "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.0-ultramodern.14",
225
+ "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.9.0-ultramodern.14",
226
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.0-ultramodern.14",
227
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.14",
228
228
  "@swc/core": "1.16.2",
229
229
  "@swc/helpers": "^0.5.23",
230
230
  "@swc/plugin-loadable-components": "^13.0.0",
@@ -245,7 +245,7 @@
245
245
  "react-dom": "^19.2.8"
246
246
  },
247
247
  "devDependencies": {
248
- "@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.9.0-ultramodern.13",
248
+ "@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.9.0-ultramodern.14",
249
249
  "@remix-run/web-fetch": "^4.4.2",
250
250
  "@rsbuild/core": "2.2.9",
251
251
  "@rslib/core": "1.0.2",