Skip to content

[pull] canary from vercel:canary #199

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

Merged
merged 10 commits into from
Jul 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions crates/next-custom-transforms/src/transforms/server_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -998,9 +998,14 @@ impl<C: Comments> VisitMut for ServerActions<C> {
}

if let Some(directive) = directive {
let fn_name = self
.fn_decl_ident
.clone()
.or(self.arrow_or_fn_expr_ident.clone());

if !f.is_async {
emit_error(ServerActionsErrorKind::InlineSyncFunction {
span: f.span,
span: fn_name.as_ref().map_or(f.span, |ident| ident.span),
directive,
});

Expand Down Expand Up @@ -1066,9 +1071,7 @@ impl<C: Comments> VisitMut for ServerActions<C> {
let new_expr = self.maybe_hoist_and_create_proxy_for_server_action_function(
child_names,
f,
self.fn_decl_ident
.clone()
.or(self.arrow_or_fn_expr_ident.clone()),
fn_name,
);

if self.in_default_export_decl {
Expand Down Expand Up @@ -1170,7 +1173,10 @@ impl<C: Comments> VisitMut for ServerActions<C> {
if let Some(directive) = directive {
if !a.is_async {
emit_error(ServerActionsErrorKind::InlineSyncFunction {
span: a.span,
span: self
.arrow_or_fn_expr_ident
.as_ref()
.map_or(a.span, |ident| ident.span),
directive,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
,-[input.js:3:1]
2 |
3 | export function foo() {}
: ^^^^^^^^^^^^^^^^^
: ^^^
`----
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
,-[input.js:4:1]
3 | export default function () {}
4 | export function foo() {}
: ^^^^^^^^^^^^^^^^^
: ^^^
5 | export const bar = () => {}
`----
x "use cache" functions must be async functions.
|
,-[input.js:5:1]
4 | export function foo() {}
5 | export const bar = () => {}
: ^^^^^^^^
: ^^^
6 | export const baz = 42
`----
x Only async functions are allowed to be exported in a "use cache" file.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function () {
export default function Default() {
'use cache'
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default function() {}
export default function Default() {}
export function foo() {}
export const bar = ()=>{};
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
x "use cache" functions must be async functions.
|
,-[input.js:1:1]
1 | ,-> export default function () {
2 | | 'use cache'
3 | `-> }
1 | export default function Default() {
: ^^^^^^^
2 | 'use cache'
`----
x "use cache" functions must be async functions.
|
,-[input.js:5:1]
4 |
5 | ,-> export function foo() {
6 | | 'use cache'
7 | `-> }
4 |
5 | export function foo() {
: ^^^
6 | 'use cache'
`----
x "use cache" functions must be async functions.
|
,-[input.js:9:1]
8 |
9 | ,-> export const bar = () => {
10 | | 'use cache'
11 | `-> }
8 |
9 | export const bar = () => {
: ^^^
10 | 'use cache'
`----
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
,-[input.js:7:1]
6 |
7 | export function bar() {}
: ^^^^^^^^^^^^^^^^^
: ^^^
`----
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
x Server Actions must be async functions.
|
,-[input.js:1:1]
1 | ,-> const foo = () => {
2 | | 'use server'
3 | `-> }
1 | const foo = () => {
: ^^^
2 | 'use server'
`----
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,16 @@
"pretty-ms": "7.0.0",
"random-seed": "0.3.0",
"react": "19.0.0",
"react-builtin": "npm:[email protected]97cdd5d3-20250710",
"react-builtin": "npm:[email protected]d85ec5f5-20250716",
"react-dom": "19.0.0",
"react-dom-builtin": "npm:[email protected]97cdd5d3-20250710",
"react-dom-experimental-builtin": "npm:[email protected]97cdd5d3-20250710",
"react-experimental-builtin": "npm:[email protected]97cdd5d3-20250710",
"react-is-builtin": "npm:[email protected]97cdd5d3-20250710",
"react-server-dom-turbopack": "19.2.0-canary-97cdd5d3-20250710",
"react-server-dom-turbopack-experimental": "npm:[email protected]97cdd5d3-20250710",
"react-server-dom-webpack": "19.2.0-canary-97cdd5d3-20250710",
"react-server-dom-webpack-experimental": "npm:[email protected]97cdd5d3-20250710",
"react-dom-builtin": "npm:[email protected]d85ec5f5-20250716",
"react-dom-experimental-builtin": "npm:[email protected]d85ec5f5-20250716",
"react-experimental-builtin": "npm:[email protected]d85ec5f5-20250716",
"react-is-builtin": "npm:[email protected]d85ec5f5-20250716",
"react-server-dom-turbopack": "19.2.0-canary-d85ec5f5-20250716",
"react-server-dom-turbopack-experimental": "npm:[email protected]d85ec5f5-20250716",
"react-server-dom-webpack": "19.2.0-canary-d85ec5f5-20250716",
"react-server-dom-webpack-experimental": "npm:[email protected]d85ec5f5-20250716",
"react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3",
"relay-compiler": "13.0.2",
Expand All @@ -252,8 +252,8 @@
"resolve-from": "5.0.0",
"sass": "1.54.0",
"satori": "0.15.2",
"scheduler-builtin": "npm:[email protected]97cdd5d3-20250710",
"scheduler-experimental-builtin": "npm:[email protected]97cdd5d3-20250710",
"scheduler-builtin": "npm:[email protected]d85ec5f5-20250716",
"scheduler-experimental-builtin": "npm:[email protected]d85ec5f5-20250716",
"seedrandom": "3.0.5",
"semver": "7.3.7",
"serve-handler": "6.1.6",
Expand Down Expand Up @@ -297,10 +297,10 @@
"@types/react-dom": "19.1.6",
"@types/retry": "0.12.0",
"jest-snapshot": "30.0.0-alpha.6",
"react": "19.2.0-canary-97cdd5d3-20250710",
"react-dom": "19.2.0-canary-97cdd5d3-20250710",
"react-is": "19.2.0-canary-97cdd5d3-20250710",
"scheduler": "0.27.0-canary-97cdd5d3-20250710"
"react": "19.2.0-canary-d85ec5f5-20250716",
"react-dom": "19.2.0-canary-d85ec5f5-20250716",
"react-is": "19.2.0-canary-d85ec5f5-20250716",
"scheduler": "0.27.0-canary-d85ec5f5-20250716"
},
"patchedDependencies": {
"[email protected]": "patches/[email protected]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31109,11 +31109,11 @@
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-experimental-97cdd5d3-20250710" !== isomorphicReactPackageVersion)
if ("19.2.0-experimental-d85ec5f5-20250716" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.2.0-experimental-97cdd5d3-20250710\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.2.0-experimental-d85ec5f5-20250716\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -31150,10 +31150,10 @@
!(function () {
var internals = {
bundleType: 1,
version: "19.2.0-experimental-97cdd5d3-20250710",
version: "19.2.0-experimental-d85ec5f5-20250716",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-experimental-97cdd5d3-20250710"
reconcilerVersion: "19.2.0-experimental-d85ec5f5-20250716"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -31299,7 +31299,7 @@
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.2.0-experimental-97cdd5d3-20250710";
exports.version = "19.2.0-experimental-d85ec5f5-20250716";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19257,14 +19257,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_2169 = React.version;
if (
"19.2.0-experimental-97cdd5d3-20250710" !==
"19.2.0-experimental-d85ec5f5-20250716" !==
isomorphicReactPackageVersion$jscomp$inline_2169
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2169,
"19.2.0-experimental-97cdd5d3-20250710"
"19.2.0-experimental-d85ec5f5-20250716"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -19286,10 +19286,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2854 = {
bundleType: 0,
version: "19.2.0-experimental-97cdd5d3-20250710",
version: "19.2.0-experimental-d85ec5f5-20250716",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-experimental-97cdd5d3-20250710"
reconcilerVersion: "19.2.0-experimental-d85ec5f5-20250716"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2855 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -19396,4 +19396,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.2.0-experimental-97cdd5d3-20250710";
exports.version = "19.2.0-experimental-d85ec5f5-20250716";
Original file line number Diff line number Diff line change
Expand Up @@ -31161,11 +31161,11 @@
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-experimental-97cdd5d3-20250710" !== isomorphicReactPackageVersion)
if ("19.2.0-experimental-d85ec5f5-20250716" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.2.0-experimental-97cdd5d3-20250710\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.2.0-experimental-d85ec5f5-20250716\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -31202,10 +31202,10 @@
!(function () {
var internals = {
bundleType: 1,
version: "19.2.0-experimental-97cdd5d3-20250710",
version: "19.2.0-experimental-d85ec5f5-20250716",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-experimental-97cdd5d3-20250710"
reconcilerVersion: "19.2.0-experimental-d85ec5f5-20250716"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -31681,7 +31681,7 @@
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.2.0-experimental-97cdd5d3-20250710";
exports.version = "19.2.0-experimental-d85ec5f5-20250716";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20939,14 +20939,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_2391 = React.version;
if (
"19.2.0-experimental-97cdd5d3-20250710" !==
"19.2.0-experimental-d85ec5f5-20250716" !==
isomorphicReactPackageVersion$jscomp$inline_2391
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2391,
"19.2.0-experimental-97cdd5d3-20250710"
"19.2.0-experimental-d85ec5f5-20250716"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -20968,10 +20968,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_3078 = {
bundleType: 0,
version: "19.2.0-experimental-97cdd5d3-20250710",
version: "19.2.0-experimental-d85ec5f5-20250716",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-experimental-97cdd5d3-20250710"
reconcilerVersion: "19.2.0-experimental-d85ec5f5-20250716"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_3079 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -21238,7 +21238,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.2.0-experimental-97cdd5d3-20250710";
exports.version = "19.2.0-experimental-d85ec5f5-20250716";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10502,5 +10502,5 @@
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.2.0-experimental-97cdd5d3-20250710";
exports.version = "19.2.0-experimental-d85ec5f5-20250716";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7118,4 +7118,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.2.0-experimental-97cdd5d3-20250710";
exports.version = "19.2.0-experimental-d85ec5f5-20250716";
Original file line number Diff line number Diff line change
Expand Up @@ -10502,5 +10502,5 @@
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server'
);
};
exports.version = "19.2.0-experimental-97cdd5d3-20250710";
exports.version = "19.2.0-experimental-d85ec5f5-20250716";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7221,4 +7221,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server'
);
};
exports.version = "19.2.0-experimental-97cdd5d3-20250710";
exports.version = "19.2.0-experimental-d85ec5f5-20250716";
Original file line number Diff line number Diff line change
Expand Up @@ -9491,11 +9491,11 @@
}
function ensureCorrectIsomorphicReactVersion() {
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-experimental-97cdd5d3-20250710" !== isomorphicReactPackageVersion)
if ("19.2.0-experimental-d85ec5f5-20250716" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.2.0-experimental-97cdd5d3-20250710\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.2.0-experimental-d85ec5f5-20250716\nLearn more: https://react.dev/warnings/version-mismatch")
);
}
var React = require("next/dist/compiled/react-experimental"),
Expand Down Expand Up @@ -11314,5 +11314,5 @@
startWork(request);
});
};
exports.version = "19.2.0-experimental-97cdd5d3-20250710";
exports.version = "19.2.0-experimental-d85ec5f5-20250716";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7781,12 +7781,12 @@ function getPostponedState(request) {
}
function ensureCorrectIsomorphicReactVersion() {
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-experimental-97cdd5d3-20250710" !== isomorphicReactPackageVersion)
if ("19.2.0-experimental-d85ec5f5-20250716" !== isomorphicReactPackageVersion)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion,
"19.2.0-experimental-97cdd5d3-20250710"
"19.2.0-experimental-d85ec5f5-20250716"
)
);
}
Expand Down Expand Up @@ -8041,4 +8041,4 @@ exports.resumeAndPrerender = function (children, postponedState, options) {
startWork(request);
});
};
exports.version = "19.2.0-experimental-97cdd5d3-20250710";
exports.version = "19.2.0-experimental-d85ec5f5-20250716";
Loading
Loading