@modern-js/runtime 2.48.6 → 2.49.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/dist/cjs/core/compatible.js +3 -2
- package/dist/cjs/router/runtime/plugin.node.js +1 -3
- package/dist/cjs/ssr/serverRender/renderToStream/index.js +2 -2
- package/dist/cjs/ssr/serverRender/renderToStream/renderToPipe.js +46 -47
- package/dist/cjs/ssr/serverRender/renderToStream/renderToPipe.worker.js +6 -1
- package/dist/cjs/ssr/serverRender/tracker.js +14 -6
- package/dist/esm/core/compatible.js +3 -2
- package/dist/esm/router/runtime/plugin.node.js +1 -3
- package/dist/esm/ssr/serverRender/renderToStream/index.js +3 -3
- package/dist/esm/ssr/serverRender/renderToStream/renderToPipe.js +47 -48
- package/dist/esm/ssr/serverRender/renderToStream/renderToPipe.worker.js +6 -1
- package/dist/esm/ssr/serverRender/tracker.js +16 -6
- package/dist/esm-node/core/compatible.js +3 -2
- package/dist/esm-node/router/runtime/plugin.node.js +1 -3
- package/dist/esm-node/ssr/serverRender/renderToStream/index.js +2 -2
- package/dist/esm-node/ssr/serverRender/renderToStream/renderToPipe.js +46 -47
- package/dist/esm-node/ssr/serverRender/renderToStream/renderToPipe.worker.js +6 -1
- package/dist/esm-node/ssr/serverRender/tracker.js +14 -6
- package/dist/types/ssr/serverRender/renderToStream/index.d.ts +1 -1
- package/dist/types/ssr/serverRender/renderToStream/renderToPipe.d.ts +3 -4
- package/dist/types/ssr/serverRender/renderToStream/renderToPipe.worker.d.ts +5 -1
- package/dist/types/ssr/serverRender/tracker.d.ts +1 -1
- package/package.json +10 -11
- package/dist/cjs/router/runtime/fetch.js +0 -29
- package/dist/cjs/router/runtime/fetch.node.js +0 -28
- package/dist/cjs/router/runtime/fetch.worker.js +0 -29
- package/dist/esm/router/runtime/fetch.js +0 -5
- package/dist/esm/router/runtime/fetch.node.js +0 -4
- package/dist/esm/router/runtime/fetch.worker.js +0 -5
- package/dist/esm-node/router/runtime/fetch.js +0 -5
- package/dist/esm-node/router/runtime/fetch.node.js +0 -4
- package/dist/esm-node/router/runtime/fetch.worker.js +0 -5
- package/dist/types/router/runtime/fetch.d.ts +0 -2
- package/dist/types/router/runtime/fetch.node.d.ts +0 -2
- package/dist/types/router/runtime/fetch.worker.d.ts +0 -2
|
@@ -228,8 +228,9 @@ const bootstrap = async (BootApp, id, root, ReactDOM) => {
|
|
|
228
228
|
const redirectUrl = result.headers.get("Location") || "/";
|
|
229
229
|
const { ssrContext } = context;
|
|
230
230
|
if (ssrContext) {
|
|
231
|
-
|
|
232
|
-
ssrContext.res.
|
|
231
|
+
var _ssrContext_res;
|
|
232
|
+
ssrContext.res && (ssrContext.res.statusCode = status);
|
|
233
|
+
(_ssrContext_res = ssrContext.res) === null || _ssrContext_res === void 0 ? void 0 : _ssrContext_res.setHeader("Location", redirectUrl);
|
|
233
234
|
ssrContext.redirection = ssrContext.redirection || {};
|
|
234
235
|
ssrContext.redirection.status = status;
|
|
235
236
|
ssrContext.redirection.url = redirectUrl;
|
|
@@ -44,9 +44,7 @@ var import_time = require("@modern-js/runtime-utils/time");
|
|
|
44
44
|
var import_constants = require("@modern-js/utils/universal/constants");
|
|
45
45
|
var import_core = require("../../core");
|
|
46
46
|
var import_utils = require("./utils");
|
|
47
|
-
var import_fetch = require("./fetch");
|
|
48
47
|
var import_hooks = require("./hooks");
|
|
49
|
-
(0, import_fetch.installGlobals)();
|
|
50
48
|
function createFetchRequest(req) {
|
|
51
49
|
const origin = `${req.protocol}://${req.host}`;
|
|
52
50
|
const url = new URL(req.originalUrl || req.url, origin);
|
|
@@ -112,7 +110,7 @@ const routerPlugin = ({ basename = "", routesConfig, createRoutes }) => {
|
|
|
112
110
|
requestContext
|
|
113
111
|
});
|
|
114
112
|
const cost = end();
|
|
115
|
-
reporter.reportTiming(import_constants.LOADER_REPORTER_NAME, cost);
|
|
113
|
+
reporter === null || reporter === void 0 ? void 0 : reporter.reportTiming(import_constants.LOADER_REPORTER_NAME, cost);
|
|
116
114
|
serverTiming.addServeTiming(import_constants.LOADER_REPORTER_NAME, cost);
|
|
117
115
|
if (routerContext instanceof Response) {
|
|
118
116
|
return routerContext;
|
|
@@ -49,7 +49,7 @@ const render = ({ App, context, config }) => {
|
|
|
49
49
|
})
|
|
50
50
|
});
|
|
51
51
|
const { tracker } = ssrContext;
|
|
52
|
-
const
|
|
52
|
+
const stream = (0, import_renderToPipe.default)(rootElement, context, config, {
|
|
53
53
|
onShellReady() {
|
|
54
54
|
const cost = end();
|
|
55
55
|
tracker.trackTiming(import_tracker.SSRTimings.RENDER_SHELL, cost);
|
|
@@ -65,7 +65,7 @@ const render = ({ App, context, config }) => {
|
|
|
65
65
|
tracker.trackError(import_tracker.SSRErrors.RENDER_STREAM, error);
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
|
-
return
|
|
68
|
+
return stream;
|
|
69
69
|
});
|
|
70
70
|
};
|
|
71
71
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -36,58 +36,57 @@ function renderToPipe(rootElement, context, pluginConfig, options) {
|
|
|
36
36
|
const onReady = ((_context_ssrContext = context.ssrContext) === null || _context_ssrContext === void 0 ? void 0 : _context_ssrContext.isSpider) ? "onAllReady" : "onShellReady";
|
|
37
37
|
const { ssrContext } = context;
|
|
38
38
|
const chunkVec = [];
|
|
39
|
-
const forUserPipe = (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
this.push(`${shellBefore}${concatedChunk}${shellAfter}`);
|
|
63
|
-
}
|
|
64
|
-
} else {
|
|
65
|
-
this.push(chunk);
|
|
66
|
-
}
|
|
67
|
-
callback();
|
|
68
|
-
} catch (e) {
|
|
69
|
-
if (e instanceof Error) {
|
|
70
|
-
callback(e);
|
|
71
|
-
} else {
|
|
72
|
-
callback(new Error("Received unkown error when streaming"));
|
|
39
|
+
const forUserPipe = new Promise((resolve) => {
|
|
40
|
+
let renderToPipeableStream;
|
|
41
|
+
try {
|
|
42
|
+
({ renderToPipeableStream } = require("react-dom/server"));
|
|
43
|
+
} catch (e) {
|
|
44
|
+
}
|
|
45
|
+
const { pipe } = renderToPipeableStream(rootElement, {
|
|
46
|
+
...options,
|
|
47
|
+
nonce: ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.nonce,
|
|
48
|
+
[onReady]() {
|
|
49
|
+
(0, import_template.getTemplates)(context, import_types.RenderLevel.SERVER_RENDER, pluginConfig).then(({ shellAfter, shellBefore }) => {
|
|
50
|
+
var _options_onShellReady;
|
|
51
|
+
options === null || options === void 0 ? void 0 : (_options_onShellReady = options.onShellReady) === null || _options_onShellReady === void 0 ? void 0 : _options_onShellReady.call(options);
|
|
52
|
+
const injectableTransform = new import_stream.Transform({
|
|
53
|
+
transform(chunk, _encoding, callback) {
|
|
54
|
+
try {
|
|
55
|
+
if (shellChunkStatus !== 1) {
|
|
56
|
+
chunkVec.push(chunk.toString());
|
|
57
|
+
let concatedChunk = chunkVec.join("");
|
|
58
|
+
if (concatedChunk.endsWith(import_common.ESCAPED_SHELL_STREAM_END_MARK)) {
|
|
59
|
+
concatedChunk = concatedChunk.replace(import_common.ESCAPED_SHELL_STREAM_END_MARK, "");
|
|
60
|
+
shellChunkStatus = 1;
|
|
61
|
+
this.push(`${shellBefore}${concatedChunk}${shellAfter}`);
|
|
73
62
|
}
|
|
63
|
+
} else {
|
|
64
|
+
this.push(chunk);
|
|
65
|
+
}
|
|
66
|
+
callback();
|
|
67
|
+
} catch (e) {
|
|
68
|
+
if (e instanceof Error) {
|
|
69
|
+
callback(e);
|
|
70
|
+
} else {
|
|
71
|
+
callback(new Error("Received unkown error when streaming"));
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
|
-
}
|
|
77
|
-
resolve(pipe(injectableTransform).pipe(stream));
|
|
74
|
+
}
|
|
78
75
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
76
|
+
pipe(injectableTransform);
|
|
77
|
+
resolve(injectableTransform);
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
onShellError(error) {
|
|
81
|
+
(0, import_template.getTemplates)(context, import_types.RenderLevel.CLIENT_RENDER, pluginConfig).then(({ shellAfter, shellBefore }) => {
|
|
82
|
+
var _options_onShellError;
|
|
83
|
+
const fallbackHtml = `${shellBefore}${shellAfter}`;
|
|
84
|
+
resolve(fallbackHtml);
|
|
85
|
+
options === null || options === void 0 ? void 0 : (_options_onShellError = options.onShellError) === null || _options_onShellError === void 0 ? void 0 : _options_onShellError.call(options, error);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
89
88
|
});
|
|
90
|
-
};
|
|
89
|
+
});
|
|
91
90
|
return forUserPipe;
|
|
92
91
|
}
|
|
93
92
|
var renderToPipe_default = renderToPipe;
|
|
@@ -42,7 +42,7 @@ function renderToPipe(rootElement, context, pluginConfig, options) {
|
|
|
42
42
|
}
|
|
43
43
|
const { shellAfter, shellBefore } = await (0, import_template.getTemplates)(context, import_types.RenderLevel.SERVER_RENDER, pluginConfig);
|
|
44
44
|
try {
|
|
45
|
-
var _context_ssrContext;
|
|
45
|
+
var _options_onShellReady, _context_ssrContext;
|
|
46
46
|
const readableOriginal = await renderToReadableStream(rootElement, {
|
|
47
47
|
...options,
|
|
48
48
|
nonce: ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.nonce,
|
|
@@ -51,6 +51,11 @@ function renderToPipe(rootElement, context, pluginConfig, options) {
|
|
|
51
51
|
options === null || options === void 0 ? void 0 : (_options_onError = options.onError) === null || _options_onError === void 0 ? void 0 : _options_onError.call(options, error);
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
+
options === null || options === void 0 ? void 0 : (_options_onShellReady = options.onShellReady) === null || _options_onShellReady === void 0 ? void 0 : _options_onShellReady.call(options);
|
|
55
|
+
readableOriginal.allReady.then(() => {
|
|
56
|
+
var _options_onAllReady;
|
|
57
|
+
options === null || options === void 0 ? void 0 : (_options_onAllReady = options.onAllReady) === null || _options_onAllReady === void 0 ? void 0 : _options_onAllReady.call(options);
|
|
58
|
+
});
|
|
54
59
|
if ((_context_ssrContext = context.ssrContext) === null || _context_ssrContext === void 0 ? void 0 : _context_ssrContext.isSpider) {
|
|
55
60
|
await readableOriginal.allReady;
|
|
56
61
|
}
|
|
@@ -78,21 +78,29 @@ const timings = {
|
|
|
78
78
|
logger: "App run useLoader cost = %d ms"
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
function
|
|
81
|
+
function getHeadersWithoutCookie(headers) {
|
|
82
|
+
const _headers = {
|
|
83
|
+
...headers,
|
|
84
|
+
cookie: void 0
|
|
85
|
+
};
|
|
86
|
+
delete _headers.cookie;
|
|
87
|
+
return _headers;
|
|
88
|
+
}
|
|
89
|
+
function createSSRTracker({ reporter, serverTiming, logger, request }) {
|
|
82
90
|
const tracker = {
|
|
83
91
|
get sessionId() {
|
|
84
|
-
return reporter.sessionId;
|
|
92
|
+
return reporter === null || reporter === void 0 ? void 0 : reporter.sessionId;
|
|
85
93
|
},
|
|
86
94
|
trackError(key, e) {
|
|
87
95
|
const { reporter: reporterContent, logger: loggerContent } = errors[key];
|
|
88
|
-
reporterContent && reporter.reportError(`SSR Error - ${reporterContent}`, e);
|
|
89
|
-
loggerContent && logger.error(loggerContent, e);
|
|
96
|
+
reporterContent && (reporter === null || reporter === void 0 ? void 0 : reporter.reportError(`SSR Error - ${reporterContent}`, e));
|
|
97
|
+
loggerContent && logger.error(`SSR Error - ${loggerContent}, error = %s, req.url = %s, req.headers = %o`, e instanceof Error ? e.stack || e.message : e, request.pathname, getHeadersWithoutCookie(request.headers));
|
|
90
98
|
},
|
|
91
99
|
trackTiming(key, cost) {
|
|
92
100
|
const { reporter: reporterName, serverTiming: serverTimingName, logger: loggerName } = timings[key];
|
|
93
|
-
reporterName && reporter.reportTiming(reporterName, cost);
|
|
101
|
+
reporterName && (reporter === null || reporter === void 0 ? void 0 : reporter.reportTiming(reporterName, cost));
|
|
94
102
|
serverTimingName && serverTiming.addServeTiming(serverTimingName, cost);
|
|
95
|
-
loggerName && logger.debug(loggerName, cost);
|
|
103
|
+
loggerName && logger.debug(`SSR Debug - ${loggerName}, req.url = %s`, cost, request.pathname);
|
|
96
104
|
}
|
|
97
105
|
};
|
|
98
106
|
return tracker;
|
|
@@ -229,8 +229,9 @@ var bootstrap = function() {
|
|
|
229
229
|
var redirectUrl = result.headers.get("Location") || "/";
|
|
230
230
|
var ssrContext = context.ssrContext;
|
|
231
231
|
if (ssrContext) {
|
|
232
|
-
|
|
233
|
-
ssrContext.res.
|
|
232
|
+
var _ssrContext_res;
|
|
233
|
+
ssrContext.res && (ssrContext.res.statusCode = status);
|
|
234
|
+
(_ssrContext_res = ssrContext.res) === null || _ssrContext_res === void 0 ? void 0 : _ssrContext_res.setHeader("Location", redirectUrl);
|
|
234
235
|
ssrContext.redirection = ssrContext.redirection || {};
|
|
235
236
|
ssrContext.redirection.status = status;
|
|
236
237
|
ssrContext.redirection.url = redirectUrl;
|
|
@@ -15,9 +15,7 @@ import { time } from "@modern-js/runtime-utils/time";
|
|
|
15
15
|
import { LOADER_REPORTER_NAME } from "@modern-js/utils/universal/constants";
|
|
16
16
|
import { RuntimeReactContext } from "../../core";
|
|
17
17
|
import { renderRoutes, urlJoin } from "./utils";
|
|
18
|
-
import { installGlobals } from "./fetch";
|
|
19
18
|
import { modifyRoutes as modifyRoutesHook } from "./hooks";
|
|
20
|
-
installGlobals();
|
|
21
19
|
function createFetchRequest(req) {
|
|
22
20
|
var origin = "".concat(req.protocol, "://").concat(req.host);
|
|
23
21
|
var url = new URL(req.originalUrl || req.url, origin);
|
|
@@ -132,7 +130,7 @@ var routerPlugin = function(param) {
|
|
|
132
130
|
case 1:
|
|
133
131
|
routerContext = _state.sent();
|
|
134
132
|
cost = end();
|
|
135
|
-
reporter.reportTiming(LOADER_REPORTER_NAME, cost);
|
|
133
|
+
reporter === null || reporter === void 0 ? void 0 : reporter.reportTiming(LOADER_REPORTER_NAME, cost);
|
|
136
134
|
serverTiming.addServeTiming(LOADER_REPORTER_NAME, cost);
|
|
137
135
|
if (_instanceof(routerContext, Response)) {
|
|
138
136
|
return [
|
|
@@ -12,7 +12,7 @@ var render = function(param) {
|
|
|
12
12
|
throw new Error('The "ssrContext" must not be undefined, but received undefined');
|
|
13
13
|
}
|
|
14
14
|
return run(ssrContext.request.headers, /* @__PURE__ */ _async_to_generator(function() {
|
|
15
|
-
var end, rootElement, tracker,
|
|
15
|
+
var end, rootElement, tracker, stream;
|
|
16
16
|
return _ts_generator(this, function(_state) {
|
|
17
17
|
end = time();
|
|
18
18
|
rootElement = createElement(App, {
|
|
@@ -21,7 +21,7 @@ var render = function(param) {
|
|
|
21
21
|
})
|
|
22
22
|
});
|
|
23
23
|
tracker = ssrContext.tracker;
|
|
24
|
-
|
|
24
|
+
stream = renderToPipe(rootElement, context, config, {
|
|
25
25
|
onShellReady: function onShellReady() {
|
|
26
26
|
var cost = end();
|
|
27
27
|
tracker.trackTiming(SSRTimings.RENDER_SHELL, cost);
|
|
@@ -39,7 +39,7 @@ var render = function(param) {
|
|
|
39
39
|
});
|
|
40
40
|
return [
|
|
41
41
|
2,
|
|
42
|
-
|
|
42
|
+
stream
|
|
43
43
|
];
|
|
44
44
|
});
|
|
45
45
|
}));
|
|
@@ -17,58 +17,57 @@ function renderToPipe(rootElement, context, pluginConfig, options) {
|
|
|
17
17
|
var onReady = ((_context_ssrContext = context.ssrContext) === null || _context_ssrContext === void 0 ? void 0 : _context_ssrContext.isSpider) ? "onAllReady" : "onShellReady";
|
|
18
18
|
var ssrContext = context.ssrContext;
|
|
19
19
|
var chunkVec = [];
|
|
20
|
-
var forUserPipe = function(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.push("".concat(shellBefore).concat(concatedChunk).concat(shellAfter));
|
|
45
|
-
}
|
|
46
|
-
} else {
|
|
47
|
-
this.push(chunk);
|
|
48
|
-
}
|
|
49
|
-
callback();
|
|
50
|
-
} catch (e) {
|
|
51
|
-
if (_instanceof(e, Error)) {
|
|
52
|
-
callback(e);
|
|
53
|
-
} else {
|
|
54
|
-
callback(new Error("Received unkown error when streaming"));
|
|
20
|
+
var forUserPipe = new Promise(function(resolve) {
|
|
21
|
+
var renderToPipeableStream;
|
|
22
|
+
try {
|
|
23
|
+
renderToPipeableStream = require("react-dom/server").renderToPipeableStream;
|
|
24
|
+
} catch (e) {
|
|
25
|
+
}
|
|
26
|
+
var _obj;
|
|
27
|
+
var pipe = renderToPipeableStream(rootElement, _object_spread_props(_object_spread({}, options), (_obj = {
|
|
28
|
+
nonce: ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.nonce
|
|
29
|
+
}, _define_property(_obj, onReady, function() {
|
|
30
|
+
getTemplates(context, RenderLevel.SERVER_RENDER, pluginConfig).then(function(param) {
|
|
31
|
+
var shellAfter = param.shellAfter, shellBefore = param.shellBefore;
|
|
32
|
+
var _options_onShellReady;
|
|
33
|
+
options === null || options === void 0 ? void 0 : (_options_onShellReady = options.onShellReady) === null || _options_onShellReady === void 0 ? void 0 : _options_onShellReady.call(options);
|
|
34
|
+
var injectableTransform = new Transform({
|
|
35
|
+
transform: function transform(chunk, _encoding, callback) {
|
|
36
|
+
try {
|
|
37
|
+
if (shellChunkStatus !== 1) {
|
|
38
|
+
chunkVec.push(chunk.toString());
|
|
39
|
+
var concatedChunk = chunkVec.join("");
|
|
40
|
+
if (concatedChunk.endsWith(ESCAPED_SHELL_STREAM_END_MARK)) {
|
|
41
|
+
concatedChunk = concatedChunk.replace(ESCAPED_SHELL_STREAM_END_MARK, "");
|
|
42
|
+
shellChunkStatus = 1;
|
|
43
|
+
this.push("".concat(shellBefore).concat(concatedChunk).concat(shellAfter));
|
|
55
44
|
}
|
|
45
|
+
} else {
|
|
46
|
+
this.push(chunk);
|
|
47
|
+
}
|
|
48
|
+
callback();
|
|
49
|
+
} catch (e) {
|
|
50
|
+
if (_instanceof(e, Error)) {
|
|
51
|
+
callback(e);
|
|
52
|
+
} else {
|
|
53
|
+
callback(new Error("Received unkown error when streaming"));
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
|
-
}
|
|
59
|
-
resolve(pipe(injectableTransform).pipe(stream));
|
|
60
|
-
});
|
|
61
|
-
}), _define_property(_obj, "onShellError", function onShellError(error) {
|
|
62
|
-
getTemplates(context, RenderLevel.CLIENT_RENDER, pluginConfig).then(function(param) {
|
|
63
|
-
var shellAfter = param.shellAfter, shellBefore = param.shellBefore;
|
|
64
|
-
var _options_onShellError;
|
|
65
|
-
var fallbackHtml = "".concat(shellBefore).concat(shellAfter);
|
|
66
|
-
resolve(fallbackHtml);
|
|
67
|
-
options === null || options === void 0 ? void 0 : (_options_onShellError = options.onShellError) === null || _options_onShellError === void 0 ? void 0 : _options_onShellError.call(options, error);
|
|
56
|
+
}
|
|
68
57
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
58
|
+
pipe(injectableTransform);
|
|
59
|
+
resolve(injectableTransform);
|
|
60
|
+
});
|
|
61
|
+
}), _define_property(_obj, "onShellError", function onShellError(error) {
|
|
62
|
+
getTemplates(context, RenderLevel.CLIENT_RENDER, pluginConfig).then(function(param) {
|
|
63
|
+
var shellAfter = param.shellAfter, shellBefore = param.shellBefore;
|
|
64
|
+
var _options_onShellError;
|
|
65
|
+
var fallbackHtml = "".concat(shellBefore).concat(shellAfter);
|
|
66
|
+
resolve(fallbackHtml);
|
|
67
|
+
options === null || options === void 0 ? void 0 : (_options_onShellError = options.onShellError) === null || _options_onShellError === void 0 ? void 0 : _options_onShellError.call(options, error);
|
|
68
|
+
});
|
|
69
|
+
}), _obj))).pipe;
|
|
70
|
+
});
|
|
72
71
|
return forUserPipe;
|
|
73
72
|
}
|
|
74
73
|
var renderToPipe_default = renderToPipe;
|
|
@@ -17,7 +17,7 @@ function renderToPipe(rootElement, context, pluginConfig, options) {
|
|
|
17
17
|
var ssrContext = context.ssrContext;
|
|
18
18
|
var forUserPipe = function() {
|
|
19
19
|
var _ref = _async_to_generator(function() {
|
|
20
|
-
var renderToReadableStream, _ref2, shellAfter, shellBefore, _context_ssrContext, readableOriginal, reader, injectableStream, err, _ref1, shellAfter1, shellBefore1, fallbackHtml;
|
|
20
|
+
var renderToReadableStream, _ref2, shellAfter, shellBefore, _options_onShellReady, _context_ssrContext, readableOriginal, reader, injectableStream, err, _ref1, shellAfter1, shellBefore1, fallbackHtml;
|
|
21
21
|
return _ts_generator(this, function(_state) {
|
|
22
22
|
switch (_state.label) {
|
|
23
23
|
case 0:
|
|
@@ -51,6 +51,11 @@ function renderToPipe(rootElement, context, pluginConfig, options) {
|
|
|
51
51
|
];
|
|
52
52
|
case 3:
|
|
53
53
|
readableOriginal = _state.sent();
|
|
54
|
+
options === null || options === void 0 ? void 0 : (_options_onShellReady = options.onShellReady) === null || _options_onShellReady === void 0 ? void 0 : _options_onShellReady.call(options);
|
|
55
|
+
readableOriginal.allReady.then(function() {
|
|
56
|
+
var _options_onAllReady;
|
|
57
|
+
options === null || options === void 0 ? void 0 : (_options_onAllReady = options.onAllReady) === null || _options_onAllReady === void 0 ? void 0 : _options_onAllReady.call(options);
|
|
58
|
+
});
|
|
54
59
|
if (!((_context_ssrContext = context.ssrContext) === null || _context_ssrContext === void 0 ? void 0 : _context_ssrContext.isSpider))
|
|
55
60
|
return [
|
|
56
61
|
3,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
2
|
+
import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
|
|
3
|
+
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
4
|
+
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
2
5
|
var SSRTimings;
|
|
3
6
|
(function(SSRTimings2) {
|
|
4
7
|
SSRTimings2[SSRTimings2["PRERENDER"] = 0] = "PRERENDER";
|
|
@@ -45,22 +48,29 @@ var timings = (_obj1 = {}, _define_property(_obj1, 0, {
|
|
|
45
48
|
serverTiming: "use-loader",
|
|
46
49
|
logger: "App run useLoader cost = %d ms"
|
|
47
50
|
}), _obj1);
|
|
51
|
+
function getHeadersWithoutCookie(headers) {
|
|
52
|
+
var _headers = _object_spread_props(_object_spread({}, headers), {
|
|
53
|
+
cookie: void 0
|
|
54
|
+
});
|
|
55
|
+
delete _headers.cookie;
|
|
56
|
+
return _headers;
|
|
57
|
+
}
|
|
48
58
|
function createSSRTracker(param) {
|
|
49
|
-
var reporter = param.reporter, serverTiming = param.serverTiming, logger = param.logger;
|
|
59
|
+
var reporter = param.reporter, serverTiming = param.serverTiming, logger = param.logger, request = param.request;
|
|
50
60
|
var tracker = {
|
|
51
61
|
get sessionId() {
|
|
52
|
-
return reporter.sessionId;
|
|
62
|
+
return reporter === null || reporter === void 0 ? void 0 : reporter.sessionId;
|
|
53
63
|
},
|
|
54
64
|
trackError: function trackError(key, e) {
|
|
55
65
|
var _errors_key = errors[key], reporterContent = _errors_key.reporter, loggerContent = _errors_key.logger;
|
|
56
|
-
reporterContent && reporter.reportError("SSR Error - ".concat(reporterContent), e);
|
|
57
|
-
loggerContent && logger.error(loggerContent, e);
|
|
66
|
+
reporterContent && (reporter === null || reporter === void 0 ? void 0 : reporter.reportError("SSR Error - ".concat(reporterContent), e));
|
|
67
|
+
loggerContent && logger.error("SSR Error - ".concat(loggerContent, ", error = %s, req.url = %s, req.headers = %o"), _instanceof(e, Error) ? e.stack || e.message : e, request.pathname, getHeadersWithoutCookie(request.headers));
|
|
58
68
|
},
|
|
59
69
|
trackTiming: function trackTiming(key, cost) {
|
|
60
70
|
var _timings_key = timings[key], reporterName = _timings_key.reporter, serverTimingName = _timings_key.serverTiming, loggerName = _timings_key.logger;
|
|
61
|
-
reporterName && reporter.reportTiming(reporterName, cost);
|
|
71
|
+
reporterName && (reporter === null || reporter === void 0 ? void 0 : reporter.reportTiming(reporterName, cost));
|
|
62
72
|
serverTimingName && serverTiming.addServeTiming(serverTimingName, cost);
|
|
63
|
-
loggerName && logger.debug(loggerName, cost);
|
|
73
|
+
loggerName && logger.debug("SSR Debug - ".concat(loggerName, ", req.url = %s"), cost, request.pathname);
|
|
64
74
|
}
|
|
65
75
|
};
|
|
66
76
|
return tracker;
|
|
@@ -193,8 +193,9 @@ const bootstrap = async (BootApp, id, root, ReactDOM) => {
|
|
|
193
193
|
const redirectUrl = result.headers.get("Location") || "/";
|
|
194
194
|
const { ssrContext } = context;
|
|
195
195
|
if (ssrContext) {
|
|
196
|
-
|
|
197
|
-
ssrContext.res.
|
|
196
|
+
var _ssrContext_res;
|
|
197
|
+
ssrContext.res && (ssrContext.res.statusCode = status);
|
|
198
|
+
(_ssrContext_res = ssrContext.res) === null || _ssrContext_res === void 0 ? void 0 : _ssrContext_res.setHeader("Location", redirectUrl);
|
|
198
199
|
ssrContext.redirection = ssrContext.redirection || {};
|
|
199
200
|
ssrContext.redirection.status = status;
|
|
200
201
|
ssrContext.redirection.url = redirectUrl;
|
|
@@ -9,9 +9,7 @@ import { time } from "@modern-js/runtime-utils/time";
|
|
|
9
9
|
import { LOADER_REPORTER_NAME } from "@modern-js/utils/universal/constants";
|
|
10
10
|
import { RuntimeReactContext } from "../../core";
|
|
11
11
|
import { renderRoutes, urlJoin } from "./utils";
|
|
12
|
-
import { installGlobals } from "./fetch";
|
|
13
12
|
import { modifyRoutes as modifyRoutesHook } from "./hooks";
|
|
14
|
-
installGlobals();
|
|
15
13
|
function createFetchRequest(req) {
|
|
16
14
|
const origin = `${req.protocol}://${req.host}`;
|
|
17
15
|
const url = new URL(req.originalUrl || req.url, origin);
|
|
@@ -77,7 +75,7 @@ const routerPlugin = ({ basename = "", routesConfig, createRoutes }) => {
|
|
|
77
75
|
requestContext
|
|
78
76
|
});
|
|
79
77
|
const cost = end();
|
|
80
|
-
reporter.reportTiming(LOADER_REPORTER_NAME, cost);
|
|
78
|
+
reporter === null || reporter === void 0 ? void 0 : reporter.reportTiming(LOADER_REPORTER_NAME, cost);
|
|
81
79
|
serverTiming.addServeTiming(LOADER_REPORTER_NAME, cost);
|
|
82
80
|
if (routerContext instanceof Response) {
|
|
83
81
|
return routerContext;
|
|
@@ -16,7 +16,7 @@ const render = ({ App, context, config }) => {
|
|
|
16
16
|
})
|
|
17
17
|
});
|
|
18
18
|
const { tracker } = ssrContext;
|
|
19
|
-
const
|
|
19
|
+
const stream = renderToPipe(rootElement, context, config, {
|
|
20
20
|
onShellReady() {
|
|
21
21
|
const cost = end();
|
|
22
22
|
tracker.trackTiming(SSRTimings.RENDER_SHELL, cost);
|
|
@@ -32,7 +32,7 @@ const render = ({ App, context, config }) => {
|
|
|
32
32
|
tracker.trackError(SSRErrors.RENDER_STREAM, error);
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
-
return
|
|
35
|
+
return stream;
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
export {
|
|
@@ -13,58 +13,57 @@ function renderToPipe(rootElement, context, pluginConfig, options) {
|
|
|
13
13
|
const onReady = ((_context_ssrContext = context.ssrContext) === null || _context_ssrContext === void 0 ? void 0 : _context_ssrContext.isSpider) ? "onAllReady" : "onShellReady";
|
|
14
14
|
const { ssrContext } = context;
|
|
15
15
|
const chunkVec = [];
|
|
16
|
-
const forUserPipe = (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
this.push(`${shellBefore}${concatedChunk}${shellAfter}`);
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
this.push(chunk);
|
|
43
|
-
}
|
|
44
|
-
callback();
|
|
45
|
-
} catch (e) {
|
|
46
|
-
if (e instanceof Error) {
|
|
47
|
-
callback(e);
|
|
48
|
-
} else {
|
|
49
|
-
callback(new Error("Received unkown error when streaming"));
|
|
16
|
+
const forUserPipe = new Promise((resolve) => {
|
|
17
|
+
let renderToPipeableStream;
|
|
18
|
+
try {
|
|
19
|
+
({ renderToPipeableStream } = require("react-dom/server"));
|
|
20
|
+
} catch (e) {
|
|
21
|
+
}
|
|
22
|
+
const { pipe } = renderToPipeableStream(rootElement, {
|
|
23
|
+
...options,
|
|
24
|
+
nonce: ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.nonce,
|
|
25
|
+
[onReady]() {
|
|
26
|
+
getTemplates(context, RenderLevel.SERVER_RENDER, pluginConfig).then(({ shellAfter, shellBefore }) => {
|
|
27
|
+
var _options_onShellReady;
|
|
28
|
+
options === null || options === void 0 ? void 0 : (_options_onShellReady = options.onShellReady) === null || _options_onShellReady === void 0 ? void 0 : _options_onShellReady.call(options);
|
|
29
|
+
const injectableTransform = new Transform({
|
|
30
|
+
transform(chunk, _encoding, callback) {
|
|
31
|
+
try {
|
|
32
|
+
if (shellChunkStatus !== 1) {
|
|
33
|
+
chunkVec.push(chunk.toString());
|
|
34
|
+
let concatedChunk = chunkVec.join("");
|
|
35
|
+
if (concatedChunk.endsWith(ESCAPED_SHELL_STREAM_END_MARK)) {
|
|
36
|
+
concatedChunk = concatedChunk.replace(ESCAPED_SHELL_STREAM_END_MARK, "");
|
|
37
|
+
shellChunkStatus = 1;
|
|
38
|
+
this.push(`${shellBefore}${concatedChunk}${shellAfter}`);
|
|
50
39
|
}
|
|
40
|
+
} else {
|
|
41
|
+
this.push(chunk);
|
|
42
|
+
}
|
|
43
|
+
callback();
|
|
44
|
+
} catch (e) {
|
|
45
|
+
if (e instanceof Error) {
|
|
46
|
+
callback(e);
|
|
47
|
+
} else {
|
|
48
|
+
callback(new Error("Received unkown error when streaming"));
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
|
-
}
|
|
54
|
-
resolve(pipe(injectableTransform).pipe(stream));
|
|
51
|
+
}
|
|
55
52
|
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
53
|
+
pipe(injectableTransform);
|
|
54
|
+
resolve(injectableTransform);
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
onShellError(error) {
|
|
58
|
+
getTemplates(context, RenderLevel.CLIENT_RENDER, pluginConfig).then(({ shellAfter, shellBefore }) => {
|
|
59
|
+
var _options_onShellError;
|
|
60
|
+
const fallbackHtml = `${shellBefore}${shellAfter}`;
|
|
61
|
+
resolve(fallbackHtml);
|
|
62
|
+
options === null || options === void 0 ? void 0 : (_options_onShellError = options.onShellError) === null || _options_onShellError === void 0 ? void 0 : _options_onShellError.call(options, error);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
66
65
|
});
|
|
67
|
-
};
|
|
66
|
+
});
|
|
68
67
|
return forUserPipe;
|
|
69
68
|
}
|
|
70
69
|
var renderToPipe_default = renderToPipe;
|
|
@@ -19,7 +19,7 @@ function renderToPipe(rootElement, context, pluginConfig, options) {
|
|
|
19
19
|
}
|
|
20
20
|
const { shellAfter, shellBefore } = await getTemplates(context, RenderLevel.SERVER_RENDER, pluginConfig);
|
|
21
21
|
try {
|
|
22
|
-
var _context_ssrContext;
|
|
22
|
+
var _options_onShellReady, _context_ssrContext;
|
|
23
23
|
const readableOriginal = await renderToReadableStream(rootElement, {
|
|
24
24
|
...options,
|
|
25
25
|
nonce: ssrContext === null || ssrContext === void 0 ? void 0 : ssrContext.nonce,
|
|
@@ -28,6 +28,11 @@ function renderToPipe(rootElement, context, pluginConfig, options) {
|
|
|
28
28
|
options === null || options === void 0 ? void 0 : (_options_onError = options.onError) === null || _options_onError === void 0 ? void 0 : _options_onError.call(options, error);
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
+
options === null || options === void 0 ? void 0 : (_options_onShellReady = options.onShellReady) === null || _options_onShellReady === void 0 ? void 0 : _options_onShellReady.call(options);
|
|
32
|
+
readableOriginal.allReady.then(() => {
|
|
33
|
+
var _options_onAllReady;
|
|
34
|
+
options === null || options === void 0 ? void 0 : (_options_onAllReady = options.onAllReady) === null || _options_onAllReady === void 0 ? void 0 : _options_onAllReady.call(options);
|
|
35
|
+
});
|
|
31
36
|
if ((_context_ssrContext = context.ssrContext) === null || _context_ssrContext === void 0 ? void 0 : _context_ssrContext.isSpider) {
|
|
32
37
|
await readableOriginal.allReady;
|
|
33
38
|
}
|
|
@@ -53,21 +53,29 @@ const timings = {
|
|
|
53
53
|
logger: "App run useLoader cost = %d ms"
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
function
|
|
56
|
+
function getHeadersWithoutCookie(headers) {
|
|
57
|
+
const _headers = {
|
|
58
|
+
...headers,
|
|
59
|
+
cookie: void 0
|
|
60
|
+
};
|
|
61
|
+
delete _headers.cookie;
|
|
62
|
+
return _headers;
|
|
63
|
+
}
|
|
64
|
+
function createSSRTracker({ reporter, serverTiming, logger, request }) {
|
|
57
65
|
const tracker = {
|
|
58
66
|
get sessionId() {
|
|
59
|
-
return reporter.sessionId;
|
|
67
|
+
return reporter === null || reporter === void 0 ? void 0 : reporter.sessionId;
|
|
60
68
|
},
|
|
61
69
|
trackError(key, e) {
|
|
62
70
|
const { reporter: reporterContent, logger: loggerContent } = errors[key];
|
|
63
|
-
reporterContent && reporter.reportError(`SSR Error - ${reporterContent}`, e);
|
|
64
|
-
loggerContent && logger.error(loggerContent, e);
|
|
71
|
+
reporterContent && (reporter === null || reporter === void 0 ? void 0 : reporter.reportError(`SSR Error - ${reporterContent}`, e));
|
|
72
|
+
loggerContent && logger.error(`SSR Error - ${loggerContent}, error = %s, req.url = %s, req.headers = %o`, e instanceof Error ? e.stack || e.message : e, request.pathname, getHeadersWithoutCookie(request.headers));
|
|
65
73
|
},
|
|
66
74
|
trackTiming(key, cost) {
|
|
67
75
|
const { reporter: reporterName, serverTiming: serverTimingName, logger: loggerName } = timings[key];
|
|
68
|
-
reporterName && reporter.reportTiming(reporterName, cost);
|
|
76
|
+
reporterName && (reporter === null || reporter === void 0 ? void 0 : reporter.reportTiming(reporterName, cost));
|
|
69
77
|
serverTimingName && serverTiming.addServeTiming(serverTimingName, cost);
|
|
70
|
-
loggerName && logger.debug(loggerName, cost);
|
|
78
|
+
loggerName && logger.debug(`SSR Debug - ${loggerName}, req.url = %s`, cost, request.pathname);
|
|
71
79
|
}
|
|
72
80
|
};
|
|
73
81
|
return tracker;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { ServerRenderOptions } from '../types';
|
|
3
|
-
export declare const render: ({ App, context, config }: ServerRenderOptions) => Promise<import("
|
|
3
|
+
export declare const render: ({ App, context, config }: ServerRenderOptions) => Promise<string | import("stream").Readable>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
/// <reference types="react" />
|
|
3
|
-
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { Readable } from 'stream';
|
|
4
4
|
import type { RenderToPipeableStreamOptions } from 'react-dom/server';
|
|
5
5
|
import { RuntimeContext, SSRPluginConfig } from '../types';
|
|
6
|
-
|
|
7
|
-
declare function renderToPipe(rootElement: React.ReactElement, context: RuntimeContext, pluginConfig: SSRPluginConfig, options?: RenderToPipeableStreamOptions): Pipe<Writable>;
|
|
6
|
+
declare function renderToPipe(rootElement: React.ReactElement, context: RuntimeContext, pluginConfig: SSRPluginConfig, options?: RenderToPipeableStreamOptions): Promise<string | Readable>;
|
|
8
7
|
export default renderToPipe;
|
|
@@ -4,5 +4,9 @@ import type { Writable } from 'stream';
|
|
|
4
4
|
import type { RenderToReadableStreamOptions } from 'react-dom/server';
|
|
5
5
|
import { RuntimeContext, SSRPluginConfig } from '../types';
|
|
6
6
|
export type Pipe<T extends Writable> = (output: T) => Promise<T | string>;
|
|
7
|
-
declare function renderToPipe(rootElement: React.ReactElement, context: RuntimeContext, pluginConfig: SSRPluginConfig, options?: RenderToReadableStreamOptions
|
|
7
|
+
declare function renderToPipe(rootElement: React.ReactElement, context: RuntimeContext, pluginConfig: SSRPluginConfig, options?: RenderToReadableStreamOptions & {
|
|
8
|
+
onShellReady?: () => void;
|
|
9
|
+
onAllReady?: () => void;
|
|
10
|
+
onShellError?: (e: unknown) => void;
|
|
11
|
+
}): Promise<string | ReadableStream<any>>;
|
|
8
12
|
export default renderToPipe;
|
|
@@ -13,7 +13,7 @@ export declare enum SSRErrors {
|
|
|
13
13
|
RENDER_STREAM = 3,
|
|
14
14
|
RENDER_SHELL = 4
|
|
15
15
|
}
|
|
16
|
-
export declare function createSSRTracker({ reporter, serverTiming, logger, }: BaseSSRServerContext): {
|
|
16
|
+
export declare function createSSRTracker({ reporter, serverTiming, logger, request, }: BaseSSRServerContext): {
|
|
17
17
|
readonly sessionId: string | undefined;
|
|
18
18
|
trackError(key: SSRErrors, e: Error): void;
|
|
19
19
|
trackTiming(key: SSRTimings, cost: number): void;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.49.0",
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">=14.17.6"
|
|
21
21
|
},
|
|
@@ -159,7 +159,6 @@
|
|
|
159
159
|
"@modern-js-reduck/plugin-immutable": "^1.1.10",
|
|
160
160
|
"@modern-js-reduck/react": "^1.1.10",
|
|
161
161
|
"@modern-js-reduck/store": "^1.1.10",
|
|
162
|
-
"@remix-run/node": "^1.12.0",
|
|
163
162
|
"@types/loadable__component": "^5.13.4",
|
|
164
163
|
"@types/react-helmet": "^6.1.2",
|
|
165
164
|
"@types/styled-components": "^5.1.14",
|
|
@@ -171,10 +170,10 @@
|
|
|
171
170
|
"react-side-effect": "^2.1.1",
|
|
172
171
|
"styled-components": "^5.3.1",
|
|
173
172
|
"@swc/helpers": "0.5.3",
|
|
174
|
-
"@modern-js/
|
|
175
|
-
"@modern-js/
|
|
176
|
-
"@modern-js/utils": "2.
|
|
177
|
-
"@modern-js/runtime-utils": "2.
|
|
173
|
+
"@modern-js/plugin": "2.49.0",
|
|
174
|
+
"@modern-js/types": "2.49.0",
|
|
175
|
+
"@modern-js/utils": "2.49.0",
|
|
176
|
+
"@modern-js/runtime-utils": "2.49.0"
|
|
178
177
|
},
|
|
179
178
|
"peerDependencies": {
|
|
180
179
|
"react": ">=17",
|
|
@@ -195,11 +194,11 @@
|
|
|
195
194
|
"ts-jest": "^29.1.0",
|
|
196
195
|
"typescript": "^5",
|
|
197
196
|
"webpack": "^5.91.0",
|
|
198
|
-
"@modern-js/app-tools": "2.
|
|
199
|
-
"@modern-js/core": "2.
|
|
200
|
-
"@modern-js/server-core": "2.
|
|
201
|
-
"@scripts/
|
|
202
|
-
"@scripts/
|
|
197
|
+
"@modern-js/app-tools": "2.49.0",
|
|
198
|
+
"@modern-js/core": "2.49.0",
|
|
199
|
+
"@modern-js/server-core": "2.49.0",
|
|
200
|
+
"@scripts/build": "2.49.0",
|
|
201
|
+
"@scripts/jest-config": "2.49.0"
|
|
203
202
|
},
|
|
204
203
|
"sideEffects": false,
|
|
205
204
|
"publishConfig": {
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var fetch_exports = {};
|
|
20
|
-
__export(fetch_exports, {
|
|
21
|
-
installGlobals: () => installGlobals
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(fetch_exports);
|
|
24
|
-
function installGlobals() {
|
|
25
|
-
}
|
|
26
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
-
0 && (module.exports = {
|
|
28
|
-
installGlobals
|
|
29
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var fetch_node_exports = {};
|
|
20
|
-
__export(fetch_node_exports, {
|
|
21
|
-
installGlobals: () => import_node.installGlobals
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(fetch_node_exports);
|
|
24
|
-
var import_node = require("@remix-run/node");
|
|
25
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
-
0 && (module.exports = {
|
|
27
|
-
installGlobals
|
|
28
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var fetch_worker_exports = {};
|
|
20
|
-
__export(fetch_worker_exports, {
|
|
21
|
-
installGlobals: () => installGlobals
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(fetch_worker_exports);
|
|
24
|
-
function installGlobals() {
|
|
25
|
-
}
|
|
26
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
-
0 && (module.exports = {
|
|
28
|
-
installGlobals
|
|
29
|
-
});
|