react-on-rails-rsc 19.2.0 → 19.2.1-rc.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/CHANGELOG.md +32 -2
- package/README.md +15 -0
- package/dist/WebpackPlugin.d.ts +1 -0
- package/dist/WebpackPlugin.d.ts.map +1 -1
- package/dist/WebpackPlugin.js.map +1 -1
- package/dist/flight-server.browser.d.ts +2 -1
- package/dist/flight-server.browser.d.ts.map +1 -1
- package/dist/flight-server.browser.js +11 -1
- package/dist/flight-server.browser.js.map +1 -1
- package/dist/flight-server.d.ts +11 -1
- package/dist/flight-server.d.ts.map +1 -1
- package/dist/flight-server.edge.d.ts +2 -1
- package/dist/flight-server.edge.d.ts.map +1 -1
- package/dist/flight-server.edge.js +11 -1
- package/dist/flight-server.edge.js.map +1 -1
- package/dist/flight-server.js +10 -1
- package/dist/flight-server.js.map +1 -1
- package/dist/flight-server.node.d.ts +2 -1
- package/dist/flight-server.node.d.ts.map +1 -1
- package/dist/flight-server.node.js +11 -1
- package/dist/flight-server.node.js.map +1 -1
- package/dist/flight-server.node.unbundled.d.ts +2 -1
- package/dist/flight-server.node.unbundled.d.ts.map +1 -1
- package/dist/flight-server.node.unbundled.js +11 -1
- package/dist/flight-server.node.unbundled.js.map +1 -1
- package/dist/flight-stylesheet-hints.d.ts +1 -0
- package/dist/flight-stylesheet-hints.d.ts.map +1 -1
- package/dist/flight-stylesheet-hints.js +3 -3
- package/dist/flight-stylesheet-hints.js.map +1 -1
- package/dist/react-server-dom-rspack/injection-loader.d.ts +13 -3
- package/dist/react-server-dom-rspack/injection-loader.d.ts.map +1 -1
- package/dist/react-server-dom-rspack/injection-loader.js +90 -9
- package/dist/react-server-dom-rspack/injection-loader.js.map +1 -1
- package/dist/react-server-dom-rspack/loader.d.ts +3 -14
- package/dist/react-server-dom-rspack/loader.d.ts.map +1 -1
- package/dist/react-server-dom-rspack/loader.js +3 -53
- package/dist/react-server-dom-rspack/loader.js.map +1 -1
- package/dist/react-server-dom-rspack/plugin.d.ts +39 -18
- package/dist/react-server-dom-rspack/plugin.d.ts.map +1 -1
- package/dist/react-server-dom-rspack/plugin.js +396 -92
- package/dist/react-server-dom-rspack/plugin.js.map +1 -1
- package/dist/react-server-dom-rspack/shared.d.ts +1 -12
- package/dist/react-server-dom-rspack/shared.d.ts.map +1 -1
- package/dist/react-server-dom-rspack/shared.js +6 -14
- package/dist/react-server-dom-rspack/shared.js.map +1 -1
- package/dist/resource-hints.d.ts +22 -0
- package/dist/resource-hints.d.ts.map +1 -0
- package/dist/resource-hints.js +50 -0
- package/dist/resource-hints.js.map +1 -0
- package/dist/webpack/RSCWebpackPlugin.d.ts +10 -1
- package/dist/webpack/RSCWebpackPlugin.d.ts.map +1 -1
- package/dist/webpack/RSCWebpackPlugin.js +255 -49
- package/dist/webpack/RSCWebpackPlugin.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this package will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [
|
|
5
|
+
## [19.2.1-rc.0] - 2026-07-05
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Added RSC server resource hint helpers for preloading assets, styles, scripts, fonts, and images, plus preconnect and DNS-prefetch support for already-resolved production asset URLs. The default `react-on-rails-rsc/server` fallback keeps failing fast at import time without the `react-server` condition while still publishing the expanded type surface. ([#143])
|
|
9
|
+
- Added opt-in client-reference diagnostics that emit RSC client reference JS/CSS asset files, byte sizes, and de-duplicated total byte counts for static island performance audits. ([#144])
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- Stopped `RSCRspackPlugin` from injecting a no-op `"use client"` tagging loader into every first-party module, preserving rspack incremental caching while keeping filesystem-based client-reference discovery. ([#167])
|
|
13
|
+
- Skipped rspack diagnostics CSS collection when client-reference diagnostics are disabled, avoiding dead per-chunk-group CSS scans on the default build path. ([#152])
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- Fixed Webpack client-reference string paths to resolve relative to the compiler context and warned when `output.publicPath: "auto"` cannot be serialized into the RSC manifest. ([#171])
|
|
17
|
+
- Fixed Rspack client-reference manifests to emit deterministic chunk pair ordering under Rspack 2 while preserving the full sibling chunk set. ([#140])
|
|
18
|
+
- Fixed Rspack client manifests to emit stylesheet hints, normalize unserializable `output.publicPath: "auto"`, preserve `.mjs` chunk files, and match webpack split-runtime chunk metadata. ([#172])
|
|
19
|
+
- Fixed `RSCRspackPlugin` runtime injection state to be scoped by compiler, avoiding MultiCompiler and sequential-build cross-talk between rspack client/server builds with different client references or chunk names. ([#168])
|
|
20
|
+
- Fixed `RSCRspackPlugin` to install the generated client-reference `splitChunks` guard after Rspack applies option defaults, so default optimization configs keep generated client chunks self-contained. ([#165])
|
|
21
|
+
- Fixed watch rebuilds so rspack and webpack refresh client-reference runtime injections when `"use client"` files are added or removed without restarting the dev server. ([#164])
|
|
22
|
+
- Restored RSC stylesheet hints when a CSS-merging SplitChunks cache group, such as mini-css-extract's `styles` group, moves a client reference's own CSS into a CSS-only split chunk. ([#151])
|
|
23
|
+
- Scoped Rspack diagnostics CSS to the generated chunk group for the reported client reference, avoiding importer-island CSS being counted against an imported child reference. ([#166])
|
|
6
24
|
|
|
7
25
|
## [19.2.0] - 2026-06-28
|
|
8
26
|
|
|
@@ -47,11 +65,23 @@ All notable changes to this package will be documented in this file.
|
|
|
47
65
|
### Security
|
|
48
66
|
- Updated the vendored `react-server-dom-webpack` runtime from React 19.0.3 to the React 19.0.7 security level, applying the React 19.0.4 fixes for CVE-2025-55183, CVE-2025-55184, and CVE-2025-67779 plus the React 19.0.7 reply-decoding denial-of-service fixes for CVE-2026-23869 (GHSA-479c-33wc-g2pg) and CVE-2026-23870 (GHSA-rv78-f8rc-xrxh). Note: the upstream CVE-2026-23869 fix changes the reply wire format for nested `FormData`, so client and server must both run the patched runtime shipped by this package. ([#48]) ([#86])
|
|
49
67
|
|
|
50
|
-
[
|
|
68
|
+
[19.2.1-rc.0]: https://github.com/shakacode/react_on_rails_rsc/compare/19.2.0...19.2.1-rc.0
|
|
51
69
|
[19.2.0]: https://github.com/shakacode/react_on_rails_rsc/compare/19.0.5...19.2.0
|
|
52
70
|
[19.0.5]: https://github.com/shakacode/react_on_rails_rsc/compare/19.0.4...19.0.5
|
|
53
71
|
|
|
54
72
|
[#120]: https://github.com/shakacode/react_on_rails_rsc/pull/120
|
|
73
|
+
[#140]: https://github.com/shakacode/react_on_rails_rsc/pull/140
|
|
74
|
+
[#143]: https://github.com/shakacode/react_on_rails_rsc/pull/143
|
|
75
|
+
[#144]: https://github.com/shakacode/react_on_rails_rsc/pull/144
|
|
76
|
+
[#167]: https://github.com/shakacode/react_on_rails_rsc/pull/167
|
|
77
|
+
[#168]: https://github.com/shakacode/react_on_rails_rsc/pull/168
|
|
78
|
+
[#172]: https://github.com/shakacode/react_on_rails_rsc/pull/172
|
|
79
|
+
[#165]: https://github.com/shakacode/react_on_rails_rsc/pull/165
|
|
80
|
+
[#164]: https://github.com/shakacode/react_on_rails_rsc/pull/164
|
|
81
|
+
[#151]: https://github.com/shakacode/react_on_rails_rsc/pull/151
|
|
82
|
+
[#152]: https://github.com/shakacode/react_on_rails_rsc/pull/152
|
|
83
|
+
[#166]: https://github.com/shakacode/react_on_rails_rsc/pull/166
|
|
84
|
+
[#171]: https://github.com/shakacode/react_on_rails_rsc/pull/171
|
|
55
85
|
[#102]: https://github.com/shakacode/react_on_rails_rsc/pull/102
|
|
56
86
|
[#106]: https://github.com/shakacode/react_on_rails_rsc/pull/106
|
|
57
87
|
[#23]: https://github.com/shakacode/react_on_rails_rsc/pull/23
|
package/README.md
CHANGED
|
@@ -23,6 +23,21 @@ release, see [`docs/consuming-unreleased-builds.md`](docs/consuming-unreleased-b
|
|
|
23
23
|
for the yalc, canary publish, throwaway dist branch, and version-pairing
|
|
24
24
|
workflows.
|
|
25
25
|
|
|
26
|
+
## Critical Resource Hints
|
|
27
|
+
|
|
28
|
+
RSC server components can emit preload, preconnect, DNS-prefetch, and critical
|
|
29
|
+
stylesheet hints for already-resolved production asset URLs. See
|
|
30
|
+
[`docs/critical-resource-hints.md`](docs/critical-resource-hints.md).
|
|
31
|
+
|
|
32
|
+
## Static RSC Page Guides
|
|
33
|
+
|
|
34
|
+
For static or mostly static page integrations, see
|
|
35
|
+
[`docs/rsc-static-islands-diagnostics.md`](docs/rsc-static-islands-diagnostics.md)
|
|
36
|
+
for client-reference diagnostics, static islands, and tiny browser sidecar
|
|
37
|
+
patterns. Downstream Rails apps that need system specs for streamed payloads
|
|
38
|
+
should use
|
|
39
|
+
[`docs/rails-system-spec-streaming-rsc.md`](docs/rails-system-spec-streaming-rsc.md).
|
|
40
|
+
|
|
26
41
|
## Package Contents
|
|
27
42
|
|
|
28
43
|
This package provides internal tooling for React Server Components integration:
|
package/dist/WebpackPlugin.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export type Options = {
|
|
|
13
13
|
chunkGroupWarningThreshold?: number | false;
|
|
14
14
|
clientManifestFilename?: string;
|
|
15
15
|
serverConsumerManifestFilename?: string;
|
|
16
|
+
clientReferenceDiagnosticsFilename?: string | false;
|
|
16
17
|
};
|
|
17
18
|
export declare class RSCWebpackPlugin {
|
|
18
19
|
private plugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebpackPlugin.d.ts","sourceRoot":"","sources":["../src/WebpackPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAOnC,KAAK,yBAAyB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,mBAAmB,GAAG,MAAM,GAAG,yBAAyB,CAAC;AAE9D,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,mBAAmB,GAAG,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5C,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,8BAA8B,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"WebpackPlugin.d.ts","sourceRoot":"","sources":["../src/WebpackPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAOnC,KAAK,yBAAyB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,mBAAmB,GAAG,MAAM,GAAG,yBAAyB,CAAC;AAE9D,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,mBAAmB,GAAG,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5C,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,kCAAkC,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CACrD,CAAC;AAEF,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAyB;gBAE3B,OAAO,EAAE,OAAO;IAkB5B,KAAK,CAAC,QAAQ,EAAE,QAAQ;CAGzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebpackPlugin.js","sourceRoot":"","sources":["../src/WebpackPlugin.ts"],"names":[],"mappings":";;;AACA,yDAG4B;AAC5B,iEAAwF;
|
|
1
|
+
{"version":3,"file":"WebpackPlugin.js","sourceRoot":"","sources":["../src/WebpackPlugin.ts"],"names":[],"mappings":";;;AACA,yDAG4B;AAC5B,iEAAwF;AAqBxF,MAAa,gBAAgB;IAG3B,YAAY,OAAgB;QAC1B,MAAM,iBAAiB,GACrB,OAAO,CAAC,gBAAgB,KAAK,SAAS;YACpC,CAAC,CAAC;gBACE,GAAG,OAAO;gBACV,gBAAgB,EAAE;oBAChB;wBACE,SAAS,EAAE,GAAG;wBACd,SAAS,EAAE,IAAI;wBACf,OAAO,EAAE,oDAAiC;wBAC1C,OAAO,EAAE,oDAAiC;qBAC3C;iBACF;aACF;YACH,CAAC,CAAC,OAAO,CAAC;QACd,IAAI,CAAC,MAAM,GAAG,IAAI,mCAAsB,CAAC,iBAAiB,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,QAAkB;QACtB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;CACF;AAxBD,4CAwBC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { preconnect, prefetchDNS, preinitScript, preinitStyle, preloadAsset, preloadFont, preloadImage, preloadScript, preloadStyle, } from './resource-hints';
|
|
2
|
+
export type { PreconnectResourceOptions, PreinitScriptOptions, PreinitStyleOptions, PreloadAssetOptions, PreloadFontOptions, PreloadImageOptions, PreloadScriptOptions, PreloadStyleOptions, ResourceHintAs, ResourceHintCrossOrigin, ResourceHintFetchPriority, } from './resource-hints';
|
|
1
3
|
type ServerFunction = (...args: unknown[]) => unknown;
|
|
2
4
|
type RegisterClientReference = (proxyImplementation: unknown, id: string, exportName: string) => unknown;
|
|
3
5
|
type RegisterServerReference = (reference: unknown, id: string, exportName: string) => unknown;
|
|
@@ -9,5 +11,4 @@ export declare const registerServerReference: RegisterServerReference;
|
|
|
9
11
|
export declare const registerClientReference: RegisterClientReference;
|
|
10
12
|
export declare const createClientModuleProxy: (moduleId: string) => unknown;
|
|
11
13
|
export declare const createTemporaryReferenceSet: () => unknown;
|
|
12
|
-
export {};
|
|
13
14
|
//# sourceMappingURL=flight-server.browser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flight-server.browser.d.ts","sourceRoot":"","sources":["../src/flight-server.browser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flight-server.browser.d.ts","sourceRoot":"","sources":["../src/flight-server.browser.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAE1B,KAAK,cAAc,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AACtD,KAAK,uBAAuB,GAAG,CAC7B,mBAAmB,EAAE,OAAO,EAC5B,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,MAAM,KACf,OAAO,CAAC;AACb,KAAK,uBAAuB,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;AAI/F,eAAO,MAAM,sBAAsB,EAAE,cACyC,CAAC;AAC/E,eAAO,MAAM,WAAW,EAAE,cAAqD,CAAC;AAChF,eAAO,MAAM,YAAY,EAAE,cAAsD,CAAC;AAClF,eAAO,MAAM,eAAe,EAAE,cAAyD,CAAC;AACxF,eAAO,MAAM,uBAAuB,EAAE,uBACqB,CAAC;AAC5D,eAAO,MAAM,uBAAuB,EAAE,uBACqB,CAAC;AAC5D,eAAO,MAAM,uBAAuB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OACK,CAAC;AAClE,eAAO,MAAM,2BAA2B,EAAE,MAAM,OACK,CAAC"}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createTemporaryReferenceSet = exports.createClientModuleProxy = exports.registerClientReference = exports.registerServerReference = exports.decodeFormState = exports.decodeAction = exports.decodeReply = exports.renderToReadableStream = void 0;
|
|
3
|
+
exports.createTemporaryReferenceSet = exports.createClientModuleProxy = exports.registerClientReference = exports.registerServerReference = exports.decodeFormState = exports.decodeAction = exports.decodeReply = exports.renderToReadableStream = exports.preloadStyle = exports.preloadScript = exports.preloadImage = exports.preloadFont = exports.preloadAsset = exports.preinitStyle = exports.preinitScript = exports.prefetchDNS = exports.preconnect = void 0;
|
|
4
4
|
const server = require("react-server-dom-webpack/server.browser");
|
|
5
5
|
const flight_stylesheet_hints_1 = require("./flight-stylesheet-hints");
|
|
6
|
+
var resource_hints_1 = require("./resource-hints");
|
|
7
|
+
Object.defineProperty(exports, "preconnect", { enumerable: true, get: function () { return resource_hints_1.preconnect; } });
|
|
8
|
+
Object.defineProperty(exports, "prefetchDNS", { enumerable: true, get: function () { return resource_hints_1.prefetchDNS; } });
|
|
9
|
+
Object.defineProperty(exports, "preinitScript", { enumerable: true, get: function () { return resource_hints_1.preinitScript; } });
|
|
10
|
+
Object.defineProperty(exports, "preinitStyle", { enumerable: true, get: function () { return resource_hints_1.preinitStyle; } });
|
|
11
|
+
Object.defineProperty(exports, "preloadAsset", { enumerable: true, get: function () { return resource_hints_1.preloadAsset; } });
|
|
12
|
+
Object.defineProperty(exports, "preloadFont", { enumerable: true, get: function () { return resource_hints_1.preloadFont; } });
|
|
13
|
+
Object.defineProperty(exports, "preloadImage", { enumerable: true, get: function () { return resource_hints_1.preloadImage; } });
|
|
14
|
+
Object.defineProperty(exports, "preloadScript", { enumerable: true, get: function () { return resource_hints_1.preloadScript; } });
|
|
15
|
+
Object.defineProperty(exports, "preloadStyle", { enumerable: true, get: function () { return resource_hints_1.preloadStyle; } });
|
|
6
16
|
const renderToReadableStreamReact = server.renderToReadableStream;
|
|
7
17
|
const renderToReadableStream = (model, webpackMap, options) => renderToReadableStreamReact(model, (0, flight_stylesheet_hints_1.withStylesheetHints)(webpackMap), options);
|
|
8
18
|
exports.renderToReadableStream = renderToReadableStream;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flight-server.browser.js","sourceRoot":"","sources":["../src/flight-server.browser.ts"],"names":[],"mappings":";;;AAAA,kEAAkE;AAClE,uEAAgE;
|
|
1
|
+
{"version":3,"file":"flight-server.browser.js","sourceRoot":"","sources":["../src/flight-server.browser.ts"],"names":[],"mappings":";;;AAAA,kEAAkE;AAClE,uEAAgE;AAChE,mDAU0B;AATxB,4GAAA,UAAU,OAAA;AACV,6GAAA,WAAW,OAAA;AACX,+GAAA,aAAa,OAAA;AACb,8GAAA,YAAY,OAAA;AACZ,8GAAA,YAAY,OAAA;AACZ,6GAAA,WAAW,OAAA;AACX,8GAAA,YAAY,OAAA;AACZ,+GAAA,aAAa,OAAA;AACb,8GAAA,YAAY,OAAA;AAwBd,MAAM,2BAA2B,GAAG,MAAM,CAAC,sBAAwC,CAAC;AAE7E,MAAM,sBAAsB,GAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CACnF,2BAA2B,CAAC,KAAK,EAAE,IAAA,6CAAmB,EAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC;AADlE,QAAA,sBAAsB,0BAC4C;AAClE,QAAA,WAAW,GAAmB,MAAM,CAAC,WAA6B,CAAC;AACnE,QAAA,YAAY,GAAmB,MAAM,CAAC,YAA8B,CAAC;AACrE,QAAA,eAAe,GAAmB,MAAM,CAAC,eAAiC,CAAC;AAC3E,QAAA,uBAAuB,GAClC,MAAM,CAAC,uBAAkD,CAAC;AAC/C,QAAA,uBAAuB,GAClC,MAAM,CAAC,uBAAkD,CAAC;AAC/C,QAAA,uBAAuB,GAClC,MAAM,CAAC,uBAAwD,CAAC;AACrD,QAAA,2BAA2B,GACtC,MAAM,CAAC,2BAA4C,CAAC"}
|
package/dist/flight-server.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { PreconnectResourceOptions, PreinitScriptOptions, PreinitStyleOptions, PreloadAssetOptions, PreloadFontOptions, PreloadImageOptions, PreloadScriptOptions, PreloadStyleOptions } from './resource-hints';
|
|
2
|
+
export type { PreconnectResourceOptions, PreinitScriptOptions, PreinitStyleOptions, PreloadAssetOptions, PreloadFontOptions, PreloadImageOptions, PreloadScriptOptions, PreloadStyleOptions, ResourceHintAs, ResourceHintCrossOrigin, ResourceHintFetchPriority, } from './resource-hints';
|
|
1
3
|
type ServerFunction = (...args: unknown[]) => unknown;
|
|
2
4
|
type RegisterClientReference = (proxyImplementation: unknown, id: string, exportName: string) => unknown;
|
|
3
5
|
type RegisterServerReference = (reference: unknown, id: string, exportName: string) => unknown;
|
|
@@ -12,5 +14,13 @@ export declare const registerServerReference: RegisterServerReference;
|
|
|
12
14
|
export declare const registerClientReference: RegisterClientReference;
|
|
13
15
|
export declare const createClientModuleProxy: (moduleId: string) => unknown;
|
|
14
16
|
export declare const createTemporaryReferenceSet: () => unknown;
|
|
15
|
-
export
|
|
17
|
+
export declare const prefetchDNS: (href: string) => void;
|
|
18
|
+
export declare const preconnect: (href: string, options?: PreconnectResourceOptions) => void;
|
|
19
|
+
export declare const preloadAsset: (href: string, options: PreloadAssetOptions) => void;
|
|
20
|
+
export declare const preloadStyle: (href: string, options?: PreloadStyleOptions) => void;
|
|
21
|
+
export declare const preinitStyle: (href: string, options?: PreinitStyleOptions) => void;
|
|
22
|
+
export declare const preloadScript: (href: string, options?: PreloadScriptOptions) => void;
|
|
23
|
+
export declare const preinitScript: (href: string, options?: PreinitScriptOptions) => void;
|
|
24
|
+
export declare const preloadFont: (href: string, options?: PreloadFontOptions) => void;
|
|
25
|
+
export declare const preloadImage: (href: string, options?: PreloadImageOptions) => void;
|
|
16
26
|
//# sourceMappingURL=flight-server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flight-server.d.ts","sourceRoot":"","sources":["../src/flight-server.ts"],"names":[],"mappings":"AAAA,KAAK,cAAc,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AACtD,KAAK,uBAAuB,GAAG,CAC7B,mBAAmB,EAAE,OAAO,EAC5B,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,MAAM,KACf,OAAO,CAAC;AACb,KAAK,uBAAuB,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;AAQ/F,eAAO,MAAM,sBAAsB,EAAE,cAAmC,CAAC;AACzE,eAAO,MAAM,sBAAsB,EAAE,cAAmC,CAAC;AACzE,eAAO,MAAM,WAAW,EAAE,cAAmC,CAAC;AAC9D,eAAO,MAAM,qBAAqB,EAAE,cAAmC,CAAC;AACxE,eAAO,MAAM,4BAA4B,EAAE,cAAmC,CAAC;AAC/E,eAAO,MAAM,YAAY,EAAE,cAAmC,CAAC;AAC/D,eAAO,MAAM,eAAe,EAAE,cAAmC,CAAC;AAClE,eAAO,MAAM,uBAAuB,EAAE,uBAA4C,CAAC;AACnF,eAAO,MAAM,uBAAuB,EAAE,uBAA4C,CAAC;AACnF,eAAO,MAAM,uBAAuB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAA4B,CAAC;AACzF,eAAO,MAAM,2BAA2B,EAAE,MAAM,OAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"flight-server.d.ts","sourceRoot":"","sources":["../src/flight-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACpB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;AACtE,eAAO,MAAM,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,yBAAyB,KAAK,IAC5D,CAAC;AACrB,eAAO,MAAM,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,KAAK,IACvD,CAAC;AACrB,eAAO,MAAM,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,KAAK,IACxD,CAAC;AACrB,eAAO,MAAM,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,KAAK,IACxD,CAAC;AACrB,eAAO,MAAM,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,KAAK,IAC1D,CAAC;AACrB,eAAO,MAAM,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,KAAK,IAC1D,CAAC;AACrB,eAAO,MAAM,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,KAAK,IACtD,CAAC;AACrB,eAAO,MAAM,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,KAAK,IACxD,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { preconnect, prefetchDNS, preinitScript, preinitStyle, preloadAsset, preloadFont, preloadImage, preloadScript, preloadStyle, } from './resource-hints';
|
|
2
|
+
export type { PreconnectResourceOptions, PreinitScriptOptions, PreinitStyleOptions, PreloadAssetOptions, PreloadFontOptions, PreloadImageOptions, PreloadScriptOptions, PreloadStyleOptions, ResourceHintAs, ResourceHintCrossOrigin, ResourceHintFetchPriority, } from './resource-hints';
|
|
1
3
|
type ServerFunction = (...args: unknown[]) => unknown;
|
|
2
4
|
type RegisterClientReference = (proxyImplementation: unknown, id: string, exportName: string) => unknown;
|
|
3
5
|
type RegisterServerReference = (reference: unknown, id: string, exportName: string) => unknown;
|
|
@@ -10,5 +12,4 @@ export declare const registerServerReference: RegisterServerReference;
|
|
|
10
12
|
export declare const registerClientReference: RegisterClientReference;
|
|
11
13
|
export declare const createClientModuleProxy: (moduleId: string) => unknown;
|
|
12
14
|
export declare const createTemporaryReferenceSet: () => unknown;
|
|
13
|
-
export {};
|
|
14
15
|
//# sourceMappingURL=flight-server.edge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flight-server.edge.d.ts","sourceRoot":"","sources":["../src/flight-server.edge.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flight-server.edge.d.ts","sourceRoot":"","sources":["../src/flight-server.edge.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAE1B,KAAK,cAAc,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AACtD,KAAK,uBAAuB,GAAG,CAC7B,mBAAmB,EAAE,OAAO,EAC5B,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,MAAM,KACf,OAAO,CAAC;AACb,KAAK,uBAAuB,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;AAI/F,eAAO,MAAM,sBAAsB,EAAE,cACyC,CAAC;AAC/E,eAAO,MAAM,WAAW,EAAE,cAAqD,CAAC;AAChF,eAAO,MAAM,4BAA4B,EAAE,cACY,CAAC;AACxD,eAAO,MAAM,YAAY,EAAE,cAAsD,CAAC;AAClF,eAAO,MAAM,eAAe,EAAE,cAAyD,CAAC;AACxF,eAAO,MAAM,uBAAuB,EAAE,uBACqB,CAAC;AAC5D,eAAO,MAAM,uBAAuB,EAAE,uBACqB,CAAC;AAC5D,eAAO,MAAM,uBAAuB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OACK,CAAC;AAClE,eAAO,MAAM,2BAA2B,EAAE,MAAM,OACK,CAAC"}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createTemporaryReferenceSet = exports.createClientModuleProxy = exports.registerClientReference = exports.registerServerReference = exports.decodeFormState = exports.decodeAction = exports.decodeReplyFromAsyncIterable = exports.decodeReply = exports.renderToReadableStream = void 0;
|
|
3
|
+
exports.createTemporaryReferenceSet = exports.createClientModuleProxy = exports.registerClientReference = exports.registerServerReference = exports.decodeFormState = exports.decodeAction = exports.decodeReplyFromAsyncIterable = exports.decodeReply = exports.renderToReadableStream = exports.preloadStyle = exports.preloadScript = exports.preloadImage = exports.preloadFont = exports.preloadAsset = exports.preinitStyle = exports.preinitScript = exports.prefetchDNS = exports.preconnect = void 0;
|
|
4
4
|
const server = require("react-server-dom-webpack/server.edge");
|
|
5
5
|
const flight_stylesheet_hints_1 = require("./flight-stylesheet-hints");
|
|
6
|
+
var resource_hints_1 = require("./resource-hints");
|
|
7
|
+
Object.defineProperty(exports, "preconnect", { enumerable: true, get: function () { return resource_hints_1.preconnect; } });
|
|
8
|
+
Object.defineProperty(exports, "prefetchDNS", { enumerable: true, get: function () { return resource_hints_1.prefetchDNS; } });
|
|
9
|
+
Object.defineProperty(exports, "preinitScript", { enumerable: true, get: function () { return resource_hints_1.preinitScript; } });
|
|
10
|
+
Object.defineProperty(exports, "preinitStyle", { enumerable: true, get: function () { return resource_hints_1.preinitStyle; } });
|
|
11
|
+
Object.defineProperty(exports, "preloadAsset", { enumerable: true, get: function () { return resource_hints_1.preloadAsset; } });
|
|
12
|
+
Object.defineProperty(exports, "preloadFont", { enumerable: true, get: function () { return resource_hints_1.preloadFont; } });
|
|
13
|
+
Object.defineProperty(exports, "preloadImage", { enumerable: true, get: function () { return resource_hints_1.preloadImage; } });
|
|
14
|
+
Object.defineProperty(exports, "preloadScript", { enumerable: true, get: function () { return resource_hints_1.preloadScript; } });
|
|
15
|
+
Object.defineProperty(exports, "preloadStyle", { enumerable: true, get: function () { return resource_hints_1.preloadStyle; } });
|
|
6
16
|
const renderToReadableStreamReact = server.renderToReadableStream;
|
|
7
17
|
const renderToReadableStream = (model, webpackMap, options) => renderToReadableStreamReact(model, (0, flight_stylesheet_hints_1.withStylesheetHints)(webpackMap), options);
|
|
8
18
|
exports.renderToReadableStream = renderToReadableStream;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flight-server.edge.js","sourceRoot":"","sources":["../src/flight-server.edge.ts"],"names":[],"mappings":";;;AAAA,+DAA+D;AAC/D,uEAAgE;
|
|
1
|
+
{"version":3,"file":"flight-server.edge.js","sourceRoot":"","sources":["../src/flight-server.edge.ts"],"names":[],"mappings":";;;AAAA,+DAA+D;AAC/D,uEAAgE;AAChE,mDAU0B;AATxB,4GAAA,UAAU,OAAA;AACV,6GAAA,WAAW,OAAA;AACX,+GAAA,aAAa,OAAA;AACb,8GAAA,YAAY,OAAA;AACZ,8GAAA,YAAY,OAAA;AACZ,6GAAA,WAAW,OAAA;AACX,8GAAA,YAAY,OAAA;AACZ,+GAAA,aAAa,OAAA;AACb,8GAAA,YAAY,OAAA;AAwBd,MAAM,2BAA2B,GAAG,MAAM,CAAC,sBAAwC,CAAC;AAE7E,MAAM,sBAAsB,GAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CACnF,2BAA2B,CAAC,KAAK,EAAE,IAAA,6CAAmB,EAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC;AADlE,QAAA,sBAAsB,0BAC4C;AAClE,QAAA,WAAW,GAAmB,MAAM,CAAC,WAA6B,CAAC;AACnE,QAAA,4BAA4B,GACvC,MAAM,CAAC,4BAA8C,CAAC;AAC3C,QAAA,YAAY,GAAmB,MAAM,CAAC,YAA8B,CAAC;AACrE,QAAA,eAAe,GAAmB,MAAM,CAAC,eAAiC,CAAC;AAC3E,QAAA,uBAAuB,GAClC,MAAM,CAAC,uBAAkD,CAAC;AAC/C,QAAA,uBAAuB,GAClC,MAAM,CAAC,uBAAkD,CAAC;AAC/C,QAAA,uBAAuB,GAClC,MAAM,CAAC,uBAAwD,CAAC;AACrD,QAAA,2BAA2B,GACtC,MAAM,CAAC,2BAA4C,CAAC"}
|
package/dist/flight-server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createTemporaryReferenceSet = exports.createClientModuleProxy = exports.registerClientReference = exports.registerServerReference = exports.decodeFormState = exports.decodeAction = exports.decodeReplyFromAsyncIterable = exports.decodeReplyFromBusboy = exports.decodeReply = exports.renderToPipeableStream = exports.renderToReadableStream = void 0;
|
|
3
|
+
exports.preloadImage = exports.preloadFont = exports.preinitScript = exports.preloadScript = exports.preinitStyle = exports.preloadStyle = exports.preloadAsset = exports.preconnect = exports.prefetchDNS = exports.createTemporaryReferenceSet = exports.createClientModuleProxy = exports.registerClientReference = exports.registerServerReference = exports.decodeFormState = exports.decodeAction = exports.decodeReplyFromAsyncIterable = exports.decodeReplyFromBusboy = exports.decodeReply = exports.renderToPipeableStream = exports.renderToReadableStream = void 0;
|
|
4
4
|
throw new Error('The React Server Writer cannot be used outside a react-server environment. ' +
|
|
5
5
|
'You must configure Node.js using the `--conditions react-server` flag.');
|
|
6
6
|
// Unreachable at runtime; present so tsc emits the public default type surface.
|
|
@@ -15,4 +15,13 @@ exports.registerServerReference = undefined;
|
|
|
15
15
|
exports.registerClientReference = undefined;
|
|
16
16
|
exports.createClientModuleProxy = undefined;
|
|
17
17
|
exports.createTemporaryReferenceSet = undefined;
|
|
18
|
+
exports.prefetchDNS = undefined;
|
|
19
|
+
exports.preconnect = undefined;
|
|
20
|
+
exports.preloadAsset = undefined;
|
|
21
|
+
exports.preloadStyle = undefined;
|
|
22
|
+
exports.preinitStyle = undefined;
|
|
23
|
+
exports.preloadScript = undefined;
|
|
24
|
+
exports.preinitScript = undefined;
|
|
25
|
+
exports.preloadFont = undefined;
|
|
26
|
+
exports.preloadImage = undefined;
|
|
18
27
|
//# sourceMappingURL=flight-server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flight-server.js","sourceRoot":"","sources":["../src/flight-server.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"flight-server.js","sourceRoot":"","sources":["../src/flight-server.ts"],"names":[],"mappings":";;;AAgCA,MAAM,IAAI,KAAK,CACb,6EAA6E;IAC3E,wEAAwE,CAC3E,CAAC;AAEF,gFAAgF;AACnE,QAAA,sBAAsB,GAAmB,SAAkB,CAAC;AAC5D,QAAA,sBAAsB,GAAmB,SAAkB,CAAC;AAC5D,QAAA,WAAW,GAAmB,SAAkB,CAAC;AACjD,QAAA,qBAAqB,GAAmB,SAAkB,CAAC;AAC3D,QAAA,4BAA4B,GAAmB,SAAkB,CAAC;AAClE,QAAA,YAAY,GAAmB,SAAkB,CAAC;AAClD,QAAA,eAAe,GAAmB,SAAkB,CAAC;AACrD,QAAA,uBAAuB,GAA4B,SAAkB,CAAC;AACtE,QAAA,uBAAuB,GAA4B,SAAkB,CAAC;AACtE,QAAA,uBAAuB,GAAkC,SAAkB,CAAC;AAC5E,QAAA,2BAA2B,GAAkB,SAAkB,CAAC;AAChE,QAAA,WAAW,GAA2B,SAAkB,CAAC;AACzD,QAAA,UAAU,GACrB,SAAkB,CAAC;AACR,QAAA,YAAY,GACvB,SAAkB,CAAC;AACR,QAAA,YAAY,GACvB,SAAkB,CAAC;AACR,QAAA,YAAY,GACvB,SAAkB,CAAC;AACR,QAAA,aAAa,GACxB,SAAkB,CAAC;AACR,QAAA,aAAa,GACxB,SAAkB,CAAC;AACR,QAAA,WAAW,GACtB,SAAkB,CAAC;AACR,QAAA,YAAY,GACvB,SAAkB,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { preconnect, prefetchDNS, preinitScript, preinitStyle, preloadAsset, preloadFont, preloadImage, preloadScript, preloadStyle, } from './resource-hints';
|
|
2
|
+
export type { PreconnectResourceOptions, PreinitScriptOptions, PreinitStyleOptions, PreloadAssetOptions, PreloadFontOptions, PreloadImageOptions, PreloadScriptOptions, PreloadStyleOptions, ResourceHintAs, ResourceHintCrossOrigin, ResourceHintFetchPriority, } from './resource-hints';
|
|
1
3
|
type ServerFunction = (...args: unknown[]) => unknown;
|
|
2
4
|
type RegisterClientReference = (proxyImplementation: unknown, id: string, exportName: string) => unknown;
|
|
3
5
|
type RegisterServerReference = (reference: unknown, id: string, exportName: string) => unknown;
|
|
@@ -12,5 +14,4 @@ export declare const registerServerReference: RegisterServerReference;
|
|
|
12
14
|
export declare const registerClientReference: RegisterClientReference;
|
|
13
15
|
export declare const createClientModuleProxy: (moduleId: string) => unknown;
|
|
14
16
|
export declare const createTemporaryReferenceSet: () => unknown;
|
|
15
|
-
export {};
|
|
16
17
|
//# sourceMappingURL=flight-server.node.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flight-server.node.d.ts","sourceRoot":"","sources":["../src/flight-server.node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flight-server.node.d.ts","sourceRoot":"","sources":["../src/flight-server.node.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAE1B,KAAK,cAAc,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AACtD,KAAK,uBAAuB,GAAG,CAC7B,mBAAmB,EAAE,OAAO,EAC5B,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,MAAM,KACf,OAAO,CAAC;AACb,KAAK,uBAAuB,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;AAK/F,eAAO,MAAM,sBAAsB,EAAE,cACyC,CAAC;AAC/E,eAAO,MAAM,sBAAsB,EAAE,cACyC,CAAC;AAC/E,eAAO,MAAM,WAAW,EAAE,cAAqD,CAAC;AAChF,eAAO,MAAM,qBAAqB,EAAE,cAA+D,CAAC;AACpG,eAAO,MAAM,4BAA4B,EAAE,cACY,CAAC;AACxD,eAAO,MAAM,YAAY,EAAE,cAAsD,CAAC;AAClF,eAAO,MAAM,eAAe,EAAE,cAAyD,CAAC;AACxF,eAAO,MAAM,uBAAuB,EAAE,uBACqB,CAAC;AAC5D,eAAO,MAAM,uBAAuB,EAAE,uBACqB,CAAC;AAC5D,eAAO,MAAM,uBAAuB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OACK,CAAC;AAClE,eAAO,MAAM,2BAA2B,EAAE,MAAM,OACK,CAAC"}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createTemporaryReferenceSet = exports.createClientModuleProxy = exports.registerClientReference = exports.registerServerReference = exports.decodeFormState = exports.decodeAction = exports.decodeReplyFromAsyncIterable = exports.decodeReplyFromBusboy = exports.decodeReply = exports.renderToPipeableStream = exports.renderToReadableStream = void 0;
|
|
3
|
+
exports.createTemporaryReferenceSet = exports.createClientModuleProxy = exports.registerClientReference = exports.registerServerReference = exports.decodeFormState = exports.decodeAction = exports.decodeReplyFromAsyncIterable = exports.decodeReplyFromBusboy = exports.decodeReply = exports.renderToPipeableStream = exports.renderToReadableStream = exports.preloadStyle = exports.preloadScript = exports.preloadImage = exports.preloadFont = exports.preloadAsset = exports.preinitStyle = exports.preinitScript = exports.prefetchDNS = exports.preconnect = void 0;
|
|
4
4
|
const server = require("react-server-dom-webpack/server.node");
|
|
5
5
|
const flight_stylesheet_hints_1 = require("./flight-stylesheet-hints");
|
|
6
|
+
var resource_hints_1 = require("./resource-hints");
|
|
7
|
+
Object.defineProperty(exports, "preconnect", { enumerable: true, get: function () { return resource_hints_1.preconnect; } });
|
|
8
|
+
Object.defineProperty(exports, "prefetchDNS", { enumerable: true, get: function () { return resource_hints_1.prefetchDNS; } });
|
|
9
|
+
Object.defineProperty(exports, "preinitScript", { enumerable: true, get: function () { return resource_hints_1.preinitScript; } });
|
|
10
|
+
Object.defineProperty(exports, "preinitStyle", { enumerable: true, get: function () { return resource_hints_1.preinitStyle; } });
|
|
11
|
+
Object.defineProperty(exports, "preloadAsset", { enumerable: true, get: function () { return resource_hints_1.preloadAsset; } });
|
|
12
|
+
Object.defineProperty(exports, "preloadFont", { enumerable: true, get: function () { return resource_hints_1.preloadFont; } });
|
|
13
|
+
Object.defineProperty(exports, "preloadImage", { enumerable: true, get: function () { return resource_hints_1.preloadImage; } });
|
|
14
|
+
Object.defineProperty(exports, "preloadScript", { enumerable: true, get: function () { return resource_hints_1.preloadScript; } });
|
|
15
|
+
Object.defineProperty(exports, "preloadStyle", { enumerable: true, get: function () { return resource_hints_1.preloadStyle; } });
|
|
6
16
|
const renderToReadableStreamReact = server.renderToReadableStream;
|
|
7
17
|
const renderToPipeableStreamReact = server.renderToPipeableStream;
|
|
8
18
|
const renderToReadableStream = (model, webpackMap, options) => renderToReadableStreamReact(model, (0, flight_stylesheet_hints_1.withStylesheetHints)(webpackMap), options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flight-server.node.js","sourceRoot":"","sources":["../src/flight-server.node.ts"],"names":[],"mappings":";;;AAAA,+DAA+D;AAC/D,uEAAgE;
|
|
1
|
+
{"version":3,"file":"flight-server.node.js","sourceRoot":"","sources":["../src/flight-server.node.ts"],"names":[],"mappings":";;;AAAA,+DAA+D;AAC/D,uEAAgE;AAChE,mDAU0B;AATxB,4GAAA,UAAU,OAAA;AACV,6GAAA,WAAW,OAAA;AACX,+GAAA,aAAa,OAAA;AACb,8GAAA,YAAY,OAAA;AACZ,8GAAA,YAAY,OAAA;AACZ,6GAAA,WAAW,OAAA;AACX,8GAAA,YAAY,OAAA;AACZ,+GAAA,aAAa,OAAA;AACb,8GAAA,YAAY,OAAA;AAwBd,MAAM,2BAA2B,GAAG,MAAM,CAAC,sBAAwC,CAAC;AACpF,MAAM,2BAA2B,GAAG,MAAM,CAAC,sBAAwC,CAAC;AAE7E,MAAM,sBAAsB,GAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CACnF,2BAA2B,CAAC,KAAK,EAAE,IAAA,6CAAmB,EAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC;AADlE,QAAA,sBAAsB,0BAC4C;AACxE,MAAM,sBAAsB,GAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CACnF,2BAA2B,CAAC,KAAK,EAAE,IAAA,6CAAmB,EAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC;AADlE,QAAA,sBAAsB,0BAC4C;AAClE,QAAA,WAAW,GAAmB,MAAM,CAAC,WAA6B,CAAC;AACnE,QAAA,qBAAqB,GAAmB,MAAM,CAAC,qBAAuC,CAAC;AACvF,QAAA,4BAA4B,GACvC,MAAM,CAAC,4BAA8C,CAAC;AAC3C,QAAA,YAAY,GAAmB,MAAM,CAAC,YAA8B,CAAC;AACrE,QAAA,eAAe,GAAmB,MAAM,CAAC,eAAiC,CAAC;AAC3E,QAAA,uBAAuB,GAClC,MAAM,CAAC,uBAAkD,CAAC;AAC/C,QAAA,uBAAuB,GAClC,MAAM,CAAC,uBAAkD,CAAC;AAC/C,QAAA,uBAAuB,GAClC,MAAM,CAAC,uBAAwD,CAAC;AACrD,QAAA,2BAA2B,GACtC,MAAM,CAAC,2BAA4C,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { preconnect, prefetchDNS, preinitScript, preinitStyle, preloadAsset, preloadFont, preloadImage, preloadScript, preloadStyle, } from './resource-hints';
|
|
2
|
+
export type { PreconnectResourceOptions, PreinitScriptOptions, PreinitStyleOptions, PreloadAssetOptions, PreloadFontOptions, PreloadImageOptions, PreloadScriptOptions, PreloadStyleOptions, ResourceHintAs, ResourceHintCrossOrigin, ResourceHintFetchPriority, } from './resource-hints';
|
|
1
3
|
type ServerFunction = (...args: unknown[]) => unknown;
|
|
2
4
|
type RegisterClientReference = (proxyImplementation: unknown, id: string, exportName: string) => unknown;
|
|
3
5
|
type RegisterServerReference = (reference: unknown, id: string, exportName: string) => unknown;
|
|
@@ -12,5 +14,4 @@ export declare const registerServerReference: RegisterServerReference;
|
|
|
12
14
|
export declare const registerClientReference: RegisterClientReference;
|
|
13
15
|
export declare const createClientModuleProxy: (moduleId: string) => unknown;
|
|
14
16
|
export declare const createTemporaryReferenceSet: () => unknown;
|
|
15
|
-
export {};
|
|
16
17
|
//# sourceMappingURL=flight-server.node.unbundled.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flight-server.node.unbundled.d.ts","sourceRoot":"","sources":["../src/flight-server.node.unbundled.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flight-server.node.unbundled.d.ts","sourceRoot":"","sources":["../src/flight-server.node.unbundled.ts"],"names":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strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createTemporaryReferenceSet = exports.createClientModuleProxy = exports.registerClientReference = exports.registerServerReference = exports.decodeFormState = exports.decodeAction = exports.decodeReplyFromAsyncIterable = exports.decodeReplyFromBusboy = exports.decodeReply = exports.renderToPipeableStream = exports.renderToReadableStream = void 0;
|
|
3
|
+
exports.createTemporaryReferenceSet = exports.createClientModuleProxy = exports.registerClientReference = exports.registerServerReference = exports.decodeFormState = exports.decodeAction = exports.decodeReplyFromAsyncIterable = exports.decodeReplyFromBusboy = exports.decodeReply = exports.renderToPipeableStream = exports.renderToReadableStream = exports.preloadStyle = exports.preloadScript = exports.preloadImage = exports.preloadFont = exports.preloadAsset = exports.preinitStyle = exports.preinitScript = exports.prefetchDNS = exports.preconnect = void 0;
|
|
4
4
|
const server = require("react-server-dom-webpack/server.node");
|
|
5
5
|
const flight_stylesheet_hints_1 = require("./flight-stylesheet-hints");
|
|
6
|
+
var resource_hints_1 = require("./resource-hints");
|
|
7
|
+
Object.defineProperty(exports, "preconnect", { enumerable: true, get: function () { return resource_hints_1.preconnect; } });
|
|
8
|
+
Object.defineProperty(exports, "prefetchDNS", { enumerable: true, get: function () { return resource_hints_1.prefetchDNS; } });
|
|
9
|
+
Object.defineProperty(exports, "preinitScript", { enumerable: true, get: function () { return resource_hints_1.preinitScript; } });
|
|
10
|
+
Object.defineProperty(exports, "preinitStyle", { enumerable: true, get: function () { return resource_hints_1.preinitStyle; } });
|
|
11
|
+
Object.defineProperty(exports, "preloadAsset", { enumerable: true, get: function () { return resource_hints_1.preloadAsset; } });
|
|
12
|
+
Object.defineProperty(exports, "preloadFont", { enumerable: true, get: function () { return resource_hints_1.preloadFont; } });
|
|
13
|
+
Object.defineProperty(exports, "preloadImage", { enumerable: true, get: function () { return resource_hints_1.preloadImage; } });
|
|
14
|
+
Object.defineProperty(exports, "preloadScript", { enumerable: true, get: function () { return resource_hints_1.preloadScript; } });
|
|
15
|
+
Object.defineProperty(exports, "preloadStyle", { enumerable: true, get: function () { return resource_hints_1.preloadStyle; } });
|
|
6
16
|
const plainNodeDecodeError = (apiName) => new Error(`${apiName} is not available from react-on-rails-rsc/server in a plain Node ` +
|
|
7
17
|
'react-server process. React 19.2 removed the public unbundled Flight server ' +
|
|
8
18
|
'runtime, so server action/reference decoding now requires a bundler runtime ' +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flight-server.node.unbundled.js","sourceRoot":"","sources":["../src/flight-server.node.unbundled.ts"],"names":[],"mappings":";;;AAAA,+DAA+D;AAC/D,uEAAgE;
|
|
1
|
+
{"version":3,"file":"flight-server.node.unbundled.js","sourceRoot":"","sources":["../src/flight-server.node.unbundled.ts"],"names":[],"mappings":";;;AAAA,+DAA+D;AAC/D,uEAAgE;AAChE,mDAU0B;AATxB,4GAAA,UAAU,OAAA;AACV,6GAAA,WAAW,OAAA;AACX,+GAAA,aAAa,OAAA;AACb,8GAAA,YAAY,OAAA;AACZ,8GAAA,YAAY,OAAA;AACZ,6GAAA,WAAW,OAAA;AACX,8GAAA,YAAY,OAAA;AACZ,+GAAA,aAAa,OAAA;AACb,8GAAA,YAAY,OAAA;AA0Bd,MAAM,oBAAoB,GAAG,CAAC,OAAe,EAAS,EAAE,CACtD,IAAI,KAAK,CACP,GAAG,OAAO,mEAAmE;IAC3E,8EAA8E;IAC9E,8EAA8E;IAC9E,sEAAsE;IACtE,8EAA8E;IAC9E,2CAA2C,CAC9C,CAAC;AAEJ,MAAM,0BAA0B,GAAG,CAAC,OAAe,EAAkB,EAAE;IACrE,OAAO,GAAG,EAAE;QACV,MAAM,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,MAAM,CAAC,sBAAwC,CAAC;AACpF,MAAM,2BAA2B,GAAG,MAAM,CAAC,sBAAwC,CAAC;AAE7E,MAAM,sBAAsB,GAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CACnF,2BAA2B,CAAC,KAAK,EAAE,IAAA,6CAAmB,EAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC;AADlE,QAAA,sBAAsB,0BAC4C;AACxE,MAAM,sBAAsB,GAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CACnF,2BAA2B,CAAC,KAAK,EAAE,IAAA,6CAAmB,EAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC;AADlE,QAAA,sBAAsB,0BAC4C;AAClE,QAAA,WAAW,GAAmB,0BAA0B,CAAC,aAAa,CAAC,CAAC;AACxE,QAAA,qBAAqB,GAChC,0BAA0B,CAAC,uBAAuB,CAAC,CAAC;AACzC,QAAA,4BAA4B,GAAmB,0BAA0B,CACpF,8BAA8B,CAC/B,CAAC;AACW,QAAA,YAAY,GAAmB,0BAA0B,CAAC,cAAc,CAAC,CAAC;AAC1E,QAAA,eAAe,GAAmB,0BAA0B,CAAC,iBAAiB,CAAC,CAAC;AAChF,QAAA,uBAAuB,GAClC,MAAM,CAAC,uBAAkD,CAAC;AAC/C,QAAA,uBAAuB,GAClC,MAAM,CAAC,uBAAkD,CAAC;AAC/C,QAAA,uBAAuB,GAClC,MAAM,CAAC,uBAAwD,CAAC;AACrD,QAAA,2BAA2B,GACtC,MAAM,CAAC,2BAA4C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flight-stylesheet-hints.d.ts","sourceRoot":"","sources":["../src/flight-stylesheet-hints.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flight-stylesheet-hints.d.ts","sourceRoot":"","sources":["../src/flight-stylesheet-hints.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAe5C,eAAO,MAAM,mBAAmB,GAAI,QAAQ,4BAA4B,QAAQ,KAAG,QAYlF,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withStylesheetHints = void 0;
|
|
3
|
+
exports.withStylesheetHints = exports.RSC_CSS_PRECEDENCE = void 0;
|
|
4
4
|
const react_dom_1 = require("react-dom");
|
|
5
|
-
|
|
5
|
+
exports.RSC_CSS_PRECEDENCE = 'rsc-css';
|
|
6
6
|
const preinitStylesheetsForClientReference = (metadata) => {
|
|
7
7
|
if (!metadata || typeof metadata !== 'object')
|
|
8
8
|
return;
|
|
@@ -11,7 +11,7 @@ const preinitStylesheetsForClientReference = (metadata) => {
|
|
|
11
11
|
return;
|
|
12
12
|
for (const href of css) {
|
|
13
13
|
if (typeof href === 'string') {
|
|
14
|
-
(0, react_dom_1.preinit)(href, { as: 'style', precedence: RSC_CSS_PRECEDENCE });
|
|
14
|
+
(0, react_dom_1.preinit)(href, { as: 'style', precedence: exports.RSC_CSS_PRECEDENCE });
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flight-stylesheet-hints.js","sourceRoot":"","sources":["../src/flight-stylesheet-hints.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;
|
|
1
|
+
{"version":3,"file":"flight-stylesheet-hints.js","sourceRoot":"","sources":["../src/flight-stylesheet-hints.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAEvB,QAAA,kBAAkB,GAAG,SAAS,CAAC;AAE5C,MAAM,oCAAoC,GAAG,CAAC,QAAiB,EAAE,EAAE;IACjE,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO;IAEtD,MAAM,GAAG,GAAI,QAA8B,CAAC,GAAG,CAAC;IAChD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO;IAEhC,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE,CAAC;QACvB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,IAAA,mBAAO,EAAC,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,0BAAkB,EAAE,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEK,MAAM,mBAAmB,GAAG,CAAW,wBAAkC,EAAY,EAAE;IAC5F,IAAI,CAAC,wBAAwB,IAAI,OAAO,wBAAwB,KAAK,QAAQ,EAAE,CAAC;QAC9E,OAAO,wBAAwB,CAAC;IAClC,CAAC;IAED,OAAO,IAAI,KAAK,CAAC,wBAAkC,EAAE;QACnD,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ;YAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;YACtD,oCAAoC,CAAC,KAAK,CAAC,CAAC;YAC5C,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAa,CAAC;AACjB,CAAC,CAAC;AAZW,QAAA,mBAAmB,uBAY9B"}
|
|
@@ -9,14 +9,24 @@
|
|
|
9
9
|
* AsyncDependenciesBlock from JS, so dynamic imports are the only way to
|
|
10
10
|
* create proper async chunks.
|
|
11
11
|
*
|
|
12
|
-
* The loader reads the discovered file list from
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* The loader reads the discovered file list from state keyed by its compiler.
|
|
13
|
+
* A Shakapacker RSC build can run client and server compilers in the same Node
|
|
14
|
+
* process, so process-global state would make the last compiler win.
|
|
15
15
|
*/
|
|
16
16
|
import type { LoaderDefinition } from 'webpack';
|
|
17
17
|
export declare let _discoveredClientFiles: string[];
|
|
18
18
|
export declare let _chunkName: string;
|
|
19
19
|
export declare let _generatedChunkNames: Set<string>;
|
|
20
|
+
type CompilerKey = object;
|
|
21
|
+
export type InjectionState = {
|
|
22
|
+
discoveredClientFiles: string[];
|
|
23
|
+
chunkName: string;
|
|
24
|
+
generatedChunkNames: Set<string>;
|
|
25
|
+
};
|
|
26
|
+
export declare function setInjectionStateForCompiler(compiler: CompilerKey, discoveredClientFiles: string[], chunkName: string): void;
|
|
27
|
+
export declare function getInjectionStateForCompiler(compiler: CompilerKey | undefined): InjectionState;
|
|
28
|
+
export declare function setGeneratedChunkNamesForCompiler(compiler: CompilerKey | undefined, generatedChunkNames: Iterable<string>): void;
|
|
29
|
+
export declare function getGeneratedChunkNamesForCompiler(compiler: CompilerKey | undefined): Set<string>;
|
|
20
30
|
declare const InjectionLoader: LoaderDefinition;
|
|
21
31
|
export default InjectionLoader;
|
|
22
32
|
//# sourceMappingURL=injection-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injection-loader.d.ts","sourceRoot":"","sources":["../../src/react-server-dom-rspack/injection-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"injection-loader.d.ts","sourceRoot":"","sources":["../../src/react-server-dom-rspack/injection-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,eAAO,IAAI,sBAAsB,EAAE,MAAM,EAAO,CAAC;AACjD,eAAO,IAAI,UAAU,QAAkB,CAAC;AACxC,eAAO,IAAI,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAa,CAAC;AAEzD,KAAK,WAAW,GAAG,MAAM,CAAC;AAE1B,MAAM,MAAM,cAAc,GAAG;IAC3B,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAClC,CAAC;AAkBF,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,WAAW,EACrB,qBAAqB,EAAE,MAAM,EAAE,EAC/B,SAAS,EAAE,MAAM,GAChB,IAAI,CAWN;AAED,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,WAAW,GAAG,SAAS,GAChC,cAAc,CAGhB;AAKD,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,GACpC,IAAI,CAoBN;AAED,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,WAAW,GAAG,SAAS,GAChC,GAAG,CAAC,MAAM,CAAC,CAEb;AAED,QAAA,MAAM,eAAe,EAAE,gBAiDtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -10,27 +10,108 @@
|
|
|
10
10
|
* AsyncDependenciesBlock from JS, so dynamic imports are the only way to
|
|
11
11
|
* create proper async chunks.
|
|
12
12
|
*
|
|
13
|
-
* The loader reads the discovered file list from
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* The loader reads the discovered file list from state keyed by its compiler.
|
|
14
|
+
* A Shakapacker RSC build can run client and server compilers in the same Node
|
|
15
|
+
* process, so process-global state would make the last compiler win.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports._generatedChunkNames = exports._chunkName = exports._discoveredClientFiles = void 0;
|
|
19
|
+
exports.setInjectionStateForCompiler = setInjectionStateForCompiler;
|
|
20
|
+
exports.getInjectionStateForCompiler = getInjectionStateForCompiler;
|
|
21
|
+
exports.setGeneratedChunkNamesForCompiler = setGeneratedChunkNamesForCompiler;
|
|
22
|
+
exports.getGeneratedChunkNamesForCompiler = getGeneratedChunkNamesForCompiler;
|
|
23
|
+
const shared_1 = require("./shared");
|
|
19
24
|
exports._discoveredClientFiles = [];
|
|
20
25
|
exports._chunkName = 'client[index]';
|
|
21
26
|
exports._generatedChunkNames = new Set();
|
|
27
|
+
const compilerInjectionState = new WeakMap();
|
|
28
|
+
const warnedMissingCompilerState = new WeakSet();
|
|
29
|
+
let warnedMissingCompilerContext = false;
|
|
30
|
+
const emptyInjectionState = () => ({
|
|
31
|
+
discoveredClientFiles: [],
|
|
32
|
+
chunkName: exports._chunkName,
|
|
33
|
+
generatedChunkNames: new Set(),
|
|
34
|
+
});
|
|
35
|
+
const fallbackInjectionState = () => ({
|
|
36
|
+
discoveredClientFiles: exports._discoveredClientFiles,
|
|
37
|
+
chunkName: exports._chunkName,
|
|
38
|
+
generatedChunkNames: exports._generatedChunkNames,
|
|
39
|
+
});
|
|
40
|
+
function setInjectionStateForCompiler(compiler, discoveredClientFiles, chunkName) {
|
|
41
|
+
const nextDiscoveredClientFiles = discoveredClientFiles.slice();
|
|
42
|
+
exports._discoveredClientFiles = nextDiscoveredClientFiles;
|
|
43
|
+
exports._chunkName = chunkName;
|
|
44
|
+
exports._generatedChunkNames = new Set();
|
|
45
|
+
compilerInjectionState.set(compiler, {
|
|
46
|
+
discoveredClientFiles: nextDiscoveredClientFiles,
|
|
47
|
+
chunkName,
|
|
48
|
+
generatedChunkNames: new Set(),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function getInjectionStateForCompiler(compiler) {
|
|
52
|
+
if (!compiler)
|
|
53
|
+
return fallbackInjectionState();
|
|
54
|
+
return compilerInjectionState.get(compiler) ?? emptyInjectionState();
|
|
55
|
+
}
|
|
56
|
+
const hasInjectionStateForCompiler = (compiler) => compilerInjectionState.has(compiler);
|
|
57
|
+
function setGeneratedChunkNamesForCompiler(compiler, generatedChunkNames) {
|
|
58
|
+
const nextGeneratedChunkNames = new Set(generatedChunkNames);
|
|
59
|
+
if (!compiler) {
|
|
60
|
+
exports._generatedChunkNames = nextGeneratedChunkNames;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const state = compilerInjectionState.get(compiler);
|
|
64
|
+
if (state) {
|
|
65
|
+
state.generatedChunkNames = nextGeneratedChunkNames;
|
|
66
|
+
exports._generatedChunkNames = nextGeneratedChunkNames;
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
exports._generatedChunkNames = nextGeneratedChunkNames;
|
|
70
|
+
compilerInjectionState.set(compiler, {
|
|
71
|
+
discoveredClientFiles: [],
|
|
72
|
+
chunkName: exports._chunkName,
|
|
73
|
+
generatedChunkNames: nextGeneratedChunkNames,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function getGeneratedChunkNamesForCompiler(compiler) {
|
|
77
|
+
return getInjectionStateForCompiler(compiler).generatedChunkNames;
|
|
78
|
+
}
|
|
22
79
|
const InjectionLoader = function InjectionLoader(source) {
|
|
23
|
-
|
|
80
|
+
// The injected import list comes from the plugin's latest FS walk, not from
|
|
81
|
+
// the runtime file itself. Re-run on every watch rebuild so added/removed
|
|
82
|
+
// client references refresh the runtime module instead of reusing stale
|
|
83
|
+
// loader output.
|
|
84
|
+
this.cacheable(false);
|
|
85
|
+
// Rspack follows webpack's loader-context convention here: `_compiler` is
|
|
86
|
+
// the same Compiler object passed to plugin.apply(). The MultiCompiler
|
|
87
|
+
// integration test exercises that identity against real rspack compilers.
|
|
88
|
+
const compiler = this._compiler;
|
|
89
|
+
const emitWarning = this
|
|
90
|
+
.emitWarning;
|
|
91
|
+
if (!compiler) {
|
|
92
|
+
if (!warnedMissingCompilerContext && emitWarning) {
|
|
93
|
+
warnedMissingCompilerContext = true;
|
|
94
|
+
emitWarning(new Error('RSCRspackPlugin injection loader ran without a compiler context; ' +
|
|
95
|
+
'falling back to the latest legacy injection state.'));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else if (!hasInjectionStateForCompiler(compiler) && !warnedMissingCompilerState.has(compiler)) {
|
|
99
|
+
warnedMissingCompilerState.add(compiler);
|
|
100
|
+
emitWarning?.(new Error('RSCRspackPlugin injection loader received an unknown compiler context; ' +
|
|
101
|
+
'client reference imports were not injected for this loader run.'));
|
|
102
|
+
}
|
|
103
|
+
const { discoveredClientFiles, chunkName } = getInjectionStateForCompiler(compiler);
|
|
104
|
+
if (!discoveredClientFiles.length) {
|
|
105
|
+
setGeneratedChunkNamesForCompiler(compiler, []);
|
|
24
106
|
return source;
|
|
107
|
+
}
|
|
25
108
|
const names = [];
|
|
26
|
-
const imports =
|
|
27
|
-
const name =
|
|
28
|
-
.replace(/\[index\]/g, String(i))
|
|
29
|
-
.replace(/\[request\]/g, file.replace(/[^a-zA-Z0-9_]/g, '_'));
|
|
109
|
+
const imports = discoveredClientFiles.map((file, i) => {
|
|
110
|
+
const name = (0, shared_1.getGeneratedChunkName)(chunkName, file, i);
|
|
30
111
|
names.push(name);
|
|
31
112
|
return `import(/* webpackChunkName: ${JSON.stringify(name)} */ ${JSON.stringify(file)});`;
|
|
32
113
|
});
|
|
33
|
-
|
|
114
|
+
setGeneratedChunkNamesForCompiler(compiler, names);
|
|
34
115
|
return imports.join('\n') + '\n' + source;
|
|
35
116
|
};
|
|
36
117
|
exports.default = InjectionLoader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injection-loader.js","sourceRoot":"","sources":["../../src/react-server-dom-rspack/injection-loader.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;
|
|
1
|
+
{"version":3,"file":"injection-loader.js","sourceRoot":"","sources":["../../src/react-server-dom-rspack/injection-loader.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAiCH,oEAeC;AAED,oEAKC;AAKD,8EAuBC;AAED,8EAIC;AAtFD,qCAAiD;AAEtC,QAAA,sBAAsB,GAAa,EAAE,CAAC;AACtC,QAAA,UAAU,GAAG,eAAe,CAAC;AAC7B,QAAA,oBAAoB,GAAgB,IAAI,GAAG,EAAE,CAAC;AAUzD,MAAM,sBAAsB,GAAG,IAAI,OAAO,EAA+B,CAAC;AAC1E,MAAM,0BAA0B,GAAG,IAAI,OAAO,EAAe,CAAC;AAC9D,IAAI,4BAA4B,GAAG,KAAK,CAAC;AAEzC,MAAM,mBAAmB,GAAG,GAAmB,EAAE,CAAC,CAAC;IACjD,qBAAqB,EAAE,EAAE;IACzB,SA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