-
Notifications
You must be signed in to change notification settings - Fork 28k
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: vercel/next.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v14.1.1
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: vercel/next.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f564deef86be32a6b25125ddb8172c7c27d3f19a
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 10 commits
- 43 files changed
- 5 contributors
Commits on Mar 2, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 1ad6548 - Browse repository at this point
Copy the full SHA 1ad6548View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4518c1e - Browse repository at this point
Copy the full SHA 4518c1eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5aba536 - Browse repository at this point
Copy the full SHA 5aba536View commit details
Commits on Mar 4, 2024
-
make router restore action resilient to a missing tree (#62098)
Following an anchor link to a hash param, and then attempting to use `history.pushState` or `history.replaceState`, would result in an MPA navigation to the targeted URL. In #61822, a guard was added to prevent calling `ACTION_RESTORE` with a missing tree, to match other call-sites where we do the same. This was to prevent the app from crashing in the case where app router internals weren't available in the history state. The original assumption was that this is a rare / unlikely edge case. However the above scenario is a very probable case where this can happen, and triggering an MPA navigation isn't ideal. This updates `ACTION_RESTORE` to be resilient to an undefined router state tree. When this happens, we'll still trigger the restore action to sync params, but use the existing flight router state. Closes NEXT-2502
Configuration menu - View commit details
-
Copy full SHA for a70ae40 - Browse repository at this point
Copy the full SHA a70ae40View commit details -
ensure server action errors notify rejection handlers (#61588)
### What When attaching a rejection listener to a server action promise, in the case of network errors, the rejection handler would be skipped and it'd throw an error that crashes the application. ### Why When we refactored these reducers to no longer suspend, it caused the rejection handling logic we have to no longer make sense. In this case we're working with a native promise that won't have a `status` property, so we'd re-throw the error and not call `reject`. ### How This removes the special status handling logic and makes the rejection handler always call `reject` with the error. This will either be handled by user code or let the error bubble to an error boundary. I also cleaned up some mutable code that is no longer needed now that these reducers aren't replayed. Closes NEXT-1715 Closes NEXT-2323 Fixes #58638
Configuration menu - View commit details
-
Copy full SHA for dbab205 - Browse repository at this point
Copy the full SHA dbab205View commit details -
fix: Add stricter check for "use server" exports (#62821)
As mentioned in the new-added error messages, and the [linked resources](https://react.dev/reference/react/use-server#:~:text=Because%20the%20underlying%20network%20calls%20are%20always%20asynchronous%2C%20%27use%20server%27%20can%20only%20be%20used%20on%20async%20functions.): > Because the underlying network calls are always asynchronous, 'use server' can only be used on async functions. > https://react.dev/reference/react/use-server It's a requirement that only async functions are allowed to be exported and annotated with `'use server'`. Currently, we already have compiler check so this will already error: ```js 'use server' export function foo () {} // missing async ``` However, since exported values can be very dynamic the compiler can't catch all mistakes like that. We also have a runtime check for all exports in a `'use server'` function, but it only covers `typeof value === 'function'`. This PR adds a stricter check for "use server" annotated values to also make sure they're async functions (`value.constructor.name === 'AsyncFunction'`). That said, there are still cases like synchronously returning a promise to make a function "async", but it's still very different by definition. For example: ```js const f = async () => { throw 1; return 1 } const g = () => { throw 1; return Promise.resolve(1) } ``` Where `g()` can be synchronously caught (`try { g() } catch {}`) but `f()` can't even if they have the same types. If we allow `g` to be a Server Action, this behavior is no longer always true but depending on where it's called (server or client). Closes #62727.
Configuration menu - View commit details
-
Copy full SHA for 714020f - Browse repository at this point
Copy the full SHA 714020fView commit details -
Fix redirect under suspense boundary with basePath (#62597)
Fixes `redirect()` call under suspense boundary, redirect url should include the `basePath` in the url. `redirect()` under suspense boundaries will go through server html insertion, which is being used every time by suspense boundary resolved, new errors will triggered from SSR streaming. It was missing before. Fixes NEXT-2615 Fixes #62407
Configuration menu - View commit details
-
Copy full SHA for 400b57c - Browse repository at this point
Copy the full SHA 400b57cView commit details -
Fix: generateSitemaps in production giving 404 (#62212)
generateSitemaps function returns a 404 for /sitemap/[id].xml in production While finding the correct sitemap partition from the array, we check the param against the id. Which works in dev because id and param are both without trailing .xml. But it fails in production as param has a trailing .xml (/sitemap/[id] works in production because it falls back to dynamic loading and param and id are both without .xml) If we are in production environment, check the id with a trailing .xml because that's whats returned from generateStaticParams, an array of __metadata_id__ with trailing .xml Fixes #61969 --------- Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Configuration menu - View commit details
-
Copy full SHA for 0a2d775 - Browse repository at this point
Copy the full SHA 0a2d775View commit details -
Fix sitemap generateSitemaps support for string id (#61088)
Fixes the string id that broken when sitemap is optimized to static route. When sitemap is optimized to static route in production, the route argument is changed from `[[...__metadata_id__]]` to `[__metadata_id__]`, so the type of it is also changed from array to string that should reflect in the loader code. Fixes #60894 Closes NEXT-2154
Configuration menu - View commit details
-
Copy full SHA for a85519e - Browse repository at this point
Copy the full SHA a85519eView commit details -
Configuration menu - View commit details
-
Copy full SHA for f564dee - Browse repository at this point
Copy the full SHA f564deeView commit details
There are no files selected for viewing