-
Notifications
You must be signed in to change notification settings - Fork 26.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server Action tests #62655
Server Action tests #62655
Conversation
This PR improves the Server Actions SWC transform to make it able to handle nested Action declarations (check `fixture/server-actions/server/28/input.js` for more details). It is also a simplification of that transform's internal states and methods, with the removal of an extra AST pass (`stmts.visit_mut_with(&mut ClosureActionReplacer { replaced_action_proxies: &self.replaced_action_proxies, })`). The generated code is also smaller in some cases. So overall I'd expect the compilation and runtime performance to improve as well. ## Details With this change, we're now using `self.declared_idents` and `self.names` to track closure arguments. `declared_idents` keeps the identifiers **declared** in the current closure and above. `names` keeps identifiers **appeared** in the current closure and above. In an example of the following cursor: ```ts let x async function foo() { "use server" let y async function bar() { "use server" let z console.log(x, y, z) } // <- cursor } ``` `declared_idents` would be `y` (`x` isn't in a closure), and `names` would be `x, y, z`. By manipulating these two states we're able to track closure closed-up variables recursively. Closes NEXT-2189
When we apply `createActionProxy` twice to the same value, it currently errors because we can't override the ID of it. This PR makes sure that 1) when the value already have an ID defined, we skip setting it again; 2) all the action IDs are being tracked even for duplicated ones. Note that it's technically impossible to "detect" the duplication here (via static analyzation) and only set it once. For example: ```ts 'use server' export async function foo () {} export const bar = a_value_we_dont_know_yet ? foo : async () => {} ``` So, the compiler will always wrap `createActionProxy` for every exported value and assume they're different Server Actions (hence different IDs). With this fix, if we find that it's already defined before, we just return the defined reference as they're strictly identical so the ID does't matter. Closes vercel#54655, closes vercel#61183. Closes NEXT-2264
This fills the last piece in the puzzle and it's based on vercel#61001. In "use server" file. And this PR extends that to a "use server" file so exported values are automatically handled just like before, but any other definitions including nested ones will be hoisted and marked correctly now. ```ts 'use server' let a, f export async function action0(b, c, ...g) { // <- Handled like before. return async function action1(d) { // <- Renamed, marked and hoisted. 'use server' let f console.log(...window, { window }) console.log(a, b, action2) async function action2(e) { // <- Renamed, marked and hoisted. 'use server' console.log(a, c, d, e, f, g) } return [ action2, async function action3(e) { // <- Renamed, marked and hoisted. 'use server' action2(e) console.log(a, c, d, e) }, ] } } ``` Closes NEXT-2491
…ercel#62437) With Server Actions, a module-level encryption can happen when you do: ```js function wrapAction(value) { return async function () { 'use server' console.log(value) } } const action = wrapAction('some-module-level-encryption-value') ``` ...as that action will be created when requiring this module, and it contains an encrypted argument from its closure (`value`). This currently throws an error during build: ``` Error: Missing manifest for Server Actions. This is a bug in Next.js at d (/Users/shu/Documents/git/next.js/test/e2e/app-dir/actions/.next/server/chunks/1772.js:1:15202) at f (/Users/shu/Documents/git/next.js/test/e2e/app-dir/actions/.next/server/chunks/1772.js:1:16917) at 714 (/Users/shu/Documents/git/next.js/test/e2e/app-dir/actions/.next/server/app/encryption/page.js:1:2806) at t (/Users/shu/Documents/git/next.js/test/e2e/app-dir/actions/.next/server/webpack-runtime.js:1:127) at 7940 (/Users/shu/Documents/git/next.js/test/e2e/app-dir/actions/.next/server/app/encryption/page.js:1:941) at t (/Users/shu/Documents/git/next.js/test/e2e/app-dir/actions/.next/server/webpack-runtime.js:1:127) at r (/Users/shu/Documents/git/next.js/test/e2e/app-dir/actions/.next/server/app/encryption/page.js:1:4529) at /Users/shu/Documents/git/next.js/test/e2e/app-dir/actions/.next/server/app/encryption/page.js:1:4572 at t.X (/Users/shu/Documents/git/next.js/test/e2e/app-dir/actions/.next/server/webpack-runtime.js:1:1181) at /Users/shu/Documents/git/next.js/test/e2e/app-dir/actions/.next/server/app/encryption/page.js:1:4542 ``` Because during module require phase, the encryption logic can't run as it doesn't have Server/Client references available yet (which are set during the rendering phase). Since both references are global singletons to the server and are already loaded early, this fix makes sure that they're registered via `setReferenceManifestsSingleton` before requiring the module. Closes NEXT-2579
9163e65
to
8fe0a36
Compare
Stats from current PRDefault Build (Increase detected
|
vercel/next.js canary | MaxLeiter/next.js max/14-1-patches | Change | |
---|---|---|---|
buildDuration | 12.7s | 12.8s | N/A |
buildDurationCached | 7.7s | 6.1s | N/A |
nodeModulesSize | 197 MB | 200 MB | |
nextStartRea..uration (ms) | 429ms | 433ms | N/A |
Client Bundles (main, webpack)
vercel/next.js canary | MaxLeiter/next.js max/14-1-patches | Change | |
---|---|---|---|
304.HASH.js gzip | 181 B | 182 B | N/A |
3f784ff6-HASH.js gzip | 53.6 kB | 53.4 kB | N/A |
453-HASH.js gzip | 30.5 kB | 29.1 kB | N/A |
framework-HASH.js gzip | 45.2 kB | 45.2 kB | ✓ |
main-app-HASH.js gzip | 239 B | 241 B | N/A |
main-HASH.js gzip | 32 kB | 31.8 kB | N/A |
webpack-HASH.js gzip | 1.7 kB | 1.7 kB | N/A |
Overall change | 45.2 kB | 45.2 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | MaxLeiter/next.js max/14-1-patches | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 31 kB | 31 kB | N/A |
Overall change | 0 B | 0 B | ✓ |
Client Pages
vercel/next.js canary | MaxLeiter/next.js max/14-1-patches | Change | |
---|---|---|---|
_app-HASH.js gzip | 195 B | 195 B | ✓ |
_error-HASH.js gzip | 182 B | 181 B | N/A |
amp-HASH.js gzip | 503 B | 502 B | N/A |
css-HASH.js gzip | 322 B | 321 B | N/A |
dynamic-HASH.js gzip | 2.5 kB | 2.5 kB | ✓ |
edge-ssr-HASH.js gzip | 255 B | 253 B | N/A |
head-HASH.js gzip | 350 B | 349 B | N/A |
hooks-HASH.js gzip | 368 B | 369 B | N/A |
image-HASH.js gzip | 4.2 kB | 4.18 kB | N/A |
index-HASH.js gzip | 256 B | 256 B | ✓ |
link-HASH.js gzip | 2.67 kB | 2.61 kB | N/A |
routerDirect..HASH.js gzip | 312 B | 311 B | N/A |
script-HASH.js gzip | 384 B | 383 B | N/A |
withRouter-HASH.js gzip | 307 B | 308 B | N/A |
1afbb74e6ecf..834.css gzip | 106 B | 106 B | ✓ |
Overall change | 3.06 kB | 3.06 kB | ✓ |
Client Build Manifests
vercel/next.js canary | MaxLeiter/next.js max/14-1-patches | Change | |
---|---|---|---|
_buildManifest.js gzip | 482 B | 485 B | N/A |
Overall change | 0 B | 0 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | MaxLeiter/next.js max/14-1-patches | Change | |
---|---|---|---|
index.html gzip | 528 B | 526 B | N/A |
link.html gzip | 540 B | 539 B | N/A |
withRouter.html gzip | 524 B | 522 B | N/A |
Overall change | 0 B | 0 B | ✓ |
Edge SSR bundle Size
vercel/next.js canary | MaxLeiter/next.js max/14-1-patches | Change | |
---|---|---|---|
edge-ssr.js gzip | 95.1 kB | 94 kB | N/A |
page.js gzip | 127 kB | 124 kB | N/A |
Overall change | 0 B | 0 B | ✓ |
Middleware size Overall increase ⚠️
vercel/next.js canary | MaxLeiter/next.js max/14-1-patches | Change | |
---|---|---|---|
middleware-b..fest.js gzip | 624 B | 625 B | N/A |
middleware-r..fest.js gzip | 151 B | 151 B | ✓ |
middleware.js gzip | 25.4 kB | 37.5 kB | |
edge-runtime..pack.js gzip | 839 B | 1.92 kB | |
Overall change | 26.4 kB | 39.6 kB |
Next Runtimes Overall increase ⚠️
vercel/next.js canary | MaxLeiter/next.js max/14-1-patches | Change | |
---|---|---|---|
app-page-exp...dev.js gzip | 171 kB | 169 kB | N/A |
app-page-exp..prod.js gzip | 96.7 kB | 95.6 kB | N/A |
app-page-tur..prod.js gzip | 98.5 kB | 96.3 kB | N/A |
app-page-tur..prod.js gzip | 92.9 kB | 90.9 kB | N/A |
app-page.run...dev.js gzip | 150 kB | 142 kB | N/A |
app-page.run..prod.js gzip | 91.4 kB | 90.2 kB | N/A |
app-route-ex...dev.js gzip | 21.3 kB | 24.2 kB | |
app-route-ex..prod.js gzip | 15 kB | 16.8 kB | |
app-route-tu..prod.js gzip | 15 kB | 16.8 kB | |
app-route-tu..prod.js gzip | 14.8 kB | 16.4 kB | |
app-route.ru...dev.js gzip | 20.9 kB | 23.6 kB | |
app-route.ru..prod.js gzip | 14.8 kB | 16.4 kB | |
pages-api-tu..prod.js gzip | 9.51 kB | 9.39 kB | N/A |
pages-api.ru...dev.js gzip | 9.79 kB | 9.67 kB | N/A |
pages-api.ru..prod.js gzip | 9.51 kB | 9.39 kB | N/A |
pages-turbo...prod.js gzip | 22.3 kB | 22 kB | N/A |
pages.runtim...dev.js gzip | 23 kB | 22.6 kB | N/A |
pages.runtim..prod.js gzip | 22.3 kB | 22 kB | N/A |
server.runti..prod.js gzip | 50.6 kB | 49.8 kB | N/A |
Overall change | 102 kB | 114 kB |
Diff details
Diff for page.js
Diff too large to display
Diff for edge-runtime-webpack.js
@@ -46,12 +46,6 @@
/******/ __webpack_require__.m = __webpack_modules__;
/******/
/************************************************************************/
- /******/ /* webpack/runtime/amd options */
- /******/ (() => {
- /******/ __webpack_require__.amdO = {};
- /******/
- })();
- /******/
/******/ /* webpack/runtime/chunk loaded */
/******/ (() => {
/******/ var deferred = [];
Diff for middleware.js
Diff too large to display
Diff for edge-ssr.js
Diff too large to display
Diff for dynamic-HASH.js
@@ -1,7 +1,7 @@
(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
[739],
{
- /***/ 8484: /***/ function (
+ /***/ 9816: /***/ function (
__unused_webpack_module,
__unused_webpack_exports,
__webpack_require__
@@ -9,7 +9,7 @@
(window.__NEXT_P = window.__NEXT_P || []).push([
"/dynamic",
function () {
- return __webpack_require__(4281);
+ return __webpack_require__(6222);
},
]);
if (false) {
@@ -18,7 +18,7 @@
/***/
},
- /***/ 3228: /***/ function (module, exports, __webpack_require__) {
+ /***/ 3943: /***/ function (module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
@@ -36,22 +36,17 @@
noSSR: function () {
return noSSR;
},
- /**
- * This function lets you dynamically import a component.
- * It uses [React.lazy()](https://react.dev/reference/react/lazy) with [Suspense](https://react.dev/reference/react/Suspense) under the hood.
- *
- * Read more: [Next.js Docs: `next/dynamic`](https://nextjs.org/docs/app/building-your-application/optimizing/lazy-loading#nextdynamic)
- */ default: function () {
+ default: function () {
return dynamic;
},
});
- const _interop_require_default = __webpack_require__(2430);
+ const _interop_require_default = __webpack_require__(1351);
const _jsxruntime = __webpack_require__(1527);
const _react = /*#__PURE__*/ _interop_require_default._(
__webpack_require__(959)
);
const _loadablesharedruntime = /*#__PURE__*/ _interop_require_default._(
- __webpack_require__(1091)
+ __webpack_require__(3191)
);
const isServerSide = "object" === "undefined";
// Normalize loader to return the module as form { default: Component } for `React.lazy`.
@@ -152,7 +147,7 @@
/***/
},
- /***/ 2281: /***/ function (
+ /***/ 4363: /***/ function (
__unused_webpack_module,
exports,
__webpack_require__
@@ -168,7 +163,7 @@
return LoadableContext;
},
});
- const _interop_require_default = __webpack_require__(2430);
+ const _interop_require_default = __webpack_require__(1351);
const _react = /*#__PURE__*/ _interop_require_default._(
__webpack_require__(959)
);
@@ -179,7 +174,7 @@
/***/
},
- /***/ 1091: /***/ function (
+ /***/ 3191: /***/ function (
__unused_webpack_module,
exports,
__webpack_require__
@@ -217,11 +212,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
return _default;
},
});
- const _interop_require_default = __webpack_require__(2430);
+ const _interop_require_default = __webpack_require__(1351);
const _react = /*#__PURE__*/ _interop_require_default._(
__webpack_require__(959)
);
- const _loadablecontextsharedruntime = __webpack_require__(2281);
+ const _loadablecontextsharedruntime = __webpack_require__(4363);
function resolve(obj) {
return obj && obj.default ? obj.default : obj;
}
@@ -456,7 +451,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
/***/
},
- /***/ 4281: /***/ function (
+ /***/ 6222: /***/ function (
__unused_webpack_module,
__webpack_exports__,
__webpack_require__
@@ -472,7 +467,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(1527);
/* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_1__ =
- __webpack_require__(5620);
+ __webpack_require__(4438);
/* harmony import */ var next_dynamic__WEBPACK_IMPORTED_MODULE_1___default =
/*#__PURE__*/ __webpack_require__.n(
next_dynamic__WEBPACK_IMPORTED_MODULE_1__
@@ -481,11 +476,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
const DynamicHello = next_dynamic__WEBPACK_IMPORTED_MODULE_1___default()(
() =>
__webpack_require__
- .e(/* import() */ 304)
- .then(__webpack_require__.bind(__webpack_require__, 3304)),
+ .e(/* import() */ 18)
+ .then(__webpack_require__.bind(__webpack_require__, 6018)),
{
loadableGenerated: {
- webpack: () => [/*require.resolve*/ 3304],
+ webpack: () => [/*require.resolve*/ 6018],
},
}
);
@@ -512,12 +507,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
/***/
},
- /***/ 5620: /***/ function (
+ /***/ 4438: /***/ function (
module,
__unused_webpack_exports,
__webpack_require__
) {
- module.exports = __webpack_require__(3228);
+ module.exports = __webpack_require__(3943);
/***/
},
@@ -528,7 +523,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
return __webpack_require__((__webpack_require__.s = moduleId));
};
/******/ __webpack_require__.O(0, [888, 774, 179], function () {
- return __webpack_exec__(8484);
+ return __webpack_exec__(9816);
});
/******/ var __webpack_exports__ = __webpack_require__.O();
/******/ _N_E = __webpack_exports__;
Diff for image-HASH.js
@@ -1,7 +1,7 @@
(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
[358],
{
- /***/ 1552: /***/ function (
+ /***/ 4070: /***/ function (
__unused_webpack_module,
__unused_webpack_exports,
__webpack_require__
@@ -9,7 +9,7 @@
(window.__NEXT_P = window.__NEXT_P || []).push([
"/image",
function () {
- return __webpack_require__(5237);
+ return __webpack_require__(3697);
},
]);
if (false) {
@@ -18,7 +18,7 @@
/***/
},
- /***/ 2016: /***/ function (module, exports, __webpack_require__) {
+ /***/ 2353: /***/ function (module, exports, __webpack_require__) {
"use strict";
/* __next_internal_client_entry_do_not_use__ cjs */
Object.defineProperty(exports, "__esModule", {
@@ -30,8 +30,8 @@
return Image;
},
});
- const _interop_require_default = __webpack_require__(2430);
- const _interop_require_wildcard = __webpack_require__(1778);
+ const _interop_require_default = __webpack_require__(1351);
+ const _interop_require_wildcard = __webpack_require__(5815);
const _jsxruntime = __webpack_require__(1527);
const _react = /*#__PURE__*/ _interop_require_wildcard._(
__webpack_require__(959)
@@ -40,15 +40,15 @@
__webpack_require__(422)
);
const _head = /*#__PURE__*/ _interop_require_default._(
- __webpack_require__(6074)
+ __webpack_require__(2272)
);
- const _getimgprops = __webpack_require__(9571);
- const _imageconfig = __webpack_require__(6567);
- const _imageconfigcontextsharedruntime = __webpack_require__(419);
- const _warnonce = __webpack_require__(4486);
- const _routercontextsharedruntime = __webpack_require__(162);
+ const _getimgprops = __webpack_require__(2530);
+ const _imageconfig = __webpack_require__(4899);
+ const _imageconfigcontextsharedruntime = __webpack_require__(9292);
+ const _warnonce = __webpack_require__(4213);
+ const _routercontextsharedruntime = __webpack_require__(7084);
const _imageloader = /*#__PURE__*/ _interop_require_default._(
- __webpack_require__(6996)
+ __webpack_require__(7443)
);
// This is replaced by webpack define plugin
const configEnv = {
@@ -69,8 +69,7 @@
onLoadRef,
onLoadingCompleteRef,
setBlurComplete,
- unoptimized,
- sizesInput
+ unoptimized
) {
const src = img == null ? void 0 : img.src;
if (!img || img["data-loaded-src"] === src) {
@@ -166,7 +165,6 @@
onLoadingCompleteRef,
setBlurComplete,
setShowAltText,
- sizesInput,
onLoad,
onError,
...rest
@@ -221,8 +219,7 @@
onLoadRef,
onLoadingCompleteRef,
setBlurComplete,
- unoptimized,
- sizesInput
+ unoptimized
);
}
},
@@ -234,7 +231,6 @@
setBlurComplete,
onError,
unoptimized,
- sizesInput,
forwardedRef,
]
),
@@ -246,8 +242,7 @@
onLoadRef,
onLoadingCompleteRef,
setBlurComplete,
- unoptimized,
- sizesInput
+ unoptimized
);
},
onError: (event) => {
@@ -351,7 +346,6 @@
onLoadingCompleteRef: onLoadingCompleteRef,
setBlurComplete: setBlurComplete,
setShowAltText: setShowAltText,
- sizesInput: props.sizes,
ref: forwardedRef,
}),
imgMeta.priority
@@ -379,7 +373,7 @@
/***/
},
- /***/ 9571: /***/ function (
+ /***/ 2530: /***/ function (
__unused_webpack_module,
exports,
__webpack_require__
@@ -395,9 +389,9 @@
return getImgProps;
},
});
- const _warnonce = __webpack_require__(4486);
- const _imageblursvg = __webpack_require__(133);
- const _imageconfig = __webpack_require__(6567);
+ const _warnonce = __webpack_require__(4213);
+ const _imageblursvg = __webpack_require__(3139);
+ const _imageconfig = __webpack_require__(4899);
const VALID_LOADING_VALUES =
/* unused pure expression or super */ null && [
"lazy",
@@ -766,7 +760,7 @@
/***/
},
- /***/ 133: /***/ function (__unused_webpack_module, exports) {
+ /***/ 3139: /***/ function (__unused_webpack_module, exports) {
"use strict";
/**
* A shared function, used on both client and server, to generate a SVG blur placeholder.
@@ -821,7 +815,7 @@
/***/
},
- /***/ 4085: /***/ function (
+ /***/ 3067: /***/ function (
__unused_webpack_module,
exports,
__webpack_require__
@@ -847,13 +841,13 @@
return _default;
},
});
- const _interop_require_default = __webpack_require__(2430);
- const _getimgprops = __webpack_require__(9571);
- const _imagecomponent = __webpack_require__(2016);
+ const _interop_require_default = __webpack_require__(1351);
+ const _getimgprops = __webpack_require__(2530);
+ const _imagecomponent = __webpack_require__(2353);
const _imageloader = /*#__PURE__*/ _interop_require_default._(
- __webpack_require__(6996)
+ __webpack_require__(7443)
);
- function getImageProps(imgProps) {
+ const getImageProps = (imgProps) => {
const { props } = (0, _getimgprops.getImgProps)(imgProps, {
defaultLoader: _imageloader.default,
// This is replaced by webpack define plugin
@@ -877,13 +871,13 @@
return {
props,
};
- }
+ };
const _default = _imagecomponent.Image; //# sourceMappingURL=image-external.js.map
/***/
},
- /***/ 6996: /***/ function (__unused_webpack_module, exports) {
+ /***/ 7443: /***/ function (__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
@@ -918,7 +912,7 @@
/***/
},
- /***/ 5237: /***/ function (
+ /***/ 3697: /***/ function (
__unused_webpack_module,
__webpack_exports__,
__webpack_require__
@@ -939,8 +933,8 @@
// EXTERNAL MODULE: ./node_modules/.pnpm/[email protected]/node_modules/react/jsx-runtime.js
var jsx_runtime = __webpack_require__(1527);
- // EXTERNAL MODULE: ./node_modules/.pnpm/[email protected][email protected]/node_modules/next/image.js
- var next_image = __webpack_require__(1577);
+ // EXTERNAL MODULE: ./node_modules/.pnpm/[email protected][email protected]/node_modules/next/image.js
+ var next_image = __webpack_require__(73);
var image_default = /*#__PURE__*/ __webpack_require__.n(next_image); // CONCATENATED MODULE: ./pages/nextjs.png
/* harmony default export */ var nextjs = {
src: "/_next/static/media/nextjs.cae0b805.png",
@@ -970,12 +964,12 @@
/***/
},
- /***/ 1577: /***/ function (
+ /***/ 73: /***/ function (
module,
__unused_webpack_exports,
__webpack_require__
) {
- module.exports = __webpack_require__(4085);
+ module.exports = __webpack_require__(3067);
/***/
},
@@ -986,7 +980,7 @@
return __webpack_require__((__webpack_require__.s = moduleId));
};
/******/ __webpack_require__.O(0, [888, 774, 179], function () {
- return __webpack_exec__(1552);
+ return __webpack_exec__(4070);
});
/******/ var __webpack_exports__ = __webpack_require__.O();
/******/ _N_E = __webpack_exports__;
Diff for link-HASH.js
@@ -1,7 +1,7 @@
(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
[644],
{
- /***/ 1794: /***/ function (
+ /***/ 8959: /***/ function (
__unused_webpack_module,
__unused_webpack_exports,
__webpack_require__
@@ -9,7 +9,7 @@
(window.__NEXT_P = window.__NEXT_P || []).push([
"/link",
function () {
- return __webpack_require__(2378);
+ return __webpack_require__(3071);
},
]);
if (false) {
@@ -18,7 +18,7 @@
/***/
},
- /***/ 5435: /***/ function (module, exports) {
+ /***/ 6589: /***/ function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
@@ -36,9 +36,6 @@
PrefetchKind: function () {
return PrefetchKind;
},
- PrefetchCacheEntryStatus: function () {
- return PrefetchCacheEntryStatus;
- },
ACTION_REFRESH: function () {
return ACTION_REFRESH;
},
@@ -77,13 +74,6 @@
PrefetchKind["FULL"] = "full";
PrefetchKind["TEMPORARY"] = "temporary";
})(PrefetchKind || (PrefetchKind = {}));
- var PrefetchCacheEntryStatus;
- (function (PrefetchCacheEntryStatus) {
- PrefetchCacheEntryStatus["fresh"] = "fresh";
- PrefetchCacheEntryStatus["reusable"] = "reusable";
- PrefetchCacheEntryStatus["expired"] = "expired";
- PrefetchCacheEntryStatus["stale"] = "stale";
- })(PrefetchCacheEntryStatus || (PrefetchCacheEntryStatus = {}));
function isThenable(value) {
// TODO: We don't gain anything from this abstraction. It's unsound, and only
// makes sense in the specific places where we use it. So it's better to keep
@@ -110,7 +100,7 @@
/***/
},
- /***/ 742: /***/ function (module, exports, __webpack_require__) {
+ /***/ 8428: /***/ function (module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
@@ -122,7 +112,7 @@
return getDomainLocale;
},
});
- const _normalizetrailingslash = __webpack_require__(9515);
+ const _normalizetrailingslash = __webpack_require__(6465);
const basePath =
/* unused pure expression or super */ null && (false || "");
function getDomainLocale(path, locale, locales, domainLocales) {
@@ -146,7 +136,7 @@
/***/
},
- /***/ 7569: /***/ function (module, exports, __webpack_require__) {
+ /***/ 1706: /***/ function (module, exports, __webpack_require__) {
"use strict";
/* __next_internal_client_entry_do_not_use__ cjs */
Object.defineProperty(exports, "__esModule", {
@@ -158,22 +148,22 @@
return _default;
},
});
- const _interop_require_default = __webpack_require__(2430);
+ const _interop_require_default = __webpack_require__(1351);
const _jsxruntime = __webpack_require__(1527);
const _react = /*#__PURE__*/ _interop_require_default._(
__webpack_require__(959)
);
- const _resolvehref = __webpack_require__(3433);
- const _islocalurl = __webpack_require__(5594);
- const _formaturl = __webpack_require__(1357);
- const _utils = __webpack_require__(1784);
- const _addlocale = __webpack_require__(866);
- const _routercontextsharedruntime = __webpack_require__(162);
- const _approutercontextsharedruntime = __webpack_require__(853);
- const _useintersection = __webpack_require__(1462);
- const _getdomainlocale = __webpack_require__(742);
- const _addbasepath = __webpack_require__(9110);
- const _routerreducertypes = __webpack_require__(5435);
+ const _resolvehref = __webpack_require__(1221);
+ const _islocalurl = __webpack_require__(244);
+ const _formaturl = __webpack_require__(6076);
+ const _utils = __webpack_require__(266);
+ const _addlocale = __webpack_require__(8057);
+ const _routercontextsharedruntime = __webpack_require__(7084);
+ const _approutercontextsharedruntime = __webpack_require__(5171);
+ const _useintersection = __webpack_require__(9058);
+ const _getdomainlocale = __webpack_require__(8428);
+ const _addbasepath = __webpack_require__(8261);
+ const _routerreducertypes = __webpack_require__(6589);
const prefetched = new Set();
function prefetch(router, href, as, options, appOptions, isAppRouter) {
if (false) {
@@ -274,12 +264,7 @@
return (0, _formaturl.formatUrl)(urlObjOrString);
}
/**
- * A React component that extends the HTML `<a>` element to provide [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)
- * and client-side navigation between routes.
- *
- * It is the primary way to navigate between routes in Next.js.
- *
- * Read more: [Next.js docs: `<Link>`](https://nextjs.org/docs/app/api-reference/components/link)
+ * React Component that enables client-side transitions between routes.
*/ const Link = /*#__PURE__*/ _react.default.forwardRef(
function LinkComponent(props, forwardedRef) {
let children;
@@ -494,44 +479,39 @@
isAppRouter
);
},
- onTouchStart: false
- ? 0
- : function onTouchStart(e) {
- if (
- !legacyBehavior &&
- typeof onTouchStartProp === "function"
- ) {
- onTouchStartProp(e);
- }
- if (
- legacyBehavior &&
- child.props &&
- typeof child.props.onTouchStart === "function"
- ) {
- child.props.onTouchStart(e);
- }
- if (!router) {
- return;
- }
- if (!prefetchEnabled && isAppRouter) {
- return;
- }
- prefetch(
- router,
- href,
- as,
- {
- locale,
- priority: true,
- // @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
- bypassPrefetchedCheck: true,
- },
- {
- kind: appPrefetchKind,
- },
- isAppRouter
- );
+ onTouchStart(e) {
+ if (!legacyBehavior && typeof onTouchStartProp === "function") {
+ onTouchStartProp(e);
+ }
+ if (
+ legacyBehavior &&
+ child.props &&
+ typeof child.props.onTouchStart === "function"
+ ) {
+ child.props.onTouchStart(e);
+ }
+ if (!router) {
+ return;
+ }
+ if (!prefetchEnabled && isAppRouter) {
+ return;
+ }
+ prefetch(
+ router,
+ href,
+ as,
+ {
+ locale,
+ priority: true,
+ // @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
+ bypassPrefetchedCheck: true,
},
+ {
+ kind: appPrefetchKind,
+ },
+ isAppRouter
+ );
+ },
};
// If child is an <a> tag and doesn't have a href attribute, or if the 'passHref' property is
// defined, we specify the current 'href', so that repetition is not needed by the user.
@@ -594,7 +574,7 @@
/***/
},
- /***/ 1462: /***/ function (module, exports, __webpack_require__) {
+ /***/ 9058: /***/ function (module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
@@ -607,7 +587,7 @@
},
});
const _react = __webpack_require__(959);
- const _requestidlecallback = __webpack_require__(3921);
+ const _requestidlecallback = __webpack_require__(9265);
const hasIntersectionObserver =
typeof IntersectionObserver === "function";
const observers = new Map();
@@ -720,7 +700,7 @@
/***/
},
- /***/ 2378: /***/ function (
+ /***/ 3071: /***/ function (
__unused_webpack_module,
__webpack_exports__,
__webpack_require__
@@ -736,7 +716,7 @@
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
__webpack_require__(1527);
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1__ =
- __webpack_require__(3639);
+ __webpack_require__(2075);
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1___default =
/*#__PURE__*/ __webpack_require__.n(
next_link__WEBPACK_IMPORTED_MODULE_1__
@@ -767,12 +747,12 @@
/***/
},
- /***/ 3639: /***/ function (
+ /***/ 2075: /***/ function (
module,
__unused_webpack_exports,
__webpack_require__
) {
- module.exports = __webpack_require__(7569);
+ module.exports = __webpack_require__(1706);
/***/
},
@@ -783,7 +763,7 @@
return __webpack_require__((__webpack_require__.s = moduleId));
};
/******/ __webpack_require__.O(0, [888, 774, 179], function () {
- return __webpack_exec__(1794);
+ return __webpack_exec__(8959);
});
/******/ var __webpack_exports__ = __webpack_require__.O();
/******/ _N_E = __webpack_exports__;
Diff for 3f784ff6-HASH.js
Diff too large to display
Diff for 453-HASH.js
Diff too large to display
Diff for main-HASH.js
Diff too large to display
Diff for polyfills-HASH.js
Diff too large to display
Diff for webpack-HASH.js
@@ -219,7 +219,7 @@
/******/ __webpack_require__.u = function (chunkId) {
/******/ // return url for filenames based on template
/******/ return (
- "static/chunks/" + chunkId + "." + "19c15f3988446f13" + ".js"
+ "static/chunks/" + chunkId + "." + "d0d10dabd8ac2b9e" + ".js"
);
/******/
};
@@ -282,7 +282,6 @@
/******/
}
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
- /******/
/******/ script.src = __webpack_require__.tu(url);
/******/
}
Diff for app-page-exp..ntime.dev.js
failed to diff
Diff for app-page-exp..time.prod.js
Diff too large to display
Diff for app-page-tur..time.prod.js
Diff too large to display
Diff for app-page-tur..time.prod.js
Diff too large to display
Diff for app-page.runtime.dev.js
failed to diff
Diff for app-page.runtime.prod.js
Diff too large to display
Diff for app-route-ex..ntime.dev.js
Diff too large to display
Diff for app-route-ex..time.prod.js
Diff too large to display
Diff for app-route-tu..time.prod.js
Diff too large to display
Diff for app-route-tu..time.prod.js
Diff too large to display
Diff for app-route.runtime.dev.js
Diff too large to display
Diff for app-route.ru..time.prod.js
Diff too large to display
Diff for pages-api-tu..time.prod.js
Diff too large to display
Diff for pages-api.runtime.dev.js
Diff too large to display
Diff for pages-api.ru..time.prod.js
Diff too large to display
Diff for pages-turbo...time.prod.js
Diff too large to display
Diff for pages.runtime.dev.js
Diff too large to display
Diff for pages.runtime.prod.js
Diff too large to display
Diff for server.runtime.prod.js
Diff too large to display
Tests Passed |
`createActionProxy` isn't the accurate name here - the function doesn't return anything new but only mark the value as registered. And also, it might not be a proxy (which is implementation detail) and might not be used for Server Actions only. `registerServerReference` is a better name here. There's no functionality change in this PR, only a few renames. Closes NEXT-2490
What?
Backports some Server Action changes from Shu to 14.1.1.
Improve the Server Actions SWC transform
Fix Server Reference being double registered
Improve the Server Actions SWC transform (part 2)
Fix module-level Server Action creation with closure-closed values
Rename internal utility naming for clarification
Why?
How?