forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
[pull] canary from vercel:canary #200
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…esent (#81711) `rootParams` was erroring if used in a `'prerender-client'`, but only if we had `fallbackRouteParams`. this is an edge case, but it is technically possible to hit if our compiler checks for using `rootParams` in client code are bypassed. i've also had to split `PrerenderStoreModern` into two types instead of having `type: 'prerender' | 'prerender-client'`. otherwise, typescript would think that the `case 'prerender'` branch wasn't enough to eliminate `PrerenderStoreModern` even though we already handled the `prerender-client` case at the top. this made the `prerenderStore satisfies never` assertion at the bottom fail. This is a bit tricky to explain, so i'm including a [TS playground repro](https://www.typescriptlang.org/play/?#code/C4TwDgpgBAysD2AnCAZCBzAhgYxFAvFAN5SiQBcUA5GMsgHYAmEiAtADYY4hUC+AUGWhwkEALLxmiegWKlwESjToQmLKlAA+1Wi1VTW2dgEtVwDQKGwEyWSORosuLddESp9fvwgAPMEmAoADMAV3psYGN4GQBnFgA3FgB5enYQABUAC2N6dAAKGJtFV2QASkpCxBz0Yn4oeqhjIKgCooA6K3wunRU1NiNTenNS2oax0kzEeAB3KHoIWYBRRCnEPKoAOXhAzHZ2GYhGRpkBsypSuoaBMZjp42BsTJbC0Q6FEaJL8agAeh+obCYOI9PR9QwmM5fcZ-KAAPSgAGFMPQqIFGPAJsYYlBMnooJgsDkADRQdIwKAsVbYu7AJ4AA3SCmoACJdAwDKchsyNFi5tsAfAALZgTCITAAI04pAxViorN6Bk4ThAzJc8tBUm5bTpULGMLy4oggJCwOm0EeRoA1ocJphAoagqIAIQXXUNQHA5Qa9SUT7fb7IYAhaRQZkAdQgVFsOXxUEFkhYMjZ+hYzLd9Wu-o90C97JYHC4uCovvT40DwZk4cj0ZkmCgSu4UGTfTT-qgme+zCCmBC7GAJbbNyKUBidqxQVM2PmiUQpb1-1hAH45w0YW11+KQoEyZj6JbsXSXsg6QDkSPInsoIbY-ZxAmQ7jbBBEjJafAQugnmaqIkKSZBTkdo2uK2xPP4MQxMYkrmkCEDYqWHbtvwAhAA) i'm guessing that `type: 'prerender' | 'prerender-client'` is more complex than a normal discriminator and TS was getting confused, which is why having two separate types solves it.
…function (#81386) ### What? Optimizes the `buildAppStaticPaths` function performance and extracts a helper function `calculateFallbackMode` to reduce code duplication. ### Why? The `buildAppStaticPaths` function had several performance bottlenecks: 1. **Repeated regex pattern compilation**: Route parameter patterns were being compiled inside the loop for every route, causing unnecessary overhead 2. **Inefficient root parameter lookups**: Using `Array.includes()` for root parameter checks resulted in O(n) lookups for each parameter 3. **Duplicated fallback mode logic**: The same fallback mode calculation was repeated in multiple places, making the code harder to maintain and prone to inconsistencies These inefficiencies became more apparent when processing large numbers of routes with complex parameter structures. ### How? **Performance optimizations:** - Pre-compile regex patterns for route parameters outside the loop and store them in a Map for O(1) lookups - Convert `rootParamKeys` to a Set for O(1) lookup time instead of O(n) array searches - Optimize the fallback parameter collection loop to break early and avoid redundant iterations **Code organization:** - Extract `calculateFallbackMode` helper function to eliminate code duplication - Add comprehensive tests for the new helper function to ensure correctness - Simplify the main loop logic by using the pre-compiled patterns and optimized data structures
## What? Adds support for `remarkPlugins: ['remark-gfm']` and `rehypePlugins: ['rehype-slug']`. Previously you had to nest an array like `remarkPlugins: [['remark-gfm']]` but that's a bug, that case is only for passing options. Directly passing the string without options should be allowed. This PR implements that.
Fixes a problem with the internal `createRouterAct` testing helper where the `block: "reject"` option would not error correctly, leading to potential false negatives. I think I accidentally broke this when I added the ability to provide an array of expected responses.
Fixes an issue where opting into dynamic prefetching with prefetch={true} would not apply to head data (like the title), only the page data. Although the head was being sent by the server as part of the prefetch response, it wasn't being transferred correctly to the prefetch cache. The net result is that you can now fully prefetch a page with a dynamic title without any additional network requests on navigation.
This auto-generated PR updates the development integration test manifest used when testing Rspack.
This auto-generated PR updates the production integration test manifest used when testing Rspack.
## Add a regression test for when a not-found component depends on css and triggers a bug in turbopack To correctly serve js and css resources during server side rendering we construct a client manifest that lists all the server components and their required resources. Turbopack has a bug where we fail to collect css that is used by the page if it is also used by a not-found page (and other error handlers as well). When a not-found component is present all pages pages implicitly depend on this module and depend on it as an early dependency of the generated `app-page.js` file. This means if a `not-found.js` file (or a global error file) would happen to depend on the same css as a normal component we would associate it as a client-reference of that component instead of any other. Then on a server side render we would simply omit it. This PR adds a regression test for this issue. See #77861 and #79535
Co-authored-by: Niklas Mischkulnig <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.3)
Can you help keep this open source service alive? 💖 Please sponsor : )