react-server-dom-rspack 0.0.1-alpha.8 → 0.0.1-beta.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.
Files changed (65) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +3 -1
  3. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js → cjs/react-server-dom-rspack-client.browser.development.js} +372 -203
  4. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js → cjs/react-server-dom-rspack-client.browser.production.js} +133 -83
  5. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js → cjs/react-server-dom-rspack-client.edge.development.js} +304 -160
  6. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js → cjs/react-server-dom-rspack-client.edge.production.js} +119 -79
  7. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js → cjs/react-server-dom-rspack-client.node.development.js} +326 -191
  8. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js → cjs/react-server-dom-rspack-client.node.production.js} +127 -95
  9. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js → cjs/react-server-dom-rspack-server.browser.development.js} +263 -297
  10. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js → cjs/react-server-dom-rspack-server.browser.production.js} +170 -224
  11. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js → cjs/react-server-dom-rspack-server.edge.development.js} +283 -309
  12. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js → cjs/react-server-dom-rspack-server.edge.production.js} +186 -231
  13. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js → cjs/react-server-dom-rspack-server.node.development.js} +543 -522
  14. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js → cjs/react-server-dom-rspack-server.node.production.js} +197 -243
  15. package/client.browser.js +7 -0
  16. package/client.edge.js +7 -0
  17. package/client.node.js +7 -0
  18. package/{vendor/react-server-dom-webpack/index.js → index.js} +1 -1
  19. package/package.json +66 -128
  20. package/plugin.js +3 -0
  21. package/server.browser.js +24 -0
  22. package/server.edge.js +25 -0
  23. package/{vendor/react-server-dom-webpack/server.node.js → server.node.js} +10 -3
  24. package/static.browser.js +10 -0
  25. package/static.edge.js +10 -0
  26. package/{vendor/react-server-dom-webpack/static.node.js → static.node.js} +2 -2
  27. package/dist/client.browser.d.ts +0 -23
  28. package/dist/client.browser.js +0 -41
  29. package/dist/client.d.ts +0 -1
  30. package/dist/client.edge.d.ts +0 -28
  31. package/dist/client.edge.js +0 -27
  32. package/dist/client.js +0 -1
  33. package/dist/client.node.d.ts +0 -11
  34. package/dist/client.node.js +0 -10
  35. package/dist/index.d.ts +0 -0
  36. package/dist/index.js +0 -2
  37. package/dist/server.browser.d.ts +0 -30
  38. package/dist/server.browser.js +0 -68
  39. package/dist/server.d.ts +0 -0
  40. package/dist/server.edge.d.ts +0 -32
  41. package/dist/server.edge.js +0 -71
  42. package/dist/server.js +0 -3
  43. package/dist/server.node.d.ts +0 -33
  44. package/dist/server.node.js +0 -75
  45. package/dist/types.d.ts +0 -45
  46. package/dist/types.js +0 -1
  47. package/vendor/react-server-dom-webpack/LICENSE +0 -21
  48. package/vendor/react-server-dom-webpack/README.md +0 -5
  49. package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-node-register.js +0 -69
  50. package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-plugin.js +0 -404
  51. package/vendor/react-server-dom-webpack/client.browser.js +0 -7
  52. package/vendor/react-server-dom-webpack/client.edge.js +0 -7
  53. package/vendor/react-server-dom-webpack/client.node.js +0 -7
  54. package/vendor/react-server-dom-webpack/esm/react-server-dom-webpack-node-loader.production.js +0 -515
  55. package/vendor/react-server-dom-webpack/node-register.js +0 -3
  56. package/vendor/react-server-dom-webpack/package.json +0 -96
  57. package/vendor/react-server-dom-webpack/plugin.js +0 -3
  58. package/vendor/react-server-dom-webpack/server.browser.js +0 -17
  59. package/vendor/react-server-dom-webpack/server.edge.js +0 -18
  60. package/vendor/react-server-dom-webpack/static.browser.js +0 -10
  61. package/vendor/react-server-dom-webpack/static.edge.js +0 -10
  62. /package/{vendor/react-server-dom-webpack/client.js → client.js} +0 -0
  63. /package/{vendor/react-server-dom-webpack/esm → esm}/package.json +0 -0
  64. /package/{vendor/react-server-dom-webpack/server.js → server.js} +0 -0
  65. /package/{vendor/react-server-dom-webpack/static.js → static.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license React
3
- * react-server-dom-webpack-server.edge.production.js
3
+ * react-server-dom-rspack-server.edge.production.js
4
4
  *
5
5
  * Copyright (c) Meta Platforms, Inc. and affiliates.
6
6
  *
@@ -11,6 +11,50 @@
11
11
  "use strict";
12
12
  var ReactDOM = require("react-dom"),
13
13
  React = require("react"),
14
+ assign = Object.assign,
15
+ CLIENT_REFERENCE_TAG$1 = Symbol.for("react.client.reference"),
16
+ SERVER_REFERENCE_TAG = Symbol.for("react.server.reference"),
17
+ FunctionBind = Function.prototype.bind,
18
+ ArraySlice = Array.prototype.slice;
19
+ function bind() {
20
+ var newFn = FunctionBind.apply(this, arguments);
21
+ if (this.$$typeof === SERVER_REFERENCE_TAG) {
22
+ var args = ArraySlice.call(arguments, 1),
23
+ $$typeof = { value: SERVER_REFERENCE_TAG },
24
+ $$id = { value: this.$$id };
25
+ args = { value: this.$$bound ? this.$$bound.concat(args) : args };
26
+ return Object.defineProperties(newFn, {
27
+ $$typeof: $$typeof,
28
+ $$id: $$id,
29
+ $$bound: args,
30
+ bind: { value: bind, configurable: !0 }
31
+ });
32
+ }
33
+ return newFn;
34
+ }
35
+ var serverReferenceToString = {
36
+ value: function () {
37
+ return "function () { [omitted code] }";
38
+ },
39
+ configurable: !0,
40
+ writable: !0
41
+ },
42
+ currentStrategy = {
43
+ encrypt: function (_actionId) {
44
+ for (
45
+ var _len = arguments.length,
46
+ args = Array(1 < _len ? _len - 1 : 0),
47
+ _key = 1;
48
+ _key < _len;
49
+ _key++
50
+ )
51
+ args[_key - 1] = arguments[_key];
52
+ return Promise.resolve(args);
53
+ },
54
+ decrypt: function (_actionId, payloadPromise) {
55
+ return payloadPromise;
56
+ }
57
+ },
14
58
  REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
15
59
  REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
16
60
  REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
@@ -20,9 +64,9 @@ var ReactDOM = require("react-dom"),
20
64
  REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
21
65
  REACT_MEMO_TYPE = Symbol.for("react.memo"),
22
66
  REACT_LAZY_TYPE = Symbol.for("react.lazy"),
23
- REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
24
- Symbol.for("react.postpone");
25
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
67
+ REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
68
+ REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"),
69
+ MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
26
70
  function getIteratorFn(maybeIterable) {
27
71
  if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
28
72
  maybeIterable =
@@ -30,7 +74,8 @@ function getIteratorFn(maybeIterable) {
30
74
  maybeIterable["@@iterator"];
31
75
  return "function" === typeof maybeIterable ? maybeIterable : null;
32
76
  }
33
- var ASYNC_ITERATOR = Symbol.asyncIterator;
77
+ var ASYNC_ITERATOR = Symbol.asyncIterator,
78
+ REACT_OPTIMISTIC_KEY = Symbol.for("react.optimistic_key");
34
79
  function handleErrorInNextTick(error) {
35
80
  setTimeout(function () {
36
81
  throw error;
@@ -49,12 +94,12 @@ var LocalPromise = Promise,
49
94
  writtenBytes = 0;
50
95
  function writeChunkAndReturn(destination, chunk) {
51
96
  if (0 !== chunk.byteLength)
52
- if (2048 < chunk.byteLength)
97
+ if (4096 < chunk.byteLength)
53
98
  0 < writtenBytes &&
54
99
  (destination.enqueue(
55
100
  new Uint8Array(currentView.buffer, 0, writtenBytes)
56
101
  ),
57
- (currentView = new Uint8Array(2048)),
102
+ (currentView = new Uint8Array(4096)),
58
103
  (writtenBytes = 0)),
59
104
  destination.enqueue(chunk);
60
105
  else {
@@ -65,7 +110,7 @@ function writeChunkAndReturn(destination, chunk) {
65
110
  : (currentView.set(chunk.subarray(0, allowableBytes), writtenBytes),
66
111
  destination.enqueue(currentView),
67
112
  (chunk = chunk.subarray(allowableBytes))),
68
- (currentView = new Uint8Array(2048)),
113
+ (currentView = new Uint8Array(4096)),
69
114
  (writtenBytes = 0));
70
115
  currentView.set(chunk, writtenBytes);
71
116
  writtenBytes += chunk.byteLength;
@@ -84,180 +129,7 @@ function closeWithError(destination, error) {
84
129
  ? destination.error(error)
85
130
  : destination.close();
86
131
  }
87
- var CLIENT_REFERENCE_TAG$1 = Symbol.for("react.client.reference"),
88
- SERVER_REFERENCE_TAG = Symbol.for("react.server.reference");
89
- function registerClientReferenceImpl(proxyImplementation, id, async) {
90
- return Object.defineProperties(proxyImplementation, {
91
- $$typeof: { value: CLIENT_REFERENCE_TAG$1 },
92
- $$id: { value: id },
93
- $$async: { value: async }
94
- });
95
- }
96
- var FunctionBind = Function.prototype.bind,
97
- ArraySlice = Array.prototype.slice;
98
- function bind() {
99
- var newFn = FunctionBind.apply(this, arguments);
100
- if (this.$$typeof === SERVER_REFERENCE_TAG) {
101
- var args = ArraySlice.call(arguments, 1),
102
- $$typeof = { value: SERVER_REFERENCE_TAG },
103
- $$id = { value: this.$$id };
104
- args = { value: this.$$bound ? this.$$bound.concat(args) : args };
105
- return Object.defineProperties(newFn, {
106
- $$typeof: $$typeof,
107
- $$id: $$id,
108
- $$bound: args,
109
- bind: { value: bind, configurable: !0 }
110
- });
111
- }
112
- return newFn;
113
- }
114
- var serverReferenceToString = {
115
- value: function () {
116
- return "function () { [omitted code] }";
117
- },
118
- configurable: !0,
119
- writable: !0
120
- },
121
- PROMISE_PROTOTYPE = Promise.prototype,
122
- deepProxyHandlers = {
123
- get: function (target, name) {
124
- switch (name) {
125
- case "$$typeof":
126
- return target.$$typeof;
127
- case "$$id":
128
- return target.$$id;
129
- case "$$async":
130
- return target.$$async;
131
- case "name":
132
- return target.name;
133
- case "displayName":
134
- return;
135
- case "defaultProps":
136
- return;
137
- case "_debugInfo":
138
- return;
139
- case "toJSON":
140
- return;
141
- case Symbol.toPrimitive:
142
- return Object.prototype[Symbol.toPrimitive];
143
- case Symbol.toStringTag:
144
- return Object.prototype[Symbol.toStringTag];
145
- case "Provider":
146
- throw Error(
147
- "Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."
148
- );
149
- case "then":
150
- throw Error(
151
- "Cannot await or return from a thenable. You cannot await a client module from a server component."
152
- );
153
- }
154
- throw Error(
155
- "Cannot access " +
156
- (String(target.name) + "." + String(name)) +
157
- " on the server. You cannot dot into a client module from a server component. You can only pass the imported name through."
158
- );
159
- },
160
- set: function () {
161
- throw Error("Cannot assign to a client module from a server module.");
162
- }
163
- };
164
- function getReference(target, name) {
165
- switch (name) {
166
- case "$$typeof":
167
- return target.$$typeof;
168
- case "$$id":
169
- return target.$$id;
170
- case "$$async":
171
- return target.$$async;
172
- case "name":
173
- return target.name;
174
- case "defaultProps":
175
- return;
176
- case "_debugInfo":
177
- return;
178
- case "toJSON":
179
- return;
180
- case Symbol.toPrimitive:
181
- return Object.prototype[Symbol.toPrimitive];
182
- case Symbol.toStringTag:
183
- return Object.prototype[Symbol.toStringTag];
184
- case "__esModule":
185
- var moduleId = target.$$id;
186
- target.default = registerClientReferenceImpl(
187
- function () {
188
- throw Error(
189
- "Attempted to call the default export of " +
190
- moduleId +
191
- " 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."
192
- );
193
- },
194
- target.$$id + "#",
195
- target.$$async
196
- );
197
- return !0;
198
- case "then":
199
- if (target.then) return target.then;
200
- if (target.$$async) return;
201
- var clientReference = registerClientReferenceImpl({}, target.$$id, !0),
202
- proxy = new Proxy(clientReference, proxyHandlers$1);
203
- target.status = "fulfilled";
204
- target.value = proxy;
205
- return (target.then = registerClientReferenceImpl(
206
- function (resolve) {
207
- return Promise.resolve(resolve(proxy));
208
- },
209
- target.$$id + "#then",
210
- !1
211
- ));
212
- }
213
- if ("symbol" === typeof name)
214
- throw Error(
215
- "Cannot read Symbol exports. Only named exports are supported on a client module imported on the server."
216
- );
217
- clientReference = target[name];
218
- clientReference ||
219
- ((clientReference = registerClientReferenceImpl(
220
- function () {
221
- throw Error(
222
- "Attempted to call " +
223
- String(name) +
224
- "() from the server but " +
225
- String(name) +
226
- " 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."
227
- );
228
- },
229
- target.$$id + "#" + name,
230
- target.$$async
231
- )),
232
- Object.defineProperty(clientReference, "name", { value: name }),
233
- (clientReference = target[name] =
234
- new Proxy(clientReference, deepProxyHandlers)));
235
- return clientReference;
236
- }
237
- var proxyHandlers$1 = {
238
- get: function (target, name) {
239
- return getReference(target, name);
240
- },
241
- getOwnPropertyDescriptor: function (target, name) {
242
- var descriptor = Object.getOwnPropertyDescriptor(target, name);
243
- descriptor ||
244
- ((descriptor = {
245
- value: getReference(target, name),
246
- writable: !1,
247
- configurable: !1,
248
- enumerable: !1
249
- }),
250
- Object.defineProperty(target, name, descriptor));
251
- return descriptor;
252
- },
253
- getPrototypeOf: function () {
254
- return PROMISE_PROTOTYPE;
255
- },
256
- set: function () {
257
- throw Error("Cannot assign to a client module from a server module.");
258
- }
259
- },
260
- ReactDOMSharedInternals =
132
+ var ReactDOMSharedInternals =
261
133
  ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
262
134
  previousDispatcher = ReactDOMSharedInternals.d;
263
135
  ReactDOMSharedInternals.d = {
@@ -476,7 +348,7 @@ function getChildFormatContext(parentContext, type, props) {
476
348
  });
477
349
  break;
478
350
  case "stylesheet":
479
- preload(srcSet, "stylesheet", {
351
+ preload(srcSet, "style", {
480
352
  crossOrigin: props.crossOrigin,
481
353
  integrity: props.integrity,
482
354
  nonce: props.nonce,
@@ -741,6 +613,8 @@ function describeElementType(type) {
741
613
  return "Suspense";
742
614
  case REACT_SUSPENSE_LIST_TYPE:
743
615
  return "SuspenseList";
616
+ case REACT_VIEW_TRANSITION_TYPE:
617
+ return "ViewTransition";
744
618
  }
745
619
  if ("object" === typeof type)
746
620
  switch (type.$$typeof) {
@@ -815,7 +689,7 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
815
689
  : "\n " + str;
816
690
  }
817
691
  var hasOwnProperty = Object.prototype.hasOwnProperty,
818
- ObjectPrototype = Object.prototype,
692
+ ObjectPrototype$1 = Object.prototype,
819
693
  stringify = JSON.stringify;
820
694
  function defaultErrorHandler(error) {
821
695
  console.error(error);
@@ -825,7 +699,6 @@ function RequestInstance(
825
699
  model,
826
700
  bundlerConfig,
827
701
  onError,
828
- onPostpone,
829
702
  onAllReady,
830
703
  onFatalError,
831
704
  identifierPrefix,
@@ -864,7 +737,6 @@ function RequestInstance(
864
737
  this.identifierCount = 1;
865
738
  this.taintCleanupQueue = [];
866
739
  this.onError = void 0 === onError ? defaultErrorHandler : onError;
867
- this.onPostpone = void 0 === onPostpone ? noop : onPostpone;
868
740
  this.onAllReady = onAllReady;
869
741
  this.onFatalError = onFatalError;
870
742
  type = createTask(this, model, null, !1, 0, abortSet);
@@ -948,9 +820,17 @@ function serializeReadableStream(request, task, stream) {
948
820
  callOnAllReadyIfReady(request);
949
821
  else
950
822
  try {
951
- (streamTask.model = entry.value),
952
- request.pendingChunks++,
953
- tryStreamTask(request, streamTask),
823
+ request.pendingChunks++,
824
+ (streamTask.model = entry.value),
825
+ isByteStream
826
+ ? emitTypedArrayChunk(
827
+ request,
828
+ streamTask.id,
829
+ "b",
830
+ streamTask.model,
831
+ !1
832
+ )
833
+ : tryStreamTask(request, streamTask),
954
834
  enqueueFlush(request),
955
835
  reader.read().then(progress, error);
956
836
  } catch (x$11) {
@@ -984,7 +864,8 @@ function serializeReadableStream(request, task, stream) {
984
864
  } catch (x) {
985
865
  supportsBYOB = !1;
986
866
  }
987
- var reader = stream.getReader(),
867
+ var isByteStream = supportsBYOB,
868
+ reader = stream.getReader(),
988
869
  streamTask = createTask(
989
870
  request,
990
871
  task.model,
@@ -994,7 +875,7 @@ function serializeReadableStream(request, task, stream) {
994
875
  request.abortableTasks
995
876
  );
996
877
  request.pendingChunks++;
997
- task = streamTask.id.toString(16) + ":" + (supportsBYOB ? "r" : "R") + "\n";
878
+ task = streamTask.id.toString(16) + ":" + (isByteStream ? "r" : "R") + "\n";
998
879
  request.completedRegularChunks.push(stringToChunk(task));
999
880
  request.cacheController.signal.addEventListener("abort", abortStream);
1000
881
  reader.read().then(progress, error);
@@ -1164,7 +1045,12 @@ function renderFunctionComponent(request, task, key, Component, props) {
1164
1045
  Component = task.keyPath;
1165
1046
  prevThenableState = task.implicitSlot;
1166
1047
  null !== key
1167
- ? (task.keyPath = null === Component ? key : Component + "," + key)
1048
+ ? (task.keyPath =
1049
+ key === REACT_OPTIMISTIC_KEY || Component === REACT_OPTIMISTIC_KEY
1050
+ ? REACT_OPTIMISTIC_KEY
1051
+ : null === Component
1052
+ ? key
1053
+ : Component + "," + key)
1168
1054
  : null === Component && (task.implicitSlot = !0);
1169
1055
  request = renderModelDestructive(request, task, emptyRoot, "", props);
1170
1056
  task.keyPath = Component;
@@ -1247,7 +1133,11 @@ function renderElement(request, task, type, key, ref, props) {
1247
1133
  key = task.keyPath;
1248
1134
  null === request
1249
1135
  ? (request = key)
1250
- : null !== key && (request = key + "," + request);
1136
+ : null !== key &&
1137
+ (request =
1138
+ key === REACT_OPTIMISTIC_KEY || request === REACT_OPTIMISTIC_KEY
1139
+ ? REACT_OPTIMISTIC_KEY
1140
+ : key + "," + request);
1251
1141
  props = [REACT_ELEMENT_TYPE, type, request, props];
1252
1142
  task = task.implicitSlot && null !== request ? [props] : props;
1253
1143
  return task;
@@ -1687,7 +1577,7 @@ function renderModelDestructive(
1687
1577
  if (value instanceof Date) return "$D" + value.toJSON();
1688
1578
  request = getPrototypeOf(value);
1689
1579
  if (
1690
- request !== ObjectPrototype &&
1580
+ request !== ObjectPrototype$1 &&
1691
1581
  (null === request || null !== getPrototypeOf(request))
1692
1582
  )
1693
1583
  throw Error(
@@ -1846,12 +1736,11 @@ function emitModelChunk(request, id, json) {
1846
1736
  }
1847
1737
  function emitTypedArrayChunk(request, id, tag, typedArray, debug) {
1848
1738
  debug ? request.pendingDebugChunks++ : request.pendingChunks++;
1849
- debug = new Uint8Array(
1739
+ typedArray = new Uint8Array(
1850
1740
  typedArray.buffer,
1851
1741
  typedArray.byteOffset,
1852
1742
  typedArray.byteLength
1853
1743
  );
1854
- typedArray = 2048 < typedArray.byteLength ? debug.slice() : debug;
1855
1744
  debug = typedArray.byteLength;
1856
1745
  id = id.toString(16) + ":" + tag + debug.toString(16) + ",";
1857
1746
  id = stringToChunk(id);
@@ -2015,7 +1904,7 @@ function finishHaltedTask(task, request) {
2015
1904
  function flushCompletedChunks(request) {
2016
1905
  var destination = request.destination;
2017
1906
  if (null !== destination) {
2018
- currentView = new Uint8Array(2048);
1907
+ currentView = new Uint8Array(4096);
2019
1908
  writtenBytes = 0;
2020
1909
  try {
2021
1910
  for (
@@ -2195,6 +2084,7 @@ function resolveServerReference(bundlerConfig, id) {
2195
2084
  ? [resolvedModuleData.id, resolvedModuleData.chunks, name, 1]
2196
2085
  : [resolvedModuleData.id, resolvedModuleData.chunks, name];
2197
2086
  }
2087
+ var chunkCache = new Map();
2198
2088
  function requireAsyncModule(id) {
2199
2089
  var promise = __webpack_require__(id);
2200
2090
  if ("function" !== typeof promise.then || "fulfilled" === promise.status)
@@ -2215,10 +2105,15 @@ function ignoreReject() {}
2215
2105
  function preloadModule(metadata) {
2216
2106
  for (var chunks = metadata[1], promises = [], i = 0; i < chunks.length; ) {
2217
2107
  var chunkId = chunks[i++];
2218
- i++;
2219
- var thenable = __webpack_chunk_load__(chunkId);
2220
- promises.push(thenable);
2221
- thenable.catch(ignoreReject);
2108
+ chunks[i++];
2109
+ var entry = chunkCache.get(chunkId);
2110
+ if (void 0 === entry) {
2111
+ entry = __webpack_chunk_load__(chunkId);
2112
+ promises.push(entry);
2113
+ var resolve = chunkCache.set.bind(chunkCache, chunkId, null);
2114
+ entry.then(resolve, ignoreReject);
2115
+ chunkCache.set(chunkId, entry);
2116
+ } else null !== entry && promises.push(entry);
2222
2117
  }
2223
2118
  return 4 === metadata.length
2224
2119
  ? 0 === promises.length
@@ -2258,16 +2153,23 @@ ReactPromise.prototype.then = function (resolve, reject) {
2258
2153
  case "fulfilled":
2259
2154
  if ("function" === typeof resolve) {
2260
2155
  for (
2261
- var inspectedValue = this.value, cycleProtection = 0;
2156
+ var inspectedValue = this.value,
2157
+ cycleProtection = 0,
2158
+ visited = new Set();
2262
2159
  inspectedValue instanceof ReactPromise;
2263
2160
 
2264
2161
  ) {
2265
2162
  cycleProtection++;
2266
- if (inspectedValue === this || 1e3 < cycleProtection) {
2163
+ if (
2164
+ inspectedValue === this ||
2165
+ visited.has(inspectedValue) ||
2166
+ 1e3 < cycleProtection
2167
+ ) {
2267
2168
  "function" === typeof reject &&
2268
2169
  reject(Error("Cannot have cyclic thenables."));
2269
2170
  return;
2270
2171
  }
2172
+ visited.add(inspectedValue);
2271
2173
  if ("fulfilled" === inspectedValue.status)
2272
2174
  inspectedValue = inspectedValue.value;
2273
2175
  else break;
@@ -2286,6 +2188,8 @@ ReactPromise.prototype.then = function (resolve, reject) {
2286
2188
  "function" === typeof reject && reject(this.reason);
2287
2189
  }
2288
2190
  };
2191
+ var ObjectPrototype = Object.prototype,
2192
+ ArrayPrototype = Array.prototype;
2289
2193
  function wakeChunk(response, listeners, value) {
2290
2194
  for (var i = 0; i < listeners.length; i++) {
2291
2195
  var listener = listeners[i];
@@ -2598,8 +2502,10 @@ function fulfillReference(response, reference, value) {
2598
2502
  var name = path[i];
2599
2503
  if (
2600
2504
  "object" !== typeof value ||
2601
- !hasOwnProperty.call(value, name) ||
2602
- value instanceof Promise
2505
+ null === value ||
2506
+ (getPrototypeOf(value) !== ObjectPrototype &&
2507
+ getPrototypeOf(value) !== ArrayPrototype) ||
2508
+ !hasOwnProperty.call(value, name)
2603
2509
  )
2604
2510
  throw Error("Invalid reference.");
2605
2511
  value = value[name];
@@ -2647,8 +2553,10 @@ function getOutlinedModel(response, reference, parentObject, key, map) {
2647
2553
  var name = reference[i];
2648
2554
  if (
2649
2555
  "object" !== typeof id ||
2650
- !hasOwnProperty.call(id, name) ||
2651
- id instanceof Promise
2556
+ null === id ||
2557
+ (getPrototypeOf(id) !== ObjectPrototype &&
2558
+ getPrototypeOf(id) !== ArrayPrototype) ||
2559
+ !hasOwnProperty.call(id, name)
2652
2560
  )
2653
2561
  throw Error("Invalid reference.");
2654
2562
  id = id[name];
@@ -3094,9 +3002,17 @@ function decodeBoundActionMetaData(body, serverManifest, formFieldPrefix) {
3094
3002
  if ("fulfilled" !== body.status) throw body.reason;
3095
3003
  return body.value;
3096
3004
  }
3097
- exports.createClientModuleProxy = function (moduleId) {
3098
- moduleId = registerClientReferenceImpl({}, moduleId, !1);
3099
- return new Proxy(moduleId, proxyHandlers$1);
3005
+ exports.createServerEntry = function (value, resource) {
3006
+ var entryJsFiles = __rspack_rsc_manifest__.entryJsFiles || [],
3007
+ entryCssFiles = __rspack_rsc_manifest__.entryCssFiles[resource] || [];
3008
+ ("function" === typeof value ||
3009
+ ("object" === typeof value && null !== value)) &&
3010
+ assign(value, {
3011
+ resource: resource,
3012
+ entryJsFiles: entryJsFiles,
3013
+ entryCssFiles: entryCssFiles
3014
+ });
3015
+ return value;
3100
3016
  };
3101
3017
  exports.createTemporaryReferenceSet = function () {
3102
3018
  return new WeakMap();
@@ -3138,27 +3054,23 @@ exports.decodeFormState = function (actionResult, body, serverManifest) {
3138
3054
  : [actionResult, keyPath, referenceId, bound.length - 1];
3139
3055
  });
3140
3056
  };
3141
- exports.decodeReply = function (body, webpackMap, options) {
3057
+ exports.decodeReply = function (body, options) {
3142
3058
  if ("string" === typeof body) {
3143
3059
  var form = new FormData();
3144
3060
  form.append("0", body);
3145
3061
  body = form;
3146
3062
  }
3147
3063
  body = createResponse(
3148
- webpackMap,
3064
+ __rspack_rsc_manifest__.serverManifest,
3149
3065
  "",
3150
3066
  options ? options.temporaryReferences : void 0,
3151
3067
  body
3152
3068
  );
3153
- webpackMap = getChunk(body, 0);
3069
+ options = getChunk(body, 0);
3154
3070
  close(body);
3155
- return webpackMap;
3071
+ return options;
3156
3072
  };
3157
- exports.decodeReplyFromAsyncIterable = function (
3158
- iterable,
3159
- webpackMap,
3160
- options
3161
- ) {
3073
+ exports.decodeReplyFromAsyncIterable = function (iterable, options) {
3162
3074
  function progress(entry) {
3163
3075
  if (entry.done) close(response);
3164
3076
  else {
@@ -3185,21 +3097,62 @@ exports.decodeReplyFromAsyncIterable = function (
3185
3097
  }
3186
3098
  var iterator = iterable[ASYNC_ITERATOR](),
3187
3099
  response = createResponse(
3188
- webpackMap,
3100
+ __rspack_rsc_manifest__.serverManifest,
3189
3101
  "",
3190
3102
  options ? options.temporaryReferences : void 0
3191
3103
  );
3192
3104
  iterator.next().then(progress, error);
3193
3105
  return getChunk(response, 0);
3194
3106
  };
3195
- exports.prerender = function (model, webpackMap, options) {
3107
+ exports.decryptServerActionBoundArgs = function (actionId, encryptedPromise) {
3108
+ return currentStrategy.decrypt(actionId, encryptedPromise);
3109
+ };
3110
+ exports.encryptServerActionBoundArgs = function (actionId) {
3111
+ for (
3112
+ var _currentStrategy,
3113
+ _len2 = arguments.length,
3114
+ args = Array(1 < _len2 ? _len2 - 1 : 0),
3115
+ _key2 = 1;
3116
+ _key2 < _len2;
3117
+ _key2++
3118
+ )
3119
+ args[_key2 - 1] = arguments[_key2];
3120
+ return (_currentStrategy = currentStrategy).encrypt.apply(
3121
+ _currentStrategy,
3122
+ [actionId].concat(args)
3123
+ );
3124
+ };
3125
+ exports.ensureServerActions = function (actions) {
3126
+ for (var i = 0; i < actions.length; i++) {
3127
+ var action = actions[i];
3128
+ if ("function" !== typeof action)
3129
+ throw Error(
3130
+ 'A "use server" file can only export async functions, found ' +
3131
+ typeof action +
3132
+ "."
3133
+ );
3134
+ }
3135
+ };
3136
+ exports.loadServerAction = function (actionId) {
3137
+ var actionModId = __rspack_rsc_manifest__.serverManifest[actionId].id;
3138
+ if (!actionModId)
3139
+ throw Error(
3140
+ 'Failed to find Server Action "' +
3141
+ actionId +
3142
+ '". This request might be from an older or newer deployment.'
3143
+ );
3144
+ actionId = __webpack_require__(actionModId)[actionId];
3145
+ if ("function" !== typeof actionId)
3146
+ throw Error("Server actions must be functions");
3147
+ return actionId;
3148
+ };
3149
+ exports.prerender = function (model, options) {
3196
3150
  return new Promise(function (resolve, reject) {
3197
3151
  var request = new RequestInstance(
3198
3152
  21,
3199
3153
  model,
3200
- webpackMap,
3154
+ __rspack_rsc_manifest__.clientManifest,
3201
3155
  options ? options.onError : void 0,
3202
- options ? options.onPostpone : void 0,
3203
3156
  function () {
3204
3157
  var stream = new ReadableStream(
3205
3158
  {
@@ -3239,11 +3192,11 @@ exports.registerClientReference = function (
3239
3192
  id,
3240
3193
  exportName
3241
3194
  ) {
3242
- return registerClientReferenceImpl(
3243
- proxyImplementation,
3244
- id + "#" + exportName,
3245
- !1
3246
- );
3195
+ return Object.defineProperties(proxyImplementation, {
3196
+ $$typeof: { value: CLIENT_REFERENCE_TAG$1 },
3197
+ $$id: { value: id + "#" + exportName },
3198
+ $$async: { value: !1 }
3199
+ });
3247
3200
  };
3248
3201
  exports.registerServerReference = function (reference, id, exportName) {
3249
3202
  return Object.defineProperties(reference, {
@@ -3257,13 +3210,12 @@ exports.registerServerReference = function (reference, id, exportName) {
3257
3210
  toString: serverReferenceToString
3258
3211
  });
3259
3212
  };
3260
- exports.renderToReadableStream = function (model, webpackMap, options) {
3213
+ exports.renderToReadableStream = function (model, options) {
3261
3214
  var request = new RequestInstance(
3262
3215
  20,
3263
3216
  model,
3264
- webpackMap,
3217
+ __rspack_rsc_manifest__.clientManifest,
3265
3218
  options ? options.onError : void 0,
3266
- options ? options.onPostpone : void 0,
3267
3219
  noop,
3268
3220
  noop,
3269
3221
  options ? options.identifierPrefix : void 0,
@@ -3297,3 +3249,6 @@ exports.renderToReadableStream = function (model, webpackMap, options) {
3297
3249
  { highWaterMark: 0 }
3298
3250
  );
3299
3251
  };
3252
+ exports.setServerActionBoundArgsEncryption = function (strategy) {
3253
+ currentStrategy = strategy;
3254
+ };