react-server-dom-webpack 18.3.0-next-ee8509801-20230117 → 18.3.0-next-8b9ac8175-20230131
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/cjs/react-server-dom-webpack-client.development.js +2 -2
- package/cjs/react-server-dom-webpack-node-register.js +177 -37
- package/cjs/react-server-dom-webpack-server.browser.development.js +27 -17
- package/cjs/react-server-dom-webpack-server.browser.production.min.js +2 -2
- package/cjs/react-server-dom-webpack-server.node.development.js +30 -20
- package/cjs/react-server-dom-webpack-server.node.production.min.js +2 -2
- package/esm/react-server-dom-webpack-node-loader.js +11 -6
- package/package.json +3 -3
- package/umd/react-server-dom-webpack-client.development.js +2 -2
- package/umd/react-server-dom-webpack-server.browser.development.js +27 -17
- package/umd/react-server-dom-webpack-server.browser.production.min.js +4 -4
@@ -34,7 +34,7 @@ function parseModel(response, json) {
|
|
34
34
|
}
|
35
35
|
|
36
36
|
// eslint-disable-next-line no-unused-vars
|
37
|
-
function
|
37
|
+
function resolveClientReference(bundlerConfig, moduleData) {
|
38
38
|
if (bundlerConfig) {
|
39
39
|
var resolvedModuleData = bundlerConfig[moduleData.id][moduleData.name];
|
40
40
|
|
@@ -636,7 +636,7 @@ function resolveModule(response, id, model) {
|
|
636
636
|
var chunks = response._chunks;
|
637
637
|
var chunk = chunks.get(id);
|
638
638
|
var moduleMetaData = parseModel(response, model);
|
639
|
-
var moduleReference =
|
639
|
+
var moduleReference = resolveClientReference(response._bundlerConfig, moduleMetaData); // TODO: Add an option to encode modules that are lazy loaded.
|
640
640
|
// For now we preload all modules as early as possible since it's likely
|
641
641
|
// that we'll need them.
|
642
642
|
|
@@ -17,8 +17,70 @@ var url = require('url');
|
|
17
17
|
var Module = require('module');
|
18
18
|
|
19
19
|
module.exports = function register() {
|
20
|
-
var
|
20
|
+
var CLIENT_REFERENCE = Symbol.for('react.client.reference');
|
21
21
|
var PROMISE_PROTOTYPE = Promise.prototype;
|
22
|
+
var deepProxyHandlers = {
|
23
|
+
get: function (target, name, receiver) {
|
24
|
+
switch (name) {
|
25
|
+
// These names are read by the Flight runtime if you end up using the exports object.
|
26
|
+
case '$$typeof':
|
27
|
+
// These names are a little too common. We should probably have a way to
|
28
|
+
// have the Flight runtime extract the inner target instead.
|
29
|
+
return target.$$typeof;
|
30
|
+
|
31
|
+
case 'filepath':
|
32
|
+
return target.filepath;
|
33
|
+
|
34
|
+
case 'name':
|
35
|
+
return target.name;
|
36
|
+
|
37
|
+
case 'async':
|
38
|
+
return target.async;
|
39
|
+
// We need to special case this because createElement reads it if we pass this
|
40
|
+
// reference.
|
41
|
+
|
42
|
+
case 'defaultProps':
|
43
|
+
return undefined;
|
44
|
+
|
45
|
+
case 'getDefaultProps':
|
46
|
+
return undefined;
|
47
|
+
// Avoid this attempting to be serialized.
|
48
|
+
|
49
|
+
case 'toJSON':
|
50
|
+
return undefined;
|
51
|
+
|
52
|
+
case Symbol.toPrimitive:
|
53
|
+
// $FlowFixMe[prop-missing]
|
54
|
+
return Object.prototype[Symbol.toPrimitive];
|
55
|
+
|
56
|
+
case 'Provider':
|
57
|
+
throw new Error("Cannot render a Client Context Provider on the Server. " + "Instead, you can export a Client Component wrapper " + "that itself renders a Client Context Provider.");
|
58
|
+
}
|
59
|
+
|
60
|
+
var expression;
|
61
|
+
|
62
|
+
switch (target.name) {
|
63
|
+
case '':
|
64
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
65
|
+
expression = String(name);
|
66
|
+
break;
|
67
|
+
|
68
|
+
case '*':
|
69
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
70
|
+
expression = String(name);
|
71
|
+
break;
|
72
|
+
|
73
|
+
default:
|
74
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
75
|
+
expression = String(target.name) + '.' + String(name);
|
76
|
+
}
|
77
|
+
|
78
|
+
throw new Error("Cannot access " + expression + " on the server. " + 'You cannot dot into a client module from a server component. ' + 'You can only pass the imported name through.');
|
79
|
+
},
|
80
|
+
set: function () {
|
81
|
+
throw new Error('Cannot assign to a client module from a server module.');
|
82
|
+
}
|
83
|
+
};
|
22
84
|
var proxyHandlers = {
|
23
85
|
get: function (target, name, receiver) {
|
24
86
|
switch (name) {
|
@@ -42,44 +104,100 @@ module.exports = function register() {
|
|
42
104
|
case 'defaultProps':
|
43
105
|
return undefined;
|
44
106
|
|
107
|
+
case 'getDefaultProps':
|
108
|
+
return undefined;
|
109
|
+
// Avoid this attempting to be serialized.
|
110
|
+
|
111
|
+
case 'toJSON':
|
112
|
+
return undefined;
|
113
|
+
|
114
|
+
case Symbol.toPrimitive:
|
115
|
+
// $FlowFixMe[prop-missing]
|
116
|
+
return Object.prototype[Symbol.toPrimitive];
|
117
|
+
|
45
118
|
case '__esModule':
|
46
119
|
// Something is conditionally checking which export to use. We'll pretend to be
|
47
120
|
// an ESM compat module but then we'll check again on the client.
|
48
|
-
|
49
|
-
|
50
|
-
|
121
|
+
var moduleId = target.filepath;
|
122
|
+
target.default = Object.defineProperties(function () {
|
123
|
+
throw new Error("Attempted to call the default export of " + moduleId + " from the server" + "but it's on the client. It's not possible to invoke a client function from " + "the server, it can only be rendered as a Component or passed to props of a" + "Client Component.");
|
124
|
+
}, {
|
51
125
|
// This a placeholder value that tells the client to conditionally use the
|
52
126
|
// whole object or just the default export.
|
53
|
-
name:
|
54
|
-
|
55
|
-
|
127
|
+
name: {
|
128
|
+
value: ''
|
129
|
+
},
|
130
|
+
$$typeof: {
|
131
|
+
value: CLIENT_REFERENCE
|
132
|
+
},
|
133
|
+
filepath: {
|
134
|
+
value: target.filepath
|
135
|
+
},
|
136
|
+
async: {
|
137
|
+
value: target.async
|
138
|
+
}
|
139
|
+
});
|
56
140
|
return true;
|
57
141
|
|
58
142
|
case 'then':
|
143
|
+
if (target.then) {
|
144
|
+
// Use a cached value
|
145
|
+
return target.then;
|
146
|
+
}
|
147
|
+
|
59
148
|
if (!target.async) {
|
60
149
|
// If this module is expected to return a Promise (such as an AsyncModule) then
|
61
150
|
// we should resolve that with a client reference that unwraps the Promise on
|
62
151
|
// the client.
|
63
|
-
|
64
|
-
var
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
152
|
+
var innerModuleId = target.filepath;
|
153
|
+
var clientReference = Object.defineProperties(function () {
|
154
|
+
throw new Error("Attempted to call the module exports of " + innerModuleId + " from the server" + "but it's on the client. It's not possible to invoke a client function from " + "the server, it can only be rendered as a Component or passed to props of a" + "Client Component.");
|
155
|
+
}, {
|
156
|
+
// Represents the whole object instead of a particular import.
|
157
|
+
name: {
|
158
|
+
value: '*'
|
159
|
+
},
|
160
|
+
$$typeof: {
|
161
|
+
value: CLIENT_REFERENCE
|
162
|
+
},
|
163
|
+
filepath: {
|
164
|
+
value: target.filepath
|
165
|
+
},
|
166
|
+
async: {
|
167
|
+
value: true
|
168
|
+
}
|
169
|
+
});
|
170
|
+
var proxy = new Proxy(clientReference, proxyHandlers); // Treat this as a resolved Promise for React's use()
|
77
171
|
|
78
|
-
|
79
|
-
|
80
|
-
// This will break if it's minified though.
|
172
|
+
target.status = 'fulfilled';
|
173
|
+
target.value = proxy; // $FlowFixMe[missing-local-annot]
|
81
174
|
|
175
|
+
var then = target.then = Object.defineProperties(function then(resolve, reject) {
|
176
|
+
// Expose to React.
|
177
|
+
return Promise.resolve( // $FlowFixMe[incompatible-call] found when upgrading Flow
|
178
|
+
resolve(proxy));
|
179
|
+
}, // If this is not used as a Promise but is treated as a reference to a `.then`
|
180
|
+
// export then we should treat it as a reference to that name.
|
181
|
+
{
|
182
|
+
name: {
|
183
|
+
value: 'then'
|
184
|
+
},
|
185
|
+
$$typeof: {
|
186
|
+
value: CLIENT_REFERENCE
|
187
|
+
},
|
188
|
+
filepath: {
|
189
|
+
value: target.filepath
|
190
|
+
},
|
191
|
+
async: {
|
192
|
+
value: false
|
193
|
+
}
|
194
|
+
});
|
82
195
|
return then;
|
196
|
+
} else {
|
197
|
+
// Since typeof .then === 'function' is a feature test we'd continue recursing
|
198
|
+
// indefinitely if we return a function. Instead, we return an object reference
|
199
|
+
// if we check further.
|
200
|
+
return undefined;
|
83
201
|
}
|
84
202
|
|
85
203
|
}
|
@@ -87,12 +205,24 @@ module.exports = function register() {
|
|
87
205
|
var cachedReference = target[name];
|
88
206
|
|
89
207
|
if (!cachedReference) {
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
208
|
+
var reference = Object.defineProperties(function () {
|
209
|
+
throw new Error( // eslint-disable-next-line react-internal/safe-string-coercion
|
210
|
+
"Attempted to call " + String(name) + "() from the server but " + String(name) + " is on the client. " + "It's not possible to invoke a client function from the server, it can " + "only be rendered as a Component or passed to props of a Client Component.");
|
211
|
+
}, {
|
212
|
+
name: {
|
213
|
+
value: name
|
214
|
+
},
|
215
|
+
$$typeof: {
|
216
|
+
value: CLIENT_REFERENCE
|
217
|
+
},
|
218
|
+
filepath: {
|
219
|
+
value: target.filepath
|
220
|
+
},
|
221
|
+
async: {
|
222
|
+
value: target.async
|
223
|
+
}
|
224
|
+
});
|
225
|
+
cachedReference = target[name] = new Proxy(reference, deepProxyHandlers);
|
96
226
|
}
|
97
227
|
|
98
228
|
return cachedReference;
|
@@ -108,15 +238,25 @@ module.exports = function register() {
|
|
108
238
|
|
109
239
|
Module._extensions['.client.js'] = function (module, path) {
|
110
240
|
var moduleId = url.pathToFileURL(path).href;
|
111
|
-
var
|
112
|
-
|
113
|
-
|
114
|
-
name: '*',
|
241
|
+
var clientReference = Object.defineProperties(function () {
|
242
|
+
throw new Error("Attempted to call the module exports of " + moduleId + " from the server" + "but it's on the client. It's not possible to invoke a client function from " + "the server, it can only be rendered as a Component or passed to props of a" + "Client Component.");
|
243
|
+
}, {
|
115
244
|
// Represents the whole object instead of a particular import.
|
116
|
-
|
117
|
-
|
245
|
+
name: {
|
246
|
+
value: '*'
|
247
|
+
},
|
248
|
+
$$typeof: {
|
249
|
+
value: CLIENT_REFERENCE
|
250
|
+
},
|
251
|
+
filepath: {
|
252
|
+
value: moduleId
|
253
|
+
},
|
254
|
+
async: {
|
255
|
+
value: false
|
256
|
+
}
|
257
|
+
}); // $FlowFixMe[incompatible-call] found when upgrading Flow
|
118
258
|
|
119
|
-
module.exports = new Proxy(
|
259
|
+
module.exports = new Proxy(clientReference, proxyHandlers);
|
120
260
|
}; // $FlowFixMe[prop-missing] found when upgrading Flow
|
121
261
|
|
122
262
|
|
@@ -220,17 +220,17 @@ function processSymbolChunk(request, id, name) {
|
|
220
220
|
}
|
221
221
|
|
222
222
|
// eslint-disable-next-line no-unused-vars
|
223
|
-
var
|
224
|
-
function
|
223
|
+
var CLIENT_REFERENCE_TAG = Symbol.for('react.client.reference');
|
224
|
+
function getClientReferenceKey(reference) {
|
225
225
|
return reference.filepath + '#' + reference.name + (reference.async ? '#async' : '');
|
226
226
|
}
|
227
|
-
function
|
228
|
-
return reference.$$typeof ===
|
227
|
+
function isClientReference(reference) {
|
228
|
+
return reference.$$typeof === CLIENT_REFERENCE_TAG;
|
229
229
|
}
|
230
|
-
function resolveModuleMetaData(config,
|
231
|
-
var resolvedModuleData = config[
|
230
|
+
function resolveModuleMetaData(config, clientReference) {
|
231
|
+
var resolvedModuleData = config[clientReference.filepath][clientReference.name];
|
232
232
|
|
233
|
-
if (
|
233
|
+
if (clientReference.async) {
|
234
234
|
return {
|
235
235
|
id: resolvedModuleData.id,
|
236
236
|
chunks: resolvedModuleData.chunks,
|
@@ -1005,7 +1005,11 @@ function getThenableStateAfterSuspending() {
|
|
1005
1005
|
function readContext$1(context) {
|
1006
1006
|
{
|
1007
1007
|
if (context.$$typeof !== REACT_SERVER_CONTEXT_TYPE) {
|
1008
|
-
|
1008
|
+
if (isClientReference(context)) {
|
1009
|
+
error('Cannot read a Client Context from a Server Component.');
|
1010
|
+
} else {
|
1011
|
+
error('Only createServerContext is supported in Server Components.');
|
1012
|
+
}
|
1009
1013
|
}
|
1010
1014
|
|
1011
1015
|
if (currentRequest === null) {
|
@@ -1072,7 +1076,7 @@ function useId() {
|
|
1072
1076
|
}
|
1073
1077
|
|
1074
1078
|
function use(usable) {
|
1075
|
-
if (usable !== null && typeof usable === 'object') {
|
1079
|
+
if (usable !== null && typeof usable === 'object' || typeof usable === 'function') {
|
1076
1080
|
// $FlowFixMe[method-unbinding]
|
1077
1081
|
if (typeof usable.then === 'function') {
|
1078
1082
|
// This is a thenable.
|
@@ -1090,6 +1094,12 @@ function use(usable) {
|
|
1090
1094
|
var context = usable;
|
1091
1095
|
return readContext$1(context);
|
1092
1096
|
}
|
1097
|
+
}
|
1098
|
+
|
1099
|
+
{
|
1100
|
+
if (isClientReference(usable)) {
|
1101
|
+
error('Cannot use() an already resolved Client Reference.');
|
1102
|
+
}
|
1093
1103
|
} // eslint-disable-next-line react-internal/safe-string-coercion
|
1094
1104
|
|
1095
1105
|
|
@@ -1294,7 +1304,7 @@ function attemptResolveElement(type, key, ref, props, prevThenableState) {
|
|
1294
1304
|
}
|
1295
1305
|
|
1296
1306
|
if (typeof type === 'function') {
|
1297
|
-
if (
|
1307
|
+
if (isClientReference(type)) {
|
1298
1308
|
// This is a reference to a Client Component.
|
1299
1309
|
return [REACT_ELEMENT_TYPE, type, key, props];
|
1300
1310
|
} // This is a server-side component.
|
@@ -1324,7 +1334,7 @@ function attemptResolveElement(type, key, ref, props, prevThenableState) {
|
|
1324
1334
|
|
1325
1335
|
return [REACT_ELEMENT_TYPE, type, key, props];
|
1326
1336
|
} else if (type != null && typeof type === 'object') {
|
1327
|
-
if (
|
1337
|
+
if (isClientReference(type)) {
|
1328
1338
|
// This is a reference to a Client Component.
|
1329
1339
|
return [REACT_ELEMENT_TYPE, type, key, props];
|
1330
1340
|
}
|
@@ -1416,8 +1426,8 @@ function serializeByRefID(id) {
|
|
1416
1426
|
return '@' + id.toString(16);
|
1417
1427
|
}
|
1418
1428
|
|
1419
|
-
function
|
1420
|
-
var moduleKey =
|
1429
|
+
function serializeClientReference(request, parent, key, moduleReference) {
|
1430
|
+
var moduleKey = getClientReferenceKey(moduleReference);
|
1421
1431
|
var writtenModules = request.writtenModules;
|
1422
1432
|
var existingId = writtenModules.get(moduleKey);
|
1423
1433
|
|
@@ -1895,8 +1905,8 @@ function resolveModelToJSON(request, parent, key, value) {
|
|
1895
1905
|
}
|
1896
1906
|
|
1897
1907
|
if (typeof value === 'object') {
|
1898
|
-
if (
|
1899
|
-
return
|
1908
|
+
if (isClientReference(value)) {
|
1909
|
+
return serializeClientReference(request, parent, key, value);
|
1900
1910
|
} else if (value.$$typeof === REACT_PROVIDER_TYPE) {
|
1901
1911
|
var providerKey = value._context._globalName;
|
1902
1912
|
var writtenProviders = request.writtenProviders;
|
@@ -1951,8 +1961,8 @@ function resolveModelToJSON(request, parent, key, value) {
|
|
1951
1961
|
}
|
1952
1962
|
|
1953
1963
|
if (typeof value === 'function') {
|
1954
|
-
if (
|
1955
|
-
return
|
1964
|
+
if (isClientReference(value)) {
|
1965
|
+
return serializeClientReference(request, parent, key, value);
|
1956
1966
|
}
|
1957
1967
|
|
1958
1968
|
if (/^on[A-Z]/.test(key)) {
|
@@ -8,7 +8,7 @@
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
10
|
'use strict';var ea=require("react");var e="function"===typeof AsyncLocalStorage,fa=e?new AsyncLocalStorage:null,m=null,n=0;function p(a,b){if(0!==b.length)if(512<b.length)0<n&&(a.enqueue(new Uint8Array(m.buffer,0,n)),m=new Uint8Array(512),n=0),a.enqueue(b);else{var d=m.length-n;d<b.length&&(0===d?a.enqueue(m):(m.set(b.subarray(0,d),n),a.enqueue(m),b=b.subarray(d)),m=new Uint8Array(512),n=0);m.set(b,n);n+=b.length}return!0}var q=new TextEncoder;
|
11
|
-
function r(a){return q.encode(a)}function ha(a,b){"function"===typeof a.error?a.error(b):a.close()}var t=JSON.stringify,u=Symbol.for("react.
|
11
|
+
function r(a){return q.encode(a)}function ha(a,b){"function"===typeof a.error?a.error(b):a.close()}var t=JSON.stringify,u=Symbol.for("react.client.reference"),v=Symbol.for("react.element"),ia=Symbol.for("react.fragment"),ja=Symbol.for("react.provider"),ka=Symbol.for("react.server_context"),la=Symbol.for("react.forward_ref"),ma=Symbol.for("react.suspense"),na=Symbol.for("react.suspense_list"),oa=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),pa=Symbol.for("react.default_value"),qa=Symbol.for("react.memo_cache_sentinel");
|
12
12
|
function x(a,b,d,c,f,g,h){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=c;this.attributeNamespace=f;this.mustUseProperty=d;this.propertyName=a;this.type=b;this.sanitizeURL=g;this.removeEmptyString=h}"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){new x(a,0,!1,a,null,!1,!1)});
|
13
13
|
[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){new x(a[0],1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){new x(a,2,!1,a.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){new x(a,2,!1,a,null,!1,!1)});
|
14
14
|
"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){new x(a,3,!1,a.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(a){new x(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){new x(a,4,!1,a,null,!1,!1)});
|
@@ -31,7 +31,7 @@ function ya(){}function za(a,b,d){d=a[d];void 0===d?a.push(b):d!==b&&(b.then(ya,
|
|
31
31
|
function Aa(){if(null===I)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var a=I;I=null;return a}var J=null,K=0,L=null;function Ba(){var a=L;L=null;return a}function Ca(a){return a._currentValue}
|
32
32
|
var Ha={useMemo:function(a){return a()},useCallback:function(a){return a},useDebugValue:function(){},useDeferredValue:M,useTransition:M,readContext:Ca,useContext:Ca,useReducer:M,useRef:M,useState:M,useInsertionEffect:M,useLayoutEffect:M,useImperativeHandle:M,useEffect:M,useId:Da,useMutableSource:M,useSyncExternalStore:M,useCacheRefresh:function(){return Fa},useMemoCache:function(a){for(var b=Array(a),d=0;d<a;d++)b[d]=qa;return b},use:Ga};
|
33
33
|
function M(){throw Error("This Hook is not supported in Server Components.");}function Fa(){throw Error("Refreshing the cache is not supported in Server Components.");}function Da(){if(null===J)throw Error("useId can only be used while React is rendering");var a=J.identifierCount++;return":"+J.identifierPrefix+"S"+a.toString(32)+":"}
|
34
|
-
function Ga(a){if(null!==a&&"object"===typeof a){if("function"===typeof a.then){var b=K;K+=1;null===L&&(L=[]);return za(L,a,b)}if(a.$$typeof===ka)return a._currentValue}throw Error("An unsupported type was passed to use(): "+String(a));}function N(){return(new AbortController).signal}function Ia(){if(O)return O;if(e){var a=fa.getStore();if(a)return a}return new Map}
|
34
|
+
function Ga(a){if(null!==a&&"object"===typeof a||"function"===typeof a){if("function"===typeof a.then){var b=K;K+=1;null===L&&(L=[]);return za(L,a,b)}if(a.$$typeof===ka)return a._currentValue}throw Error("An unsupported type was passed to use(): "+String(a));}function N(){return(new AbortController).signal}function Ia(){if(O)return O;if(e){var a=fa.getStore();if(a)return a}return new Map}
|
35
35
|
var Ja={getCacheSignal:function(){var a=Ia(),b=a.get(N);void 0===b&&(b=N(),a.set(N,b));return b},getCacheForType:function(a){var b=Ia(),d=b.get(a);void 0===d&&(d=a(),b.set(a,d));return d}},O=null,P=ea.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Q=P.ContextRegistry,R=P.ReactCurrentDispatcher,S=P.ReactCurrentCache;function Ka(a){console.error(a)}
|
36
36
|
function La(a,b,d,c,f){if(null!==S.current&&S.current!==Ja)throw Error("Currently React only supports one RSC renderer at a time.");S.current=Ja;var g=new Set,h=[],k={status:0,fatalError:null,destination:null,bundlerConfig:b,cache:new Map,nextChunkId:0,pendingChunks:0,abortableTasks:g,pingedTasks:h,completedModuleChunks:[],completedJSONChunks:[],completedErrorChunks:[],writtenSymbols:new Map,writtenModules:new Map,writtenProviders:new Map,identifierPrefix:f||"",identifierCount:1,onError:void 0===
|
37
37
|
d?Ka:d,toJSON:function(a,b){return Ma(k,this,a,b)}};k.pendingChunks++;b=Na(c);a=Oa(k,a,b,g);h.push(a);return k}var Pa={};function Qa(a){if("fulfilled"===a.status)return a.value;if("rejected"===a.status)throw a.reason;throw a;}
|
@@ -112,9 +112,9 @@ function writeStringChunk(destination, stringChunk) {
|
|
112
112
|
|
113
113
|
if (read < stringChunk.length) {
|
114
114
|
writeToDestination(destination, currentView);
|
115
|
-
currentView = new Uint8Array(VIEW_SIZE);
|
116
|
-
|
117
|
-
|
115
|
+
currentView = new Uint8Array(VIEW_SIZE);
|
116
|
+
writtenBytes = textEncoder.encodeInto(stringChunk.slice(read), // $FlowFixMe[incompatible-call] found when upgrading Flow
|
117
|
+
currentView).written;
|
118
118
|
}
|
119
119
|
|
120
120
|
if (writtenBytes === VIEW_SIZE) {
|
@@ -286,17 +286,17 @@ function processSymbolChunk(request, id, name) {
|
|
286
286
|
}
|
287
287
|
|
288
288
|
// eslint-disable-next-line no-unused-vars
|
289
|
-
var
|
290
|
-
function
|
289
|
+
var CLIENT_REFERENCE_TAG = Symbol.for('react.client.reference');
|
290
|
+
function getClientReferenceKey(reference) {
|
291
291
|
return reference.filepath + '#' + reference.name + (reference.async ? '#async' : '');
|
292
292
|
}
|
293
|
-
function
|
294
|
-
return reference.$$typeof ===
|
293
|
+
function isClientReference(reference) {
|
294
|
+
return reference.$$typeof === CLIENT_REFERENCE_TAG;
|
295
295
|
}
|
296
|
-
function resolveModuleMetaData(config,
|
297
|
-
var resolvedModuleData = config[
|
296
|
+
function resolveModuleMetaData(config, clientReference) {
|
297
|
+
var resolvedModuleData = config[clientReference.filepath][clientReference.name];
|
298
298
|
|
299
|
-
if (
|
299
|
+
if (clientReference.async) {
|
300
300
|
return {
|
301
301
|
id: resolvedModuleData.id,
|
302
302
|
chunks: resolvedModuleData.chunks,
|
@@ -1071,7 +1071,11 @@ function getThenableStateAfterSuspending() {
|
|
1071
1071
|
function readContext$1(context) {
|
1072
1072
|
{
|
1073
1073
|
if (context.$$typeof !== REACT_SERVER_CONTEXT_TYPE) {
|
1074
|
-
|
1074
|
+
if (isClientReference(context)) {
|
1075
|
+
error('Cannot read a Client Context from a Server Component.');
|
1076
|
+
} else {
|
1077
|
+
error('Only createServerContext is supported in Server Components.');
|
1078
|
+
}
|
1075
1079
|
}
|
1076
1080
|
|
1077
1081
|
if (currentRequest === null) {
|
@@ -1138,7 +1142,7 @@ function useId() {
|
|
1138
1142
|
}
|
1139
1143
|
|
1140
1144
|
function use(usable) {
|
1141
|
-
if (usable !== null && typeof usable === 'object') {
|
1145
|
+
if (usable !== null && typeof usable === 'object' || typeof usable === 'function') {
|
1142
1146
|
// $FlowFixMe[method-unbinding]
|
1143
1147
|
if (typeof usable.then === 'function') {
|
1144
1148
|
// This is a thenable.
|
@@ -1156,6 +1160,12 @@ function use(usable) {
|
|
1156
1160
|
var context = usable;
|
1157
1161
|
return readContext$1(context);
|
1158
1162
|
}
|
1163
|
+
}
|
1164
|
+
|
1165
|
+
{
|
1166
|
+
if (isClientReference(usable)) {
|
1167
|
+
error('Cannot use() an already resolved Client Reference.');
|
1168
|
+
}
|
1159
1169
|
} // eslint-disable-next-line react-internal/safe-string-coercion
|
1160
1170
|
|
1161
1171
|
|
@@ -1360,7 +1370,7 @@ function attemptResolveElement(type, key, ref, props, prevThenableState) {
|
|
1360
1370
|
}
|
1361
1371
|
|
1362
1372
|
if (typeof type === 'function') {
|
1363
|
-
if (
|
1373
|
+
if (isClientReference(type)) {
|
1364
1374
|
// This is a reference to a Client Component.
|
1365
1375
|
return [REACT_ELEMENT_TYPE, type, key, props];
|
1366
1376
|
} // This is a server-side component.
|
@@ -1390,7 +1400,7 @@ function attemptResolveElement(type, key, ref, props, prevThenableState) {
|
|
1390
1400
|
|
1391
1401
|
return [REACT_ELEMENT_TYPE, type, key, props];
|
1392
1402
|
} else if (type != null && typeof type === 'object') {
|
1393
|
-
if (
|
1403
|
+
if (isClientReference(type)) {
|
1394
1404
|
// This is a reference to a Client Component.
|
1395
1405
|
return [REACT_ELEMENT_TYPE, type, key, props];
|
1396
1406
|
}
|
@@ -1482,8 +1492,8 @@ function serializeByRefID(id) {
|
|
1482
1492
|
return '@' + id.toString(16);
|
1483
1493
|
}
|
1484
1494
|
|
1485
|
-
function
|
1486
|
-
var moduleKey =
|
1495
|
+
function serializeClientReference(request, parent, key, moduleReference) {
|
1496
|
+
var moduleKey = getClientReferenceKey(moduleReference);
|
1487
1497
|
var writtenModules = request.writtenModules;
|
1488
1498
|
var existingId = writtenModules.get(moduleKey);
|
1489
1499
|
|
@@ -1961,8 +1971,8 @@ function resolveModelToJSON(request, parent, key, value) {
|
|
1961
1971
|
}
|
1962
1972
|
|
1963
1973
|
if (typeof value === 'object') {
|
1964
|
-
if (
|
1965
|
-
return
|
1974
|
+
if (isClientReference(value)) {
|
1975
|
+
return serializeClientReference(request, parent, key, value);
|
1966
1976
|
} else if (value.$$typeof === REACT_PROVIDER_TYPE) {
|
1967
1977
|
var providerKey = value._context._globalName;
|
1968
1978
|
var writtenProviders = request.writtenProviders;
|
@@ -2017,8 +2027,8 @@ function resolveModelToJSON(request, parent, key, value) {
|
|
2017
2027
|
}
|
2018
2028
|
|
2019
2029
|
if (typeof value === 'function') {
|
2020
|
-
if (
|
2021
|
-
return
|
2030
|
+
if (isClientReference(value)) {
|
2031
|
+
return serializeClientReference(request, parent, key, value);
|
2022
2032
|
}
|
2023
2033
|
|
2024
2034
|
if (/^on[A-Z]/.test(key)) {
|
@@ -10,7 +10,7 @@
|
|
10
10
|
'use strict';var da=require("util"),ea=require("async_hooks"),fa=require("react");var ha=new ea.AsyncLocalStorage,e=null,m=0,n=!0;function p(a,b){a=a.write(b);n=n&&a}
|
11
11
|
function q(a,b){if("string"===typeof b){if(0!==b.length)if(2048<3*b.length)0<m&&(p(a,e.subarray(0,m)),e=new Uint8Array(2048),m=0),p(a,r.encode(b));else{var d=e;0<m&&(d=e.subarray(m));d=r.encodeInto(b,d);var c=d.read;m+=d.written;c<b.length&&(p(a,e),e=new Uint8Array(2048),m=r.encodeInto(b.slice(c),e).written);2048===m&&(p(a,e),e=new Uint8Array(2048),m=0)}}else 0!==b.byteLength&&(2048<b.byteLength?(0<m&&(p(a,e.subarray(0,m)),e=new Uint8Array(2048),m=0),p(a,b)):(d=e.length-m,d<b.byteLength&&(0===d?p(a,
|
12
12
|
e):(e.set(b.subarray(0,d),m),m+=d,p(a,e),b=b.subarray(d)),e=new Uint8Array(2048),m=0),e.set(b,m),m+=b.byteLength,2048===m&&(p(a,e),e=new Uint8Array(2048),m=0)));return n}var r=new da.TextEncoder;function t(a){return r.encode(a)}
|
13
|
-
var u=JSON.stringify,v=Symbol.for("react.
|
13
|
+
var u=JSON.stringify,v=Symbol.for("react.client.reference"),w=Symbol.for("react.element"),ia=Symbol.for("react.fragment"),ja=Symbol.for("react.provider"),ka=Symbol.for("react.server_context"),la=Symbol.for("react.forward_ref"),ma=Symbol.for("react.suspense"),na=Symbol.for("react.suspense_list"),oa=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),pa=Symbol.for("react.default_value"),qa=Symbol.for("react.memo_cache_sentinel");
|
14
14
|
function z(a,b,d,c,f,g,h){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=c;this.attributeNamespace=f;this.mustUseProperty=d;this.propertyName=a;this.type=b;this.sanitizeURL=g;this.removeEmptyString=h}"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){new z(a,0,!1,a,null,!1,!1)});
|
15
15
|
[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){new z(a[0],1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){new z(a,2,!1,a.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){new z(a,2,!1,a,null,!1,!1)});
|
16
16
|
"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){new z(a,3,!1,a.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(a){new z(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){new z(a,4,!1,a,null,!1,!1)});
|
@@ -33,7 +33,7 @@ function ya(){}function za(a,b,d){d=a[d];void 0===d?a.push(b):d!==b&&(b.then(ya,
|
|
33
33
|
function Aa(){if(null===J)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var a=J;J=null;return a}var K=null,L=0,M=null;function Ba(){var a=M;M=null;return a}function Ca(a){return a._currentValue}
|
34
34
|
var Ha={useMemo:function(a){return a()},useCallback:function(a){return a},useDebugValue:function(){},useDeferredValue:N,useTransition:N,readContext:Ca,useContext:Ca,useReducer:N,useRef:N,useState:N,useInsertionEffect:N,useLayoutEffect:N,useImperativeHandle:N,useEffect:N,useId:Ea,useMutableSource:N,useSyncExternalStore:N,useCacheRefresh:function(){return Fa},useMemoCache:function(a){for(var b=Array(a),d=0;d<a;d++)b[d]=qa;return b},use:Ga};
|
35
35
|
function N(){throw Error("This Hook is not supported in Server Components.");}function Fa(){throw Error("Refreshing the cache is not supported in Server Components.");}function Ea(){if(null===K)throw Error("useId can only be used while React is rendering");var a=K.identifierCount++;return":"+K.identifierPrefix+"S"+a.toString(32)+":"}
|
36
|
-
function Ga(a){if(null!==a&&"object"===typeof a){if("function"===typeof a.then){var b=L;L+=1;null===M&&(M=[]);return za(M,a,b)}if(a.$$typeof===ka)return a._currentValue}throw Error("An unsupported type was passed to use(): "+String(a));}function O(){return(new AbortController).signal}function Ia(){if(P)return P;var a=ha.getStore();return a?a:new Map}
|
36
|
+
function Ga(a){if(null!==a&&"object"===typeof a||"function"===typeof a){if("function"===typeof a.then){var b=L;L+=1;null===M&&(M=[]);return za(M,a,b)}if(a.$$typeof===ka)return a._currentValue}throw Error("An unsupported type was passed to use(): "+String(a));}function O(){return(new AbortController).signal}function Ia(){if(P)return P;var a=ha.getStore();return a?a:new Map}
|
37
37
|
var Ja={getCacheSignal:function(){var a=Ia(),b=a.get(O);void 0===b&&(b=O(),a.set(O,b));return b},getCacheForType:function(a){var b=Ia(),d=b.get(a);void 0===d&&(d=a(),b.set(a,d));return d}},P=null,Q=fa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Q.ContextRegistry,S=Q.ReactCurrentDispatcher,T=Q.ReactCurrentCache;function Ka(a){console.error(a)}
|
38
38
|
function La(a,b,d,c,f){if(null!==T.current&&T.current!==Ja)throw Error("Currently React only supports one RSC renderer at a time.");T.current=Ja;var g=new Set,h=[],k={status:0,fatalError:null,destination:null,bundlerConfig:b,cache:new Map,nextChunkId:0,pendingChunks:0,abortableTasks:g,pingedTasks:h,completedModuleChunks:[],completedJSONChunks:[],completedErrorChunks:[],writtenSymbols:new Map,writtenModules:new Map,writtenProviders:new Map,identifierPrefix:f||"",identifierCount:1,onError:void 0===
|
39
39
|
d?Ka:d,toJSON:function(a,b){return Ma(k,this,a,b)}};k.pendingChunks++;b=Na(c);a=Oa(k,a,b,g);h.push(a);return k}var Pa={};function Qa(a){if("fulfilled"===a.status)return a.value;if("rejected"===a.status)throw a.reason;throw a;}
|
@@ -248,22 +248,27 @@ async function transformSource(source, context, defaultTransformSource) {
|
|
248
248
|
|
249
249
|
var names = [];
|
250
250
|
await parseExportNamesInto(transformedSource, names, context.url, defaultTransformSource);
|
251
|
-
var newSrc = "const
|
251
|
+
var newSrc = "const CLIENT_REFERENCE = Symbol.for('react.client.reference');\n";
|
252
252
|
|
253
253
|
for (var i = 0; i < names.length; i++) {
|
254
254
|
var name = names[i];
|
255
255
|
|
256
256
|
if (name === 'default') {
|
257
257
|
newSrc += 'export default ';
|
258
|
+
newSrc += 'Object.defineProperties(function() {';
|
259
|
+
newSrc += 'throw new Error(' + JSON.stringify("Attempted to call the default export of " + context.url + " from the server" + "but it's on the client. It's not possible to invoke a client function from " + "the server, it can only be rendered as a Component or passed to props of a" + "Client Component.") + ');';
|
258
260
|
} else {
|
259
261
|
newSrc += 'export const ' + name + ' = ';
|
262
|
+
newSrc += 'export default ';
|
263
|
+
newSrc += 'Object.defineProperties(function() {';
|
264
|
+
newSrc += 'throw new Error(' + JSON.stringify("Attempted to call " + name + "() from the server but " + name + " is on the client. " + "It's not possible to invoke a client function from the server, it can " + "only be rendered as a Component or passed to props of a Client Component.") + ');';
|
260
265
|
}
|
261
266
|
|
262
|
-
newSrc += '{
|
263
|
-
newSrc += JSON.stringify(
|
264
|
-
newSrc += '
|
265
|
-
newSrc += JSON.stringify(
|
266
|
-
newSrc += '};\n';
|
267
|
+
newSrc += '},{';
|
268
|
+
newSrc += 'name: { value: ' + JSON.stringify(name) + '},';
|
269
|
+
newSrc += '$$typeof: {value: CLIENT_REFERENCE},';
|
270
|
+
newSrc += 'filepath: {value: ' + JSON.stringify(context.url) + '}';
|
271
|
+
newSrc += '});\n';
|
267
272
|
}
|
268
273
|
|
269
274
|
return {
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-server-dom-webpack",
|
3
3
|
"description": "React Server Components bindings for DOM using Webpack. This is intended to be integrated into meta-frameworks. It is not intended to be imported directly.",
|
4
|
-
"version": "18.3.0-next-
|
4
|
+
"version": "18.3.0-next-8b9ac8175-20230131",
|
5
5
|
"keywords": [
|
6
6
|
"react"
|
7
7
|
],
|
@@ -49,8 +49,8 @@
|
|
49
49
|
"node": ">=0.10.0"
|
50
50
|
},
|
51
51
|
"peerDependencies": {
|
52
|
-
"react": "18.3.0-next-
|
53
|
-
"react-dom": "18.3.0-next-
|
52
|
+
"react": "18.3.0-next-8b9ac8175-20230131",
|
53
|
+
"react-dom": "18.3.0-next-8b9ac8175-20230131",
|
54
54
|
"webpack": "^5.59.0"
|
55
55
|
},
|
56
56
|
"dependencies": {
|
@@ -31,7 +31,7 @@
|
|
31
31
|
}
|
32
32
|
|
33
33
|
// eslint-disable-next-line no-unused-vars
|
34
|
-
function
|
34
|
+
function resolveClientReference(bundlerConfig, moduleData) {
|
35
35
|
if (bundlerConfig) {
|
36
36
|
var resolvedModuleData = bundlerConfig[moduleData.id][moduleData.name];
|
37
37
|
|
@@ -633,7 +633,7 @@
|
|
633
633
|
var chunks = response._chunks;
|
634
634
|
var chunk = chunks.get(id);
|
635
635
|
var moduleMetaData = parseModel(response, model);
|
636
|
-
var moduleReference =
|
636
|
+
var moduleReference = resolveClientReference(response._bundlerConfig, moduleMetaData); // TODO: Add an option to encode modules that are lazy loaded.
|
637
637
|
// For now we preload all modules as early as possible since it's likely
|
638
638
|
// that we'll need them.
|
639
639
|
|
@@ -216,17 +216,17 @@
|
|
216
216
|
}
|
217
217
|
|
218
218
|
// eslint-disable-next-line no-unused-vars
|
219
|
-
var
|
220
|
-
function
|
219
|
+
var CLIENT_REFERENCE_TAG = Symbol.for('react.client.reference');
|
220
|
+
function getClientReferenceKey(reference) {
|
221
221
|
return reference.filepath + '#' + reference.name + (reference.async ? '#async' : '');
|
222
222
|
}
|
223
|
-
function
|
224
|
-
return reference.$$typeof ===
|
223
|
+
function isClientReference(reference) {
|
224
|
+
return reference.$$typeof === CLIENT_REFERENCE_TAG;
|
225
225
|
}
|
226
|
-
function resolveModuleMetaData(config,
|
227
|
-
var resolvedModuleData = config[
|
226
|
+
function resolveModuleMetaData(config, clientReference) {
|
227
|
+
var resolvedModuleData = config[clientReference.filepath][clientReference.name];
|
228
228
|
|
229
|
-
if (
|
229
|
+
if (clientReference.async) {
|
230
230
|
return {
|
231
231
|
id: resolvedModuleData.id,
|
232
232
|
chunks: resolvedModuleData.chunks,
|
@@ -1001,7 +1001,11 @@
|
|
1001
1001
|
function readContext$1(context) {
|
1002
1002
|
{
|
1003
1003
|
if (context.$$typeof !== REACT_SERVER_CONTEXT_TYPE) {
|
1004
|
-
|
1004
|
+
if (isClientReference(context)) {
|
1005
|
+
error('Cannot read a Client Context from a Server Component.');
|
1006
|
+
} else {
|
1007
|
+
error('Only createServerContext is supported in Server Components.');
|
1008
|
+
}
|
1005
1009
|
}
|
1006
1010
|
|
1007
1011
|
if (currentRequest === null) {
|
@@ -1068,7 +1072,7 @@
|
|
1068
1072
|
}
|
1069
1073
|
|
1070
1074
|
function use(usable) {
|
1071
|
-
if (usable !== null && typeof usable === 'object') {
|
1075
|
+
if (usable !== null && typeof usable === 'object' || typeof usable === 'function') {
|
1072
1076
|
// $FlowFixMe[method-unbinding]
|
1073
1077
|
if (typeof usable.then === 'function') {
|
1074
1078
|
// This is a thenable.
|
@@ -1086,6 +1090,12 @@
|
|
1086
1090
|
var context = usable;
|
1087
1091
|
return readContext$1(context);
|
1088
1092
|
}
|
1093
|
+
}
|
1094
|
+
|
1095
|
+
{
|
1096
|
+
if (isClientReference(usable)) {
|
1097
|
+
error('Cannot use() an already resolved Client Reference.');
|
1098
|
+
}
|
1089
1099
|
} // eslint-disable-next-line react-internal/safe-string-coercion
|
1090
1100
|
|
1091
1101
|
|
@@ -1290,7 +1300,7 @@
|
|
1290
1300
|
}
|
1291
1301
|
|
1292
1302
|
if (typeof type === 'function') {
|
1293
|
-
if (
|
1303
|
+
if (isClientReference(type)) {
|
1294
1304
|
// This is a reference to a Client Component.
|
1295
1305
|
return [REACT_ELEMENT_TYPE, type, key, props];
|
1296
1306
|
} // This is a server-side component.
|
@@ -1320,7 +1330,7 @@
|
|
1320
1330
|
|
1321
1331
|
return [REACT_ELEMENT_TYPE, type, key, props];
|
1322
1332
|
} else if (type != null && typeof type === 'object') {
|
1323
|
-
if (
|
1333
|
+
if (isClientReference(type)) {
|
1324
1334
|
// This is a reference to a Client Component.
|
1325
1335
|
return [REACT_ELEMENT_TYPE, type, key, props];
|
1326
1336
|
}
|
@@ -1412,8 +1422,8 @@
|
|
1412
1422
|
return '@' + id.toString(16);
|
1413
1423
|
}
|
1414
1424
|
|
1415
|
-
function
|
1416
|
-
var moduleKey =
|
1425
|
+
function serializeClientReference(request, parent, key, moduleReference) {
|
1426
|
+
var moduleKey = getClientReferenceKey(moduleReference);
|
1417
1427
|
var writtenModules = request.writtenModules;
|
1418
1428
|
var existingId = writtenModules.get(moduleKey);
|
1419
1429
|
|
@@ -1891,8 +1901,8 @@
|
|
1891
1901
|
}
|
1892
1902
|
|
1893
1903
|
if (typeof value === 'object') {
|
1894
|
-
if (
|
1895
|
-
return
|
1904
|
+
if (isClientReference(value)) {
|
1905
|
+
return serializeClientReference(request, parent, key, value);
|
1896
1906
|
} else if (value.$$typeof === REACT_PROVIDER_TYPE) {
|
1897
1907
|
var providerKey = value._context._globalName;
|
1898
1908
|
var writtenProviders = request.writtenProviders;
|
@@ -1947,8 +1957,8 @@
|
|
1947
1957
|
}
|
1948
1958
|
|
1949
1959
|
if (typeof value === 'function') {
|
1950
|
-
if (
|
1951
|
-
return
|
1960
|
+
if (isClientReference(value)) {
|
1961
|
+
return serializeClientReference(request, parent, key, value);
|
1952
1962
|
}
|
1953
1963
|
|
1954
1964
|
if (/^on[A-Z]/.test(key)) {
|
@@ -29,7 +29,7 @@ typeof c+'" instead');return c||""}function V(a,c){null!==a.destination?(a.statu
|
|
29
29
|
f.thenableState;f.model=h;h=C(l.type,l.key,l.ref,l.props,m);for(f.thenableState=null;"object"===typeof h&&null!==h&&h.$$typeof===t;)l=h,f.model=h,h=C(l.type,l.key,l.ref,l.props,null)}var n=f.id,p=D(h,g.toJSON),q="J"+n.toString(16)+":"+p+"\n";var u=x.encode(q);g.completedJSONChunks.push(u);g.abortableTasks.delete(f);f.status=1}catch(F){var r=F===P?ka():F;if("object"===typeof r&&null!==r&&"function"===typeof r.then){var v=f.ping;r.then(v,v);f.thenableState=la()}else{g.abortableTasks.delete(f);f.status=
|
30
30
|
4;var w=y(g,r);L(g,f.id,w)}}}}null!==a.destination&&X(a,a.destination)}catch(F){y(a,F),V(a,F)}finally{W.current=c,A=b,E=null}}function X(a,c){p=new Uint8Array(512);n=0;try{for(var b=a.completedModuleChunks,d=0;d<b.length;d++)if(a.pendingChunks--,!N(c,b[d])){a.destination=null;d++;break}b.splice(0,d);var k=a.completedJSONChunks;for(d=0;d<k.length;d++)if(a.pendingChunks--,!N(c,k[d])){a.destination=null;d++;break}k.splice(0,d);var f=a.completedErrorChunks;for(d=0;d<f.length;d++)if(a.pendingChunks--,
|
31
31
|
!N(c,f[d])){a.destination=null;d++;break}f.splice(0,d)}finally{p&&0<n&&(c.enqueue(new Uint8Array(p.buffer,0,n)),p=null,n=0)}0===a.pendingChunks&&c.close()}function za(a,c){try{var b=a.abortableTasks;if(0<b.size){var d=y(a,void 0===c?Error("The render was aborted by the server without a reason."):c);a.pendingChunks++;var k=a.nextChunkId++;L(a,k,d);b.forEach(function(c){c.status=3;var b="$"+k.toString(16);c=c.id;b=D(b);b="J"+c.toString(16)+":"+b+"\n";b=x.encode(b);a.completedErrorChunks.push(b)});b.clear()}null!==
|
32
|
-
a.destination&&X(a,a.destination)}catch(f){y(a,f),V(a,f)}}function Fa(a){if(a){var b=u;O(null);for(var e=0;e<a.length;e++){var d=a[e],k=d[0];d=d[1];Y[k]||(Y[k]=z.createServerContext(k,ya));ia(Y[k],d)}a=u;O(b);return a}return null}var R="function"===typeof AsyncLocalStorage,oa=R?new AsyncLocalStorage:null,p=null,n=0,x=new TextEncoder,D=JSON.stringify,J=Symbol.for("react.
|
32
|
+
a.destination&&X(a,a.destination)}catch(f){y(a,f),V(a,f)}}function Fa(a){if(a){var b=u;O(null);for(var e=0;e<a.length;e++){var d=a[e],k=d[0];d=d[1];Y[k]||(Y[k]=z.createServerContext(k,ya));ia(Y[k],d)}a=u;O(b);return a}return null}var R="function"===typeof AsyncLocalStorage,oa=R?new AsyncLocalStorage:null,p=null,n=0,x=new TextEncoder,D=JSON.stringify,J=Symbol.for("react.client.reference"),t=Symbol.for("react.element"),Ia=Symbol.for("react.fragment"),ta=Symbol.for("react.provider"),Na=Symbol.for("react.server_context"),
|
33
33
|
ra=Symbol.for("react.forward_ref"),Ka=Symbol.for("react.suspense"),La=Symbol.for("react.suspense_list"),sa=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),ya=Symbol.for("react.default_value"),Oa=Symbol.for("react.memo_cache_sentinel");"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){new m(a,0,!1,a,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor",
|
34
34
|
"for"],["httpEquiv","http-equiv"]].forEach(function(a){new m(a[0],1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){new m(a,2,!1,a.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){new m(a,2,!1,a,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){new m(a,
|
35
35
|
3,!1,a.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(a){new m(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){new m(a,4,!1,a,null,!1,!1)});["cols","rows","size","span"].forEach(function(a){new m(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){new m(a,5,!1,a.toLowerCase(),null,!1,!1)});var Z=/[\-:]([a-z])/g,aa=function(a){return a[1].toUpperCase()};"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=
|
@@ -44,7 +44,7 @@ b('$RM=new Map;\n$RR=function(p,q,v){function r(l){this.s=l}for(var t=$RC,u=$RM,
|
|
44
44
|
b('$RR("');b('","');b('",');b('"');b(")\x3c/script>");b('<template data-rci="" data-bid="');b('<template data-rri="" data-bid="');b('" data-sid="');b('" data-sty="');b('$RX=function(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};;$RX("');b('$RX("');b('"');b(",");b(")\x3c/script>");b('<template data-rxi="" data-bid="');b('" data-dgst="');b('" data-msg="');b('" data-stck="');b('<style data-precedence="');
|
45
45
|
b('"></style>');b("[");b(",[");b(",");b("]");var u=null,P=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`"),I=null,E=null,K=0,v=
|
46
46
|
null,Ma={useMemo:function(a){return a()},useCallback:function(a){return a},useDebugValue:function(){},useDeferredValue:q,useTransition:q,readContext:ma,useContext:ma,useReducer:q,useRef:q,useState:q,useInsertionEffect:q,useLayoutEffect:q,useImperativeHandle:q,useEffect:q,useId:function(){if(null===E)throw Error("useId can only be used while React is rendering");var a=E.identifierCount++;return":"+E.identifierPrefix+"S"+a.toString(32)+":"},useMutableSource:q,useSyncExternalStore:q,useCacheRefresh:function(){return Ba},
|
47
|
-
useMemoCache:function(a){for(var b=Array(a),e=0;e<a;e++)b[e]=Oa;return b},use:function(a){if(null!==a&&"object"===typeof a){if("function"===typeof a.then){var b=K;K+=1;null===v&&(v=[]);return Aa(v,a,b)}if(a.$$typeof===Na)return a._currentValue}throw Error("An unsupported type was passed to use(): "+String(a));}},pa={getCacheSignal:function(){var a=na(),b=a.get(Q);void 0===b&&(b=Q(),a.set(Q,b));return b},getCacheForType:function(a){var b=na(),e=b.get(a);void 0===e&&(e=a(),b.set(a,
|
48
|
-
null;G=z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;var Y=G.ContextRegistry,W=G.ReactCurrentDispatcher,S=G.ReactCurrentCache,ua={};r.renderToReadableStream=function(a,b,e){var c=Da(a,b,e?e.onError:void 0,e?e.context:void 0,e?e.identifierPrefix:void 0);if(e&&e.signal){var k=e.signal;if(k.aborted)za(c,k.reason);else{var f=function(){za(c,k.reason);k.removeEventListener("abort",f)};k.addEventListener("abort",f)}}return new ReadableStream({type:"bytes",start:function(a){R?oa.run(c.cache,
|
49
|
-
U(c)},pull:function(a){if(1===c.status)c.status=2,ca(a,c.fatalError);else if(2!==c.status&&null===c.destination){c.destination=a;try{X(c,a)}catch(h){y(c,h),V(c,h)}}},cancel:function(a){}},{highWaterMark:0})}});
|
47
|
+
useMemoCache:function(a){for(var b=Array(a),e=0;e<a;e++)b[e]=Oa;return b},use:function(a){if(null!==a&&"object"===typeof a||"function"===typeof a){if("function"===typeof a.then){var b=K;K+=1;null===v&&(v=[]);return Aa(v,a,b)}if(a.$$typeof===Na)return a._currentValue}throw Error("An unsupported type was passed to use(): "+String(a));}},pa={getCacheSignal:function(){var a=na(),b=a.get(Q);void 0===b&&(b=Q(),a.set(Q,b));return b},getCacheForType:function(a){var b=na(),e=b.get(a);void 0===e&&(e=a(),b.set(a,
|
48
|
+
e));return e}},A=null;G=z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;var Y=G.ContextRegistry,W=G.ReactCurrentDispatcher,S=G.ReactCurrentCache,ua={};r.renderToReadableStream=function(a,b,e){var c=Da(a,b,e?e.onError:void 0,e?e.context:void 0,e?e.identifierPrefix:void 0);if(e&&e.signal){var k=e.signal;if(k.aborted)za(c,k.reason);else{var f=function(){za(c,k.reason);k.removeEventListener("abort",f)};k.addEventListener("abort",f)}}return new ReadableStream({type:"bytes",start:function(a){R?oa.run(c.cache,
|
49
|
+
U,c):U(c)},pull:function(a){if(1===c.status)c.status=2,ca(a,c.fatalError);else if(2!==c.status&&null===c.destination){c.destination=a;try{X(c,a)}catch(h){y(c,h),V(c,h)}}},cancel:function(a){}},{highWaterMark:0})}});
|
50
50
|
})();
|