forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 2
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
[pull] canary from vercel:canary #563
Merged
Merged
Conversation
This file contains 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
Fixes #46789 ## Bug - [X] Related issues linked using `fixes #number` ## Feature - [X] Documentation added ## Documentation / Examples - [X] Make sure the linting passes by running `pnpm build && pnpm lint` - [X] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
Since we have 2 server compilers (node and edge), the `serverActions` object will always get overridden by the second compilation during `next build`. Like the client reference manifest, we need to have 2 objects for each compiler and merge them when outputting the asset. Besides that, to avoid `export default` being tree-shaken as unused export, I changed the loader to use CJS `module.exports` instead. Can't easily figure out a proper way for now but we plan to create separate worker for the action endpoint and this will be gone then. Fixes NEXT-759, read NEXT-761 for the full future plan. ## Bug - [ ] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
this fixes the same as #46493 but for [argon2](https://www.npmjs.com/package/argon2) <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: --> ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [x] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
- Follow up to #46744
Since the default export syntax is not `fnDecl` but `fnExpr` I added two new methods to abstract out all the transform logic and made both `visit_mut_fn_decl` and `visit_mut_fn_expr` use that. Next step is to support default exports without an ident (`export default async function () {}`). Fixes NEXT-768. ## Bug - [ ] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
Turbopack uses a different format for its css module classnames [0]. This adds and uses a helper function to the next-font tests to assert against these classnames when testing with Turbopack. Ideally these tests could be more behavioral (e.g. asserting on rendered dimensions), but these can't capture things like fallback fonts. [0] vercel/turborepo#3437
Because there is a TS error when is set just a string: `TS2322: Type '() => string' is not assignable to type '(loadingProps: DynamicOptionsLoadingProps) => Element | null'. Type 'string' is not assignable to type 'Element'.`
Migrate examples using `@next/font` to `next/font`. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
We recommend that users just opt into `edge` per page. This global default was an unfortunate pattern.
This PR makes `typedRoutes` stricter by constraining generics in `Route` to type string. I've also made generating types for routes a bit more efficient by moving `redirects` and `rewrites`'s processing to the plugin's constructor since `rewrites` and `redirects` don't change in both dev and prod. I've also been trying to fix a bug where route types doesn't generate all the routes (some appear, some don't), but I've got no clues since that doesn't seem easy to reproduce (perhaps it only happens in my case?) ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
This PR updates vendored React to the latest `@next` version, as well as corresponding changes to the manifest and module reference generation code. The new React version includes the following upstream changes: - 49f741046 Fix: Infinite act loop caused by wrong shouldYield (#26317) (Andrew Clark) - 106ea1c58 Support Iterables in Flight (#26313) (Sebastian Markbåge) - f905da227 [Flight] Send server reference error chunks to the client (#26293) (Hendrik Liebau) - e0241b660 Simplify Webpack References by encoding file path + export name as single id (#26300) (Sebastian Markbåge) - 25685d8a9 Codemod tests to waitFor pattern (9/?) (#26309) (Andrew Clark) - 64dde7082 Codemod tests to waitFor pattern (8/?) (#26308) (Andrew Clark) - 3cb5afb82 Codemod tests to waitFor pattern (7/?) (#26307) (Andrew Clark) - e98695db9 Codemod tests to waitFor pattern (6/?) (#26305) (Andrew Clark) - 9a52cc8bc Convert ReactLazy-test to waitFor pattern (#26304) (Andrew Clark) - 03462cfc7 [Fizz] External runtime: fix bug in processing existing elements (#26303) (mofeiZ) - faacefb4d Codemod tests to waitFor pattern (4/?) (#26302) (Andrew Clark) - 06460b6fb Remove unnecessary (and incorrect) code for compatibility with Paper in the Fabric version of GlobalResponderHandler (#26290) (Rubén Norte) - e64a8f403 Codemod tests to waitFor pattern (3/?) (#26299) (Andrew Clark) - ce8a72fd4 Codemod tests to waitFor pattern (2/?) (#26296) (Andrew Clark) - 1f1f8eb55 [Float][Fizz][Fiber]: Refactor <style> Resource implementation to group on flush (#26280) (Josh Story) - 5c633a48f Add back accidentally deleted test comments (#26294) (Andrew Clark) - b073104c2 [DevTools] improve troubleshooting in README (#26235) (Mengdi Chen) - fcf218791 [DevTools] Remove renderer.js from extension build (#26234) (Mengdi Chen) - b72ed698f Fixed incorrect value returned as public instance from reconciler (#26283) (Rubén Norte) - 25a8b9735 Codemod tests to waitFor pattern (1/?) (#26288) (Andrew Clark) - e52446733 New internal testing helpers: waitFor, waitForAll, waitForPaint (#26285) (Andrew Clark) - d49e0e0be Removed unused imperative events implementation from React Native renderer (#26282) (Rubén Norte) ---------
Currently all helper functions are exported from huge utils files. This moves the helper functions to their own files, this approach aligns better with the rest of the codebase. The unit tests are split up and colocated with the function it tests. Also added some missing tests. Plus some overall cleanup, added comments and fixed types. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
Co-authored-by: JJ Kasper <[email protected]>
Co-authored-by: JJ Kasper <[email protected]>
Reverting temporarily as this breaks turbopack support for app dir x-ref: https://github.com/vercel/next.js/actions/runs/4349458918/jobs/7600147372 x-ref: https://github.com/vercel/next.js/actions/runs/4349607013/jobs/7600148420 Reverts #46826
This updates to no longer skip caching POST or authed requests with the fetch cache and instead we bail when `cookies()` or `headers()` is used prior which is a better heuristic to signal user specific data would be related to the fetch request. x-ref: [slack thread](https://vercel.slack.com/archives/C042LHPJ1NX/p1678130069138849) ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
These utilities aren't needed so can be removed
Continues from #46380. The PR migrates the unit test cases from the original repo into the Next.js repo.
Follow-up to #45772 this ensures the rewrite header can be correctly set when a chained middleware rewrite is occurring. x-ref: [slack thread](https://vercel.slack.com/archives/C01RGMANU9Y/p1678074803731489) ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
## What? This PR has its main goal to improve the experience of opening/reviewing a PR. It improves the PR template, as well as extends PR auto-labeling. ## Why? There are 2 parts to the PR template: - Individual contributors: The current template accommodates for the most common cases individual contributors use to contribute. (I.e. fixing bugs, updating/adding examples, addressing documentation issues). The new template keeps this at the top. - Next.js team: As maintainers, we should try to explain PRs as if someone with less context would review them. This should also help with backreferencing PRs in issues and follow-up PRs and make it easier to follow changes, understand trade-offs better at the time, and help new team members catch up over time, etc. ## How? The template is written in a comment instead of Markdown, so when the PR is opened, most of the template is hidden to make it less verbose. The checkboxes we've had before are not shown, but we already auto-label PRs based on the path of the files that have been touched, so the checkboxes showed redundant information. [Slack thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1677677802109289), Closes NEXT-741
### What? Link to https://github.com/vercel/next.js/tree/canary/examples/reproduction-template-app-dir from our bug report template. ### Why? To lower the barrier to adding a reproduction even when reporting an App Router-related issue, which is currently behind a flag. (Pointed out in #46852) ### How? Added a link in the issue template. The remaining question is, should we add anything else to https://github.com/vercel/next.js/tree/canary/examples/reproduction-template-app-dir to make creating a reproduction easier? Closes NEXT-789 Related #46852
Add a timeout to the Google Fonts fetch calls in dev. In case they aren't fetched in time, the fallback font is used instead. Currently if font fetching fails due to network errors in dev, the loader is not cached. Every change on a page that uses a font makes it retry to refetch the font. But, if the network is slow enough to cause timeouts, that means that every change would force the user to wait for the timeout before the page being updated. Because of this, the PR also enables the loader to be cached on error. The drawback is that you would have to delete the `.next` folder to retry to get the actual font in case it got cached after failing. Closes NEXT-726 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
This PR adds the support for unnamed default export expression support `export default async function () {}` in a "use server" entry, with corresponding test. Also fixed an existing bug that the default exported action's name should be aligned with the export name, which is `"default"`. Closes NEXT-769.
Currently the codemod always runs `root.toSource()`, recreating the source from the AST. But this can sometimes add unexpected semicolons to files that actually didn't get updated by the codemod. This PR adds a check to see if the AST has been updated before running `root.toSource()`, otherwise it just returns the original source.
When fetching CSS or font files from Google Fonts, it won't work if you're required to use a proxy. This change makes it look for the `http(s)_proxy` environment variable, and if it's defined it creates a fetch agent using [https-proxy-agent](https://github.com/TooTallNate/node-https-proxy-agent). Also fixes fetch errors not being properly logged. Fixes #45034 Closes NEXT-690 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
Ensure that the router tree state header is one single, valid value. Fixes NEXT-136.
…#46922) Rename FontLoaderManifest to NextFontManifest to make it more obvious that it has to do with `next/font`. There's a change to how the plugin determines if a module is generated by `next/font`. Instead of looking at the target CSS file https://github.com/vercel/next.js/blob/v13.2.4-canary.6/packages/next/src/build/webpack/plugins/font-loader-manifest-plugin.ts#L37-L49. It simply looks if the module has `next-font-loader` in its loaders: https://github.com/vercel/next.js/compare/canary...hanneslund:next.js:next-font-build-cleanup?expand=1#diff-34d7972c68687e875c868847f782f369c3af162a9af10949f3577660775afcb2R65-R74 Also more comments added to the manifest plugin and the `next/font` postcss plugin. --------- Co-authored-by: JJ Kasper <[email protected]>
Follow-up to #46906 this ensures we revalidate `generateStaticParams`/`getStaticPaths` in the background in development so that we aren't blocking refreshes an much un-necessarily if the paths cache is already populated. Fixes: #44646 Fixes: #38757 x-ref: #17977 (comment) x-ref: #20076 x-ref: #14378
Add support for cases like: ```js const foo = async function () {} export default foo const bar = async function() {} export { bar } ``` Also fix a bug where nested async function declarations are mistakenly counted as actions. Fixes NEXT-800.
) Support top level static `robots.txt` and `sitemap.xml` as metadata route in app directory. When those files are placed in top root directory Refactored a bit the page files matching logic, to reuse it between dev server and build Closes NEXT-267
Update to latest next channel of react mainly for facebook/react#26353 ``` - 3706edb81 [Float][Fizz]: Don't preload nomodule scripts (#26353) (Josh Story) - 2b003a5cc Split out ServerReferenceMetadata into Id and Bound Arguments (#26351) (Sebastian Markbåge) - 62cd5af08 Codemod redundant async act scopes (#26350) (Andrew Clark) - 037378202 Internal `act`: Call scope function after an async gap (#26347) (Andrew Clark) - d8e49f2af Use setTimeout to schedule work on the server in Edge environments (#26348) (Sebastian Markbåge) - 83643778b Internal test helpers: Use Node's MessageChannel to queue task (#26345) (Andrew Clark) - f36ab0e37 Remove timers from ReactDOMSuspensePlaceholder tests (#26346) (Andrew Clark) - 44d380794 Move internalAct to internal-test-utils package (#26344) (Andrew Clark) - 8c100620c Build: specify Node.js 16 as minimum for dev (#26343) (Jan Kassens) - d81447304 [Internal API only] Delete non-awaited form of act (#26339) (Andrew Clark) - 702fc984e Codemod act -> await act (4/?) (#26338) (Andrew Clark) - 9fb2469a6 Restore definition of NativeMethods as an object for React Native (#26341) (Rubén Norte) - aef930314 [DevTools] upgrade electron to latest version & security improvements (#26337) (Mengdi Chen) - 161f6ae42 Codemod act -> await act (3/?) (#26336) (Andrew Clark) - 58605f798 Codemod act -> await act (2/?) (#26335) (Andrew Clark) ```
Move error overlay recovery tests in `ReactRefreshLogBox.test.ts` to a new file. This is already done for the app router tests, but this does it for the old router as well. Makes `ReactRefreshLogBox.test.ts` faster to run.
When the RSC compiler error was caused by an external package, make the error message display which import caused the error. Also don't show node_module files in the import trace. Continuation of #45484 Before ![image](https://user-images.githubusercontent.com/25056922/224032476-6811a1d5-d690-48be-9602-781f459edc70.png) After ![image](https://user-images.githubusercontent.com/25056922/224032177-2d0b2977-098f-46bd-8e30-9e6bc21b9153.png) Updates the format of the files, from `app/page.js` to `./app/page.js` to align it with other import traces. ![image](https://user-images.githubusercontent.com/25056922/224030420-1d3ff0ba-5747-4ed3-8b0b-9c4deace54ea.png) Closes NEXT-523
# New Features - vercel/turborepo#3975 # Bug Fixes - vercel/turborepo#4129 - vercel/turborepo#4134 - vercel/turborepo#4062 # Performance - vercel/turborepo#4093
This ensures we leverage the turbo remote cache when able to for the dev swc binary as well. x-ref: https://github.com/vercel/next.js/actions/runs/4378909387/jobs/7664237608
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: --> ## Bug fix #46948 - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [x] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) Co-authored-by: Seiry Yu <[email protected]>
## Checklist - [ ] Related issues linked using `fixes #number` - no related issue exists, happy to open one if desired - [x] Tests added - not sure if specific tests are needed? there is an integration test for environment variables, and Next.js relies a lot on passing information through environment variables; i'd expect everything to break if this change broke environment variable handling - [x] Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md - no new errors, does not apply ### What? Re-assigning `process.env` substitutes the "magic object" that sets environment variables at the process level with an ordinary JavaScript object. This causes environment variables that are set after `process.env` is re-assigned to not be visible to native add-ons. See [this Node.js issue][issue] and [this reproduction case][repro] for details. [issue]: nodejs/node#46996 [repro]: https://github.com/unflxw/nodejs-process-env-addons-repro ### Why? In general, paraphrasing the maintainer in the Node.js issue, re-assigning `process.env` is not a thing you should do. More specifically, I'm trying to use Next.js' experimental OpenTelemetry support with AppSignal's Node.js integration, which also uses OpenTelemetry. The AppSignal Node.js package sets environment variables in order to configure a long-running process, which is then launched through a native add-on. Because of the re-assignment of `process.env` that occurs early in Next.js' lifecycle process, by the time the AppSignal Node.js package sets environment variables, it's setting them in an ordinary JavaScript object that Next.js left in the global `process` object, not in the magic one created by the Node.js runtime. This means that these environment variables are not _actually_ being set for the process at the OS level, and therefore they're also not set for the native add-on, or for the long-running process it spawns. ### How? A `replaceProcessEnv` function is implemented that takes an environment object as an argument, and applies the difference between that environment object and the current environment to the existing `process.env` object. This function is used instead of re-assigning `process.env`. Co-authored-by: JJ Kasper <[email protected]>
This PR adds Zod to the precompiled libraries, and use it to create schemas for the router state tree for validation. In other planned features/changes, Zod will also be used to do run-time data validation. Fixes NEXT-135.
This PR adds basic support for default export of an async arrow function: ```js export default async (a, b) => { console.log(a, b) } ``` In upcoming PRs I'll refactor named export handling and inlined declarations.
Generate `/favicon.ico` route when favicon.ico is placed into `app/`. Still collect favicon metadata image information through metadata-image-loader but don't emit the file to static dist anymore. Also collect favicon through metadata routes, and render it as static routes. Also remove the `hash` we generated before, not needed anymore. Change metadata static routes rendering process: collect static metadata assets, read the buffer of the file data and return it in the response. Closes NEXT-791
# Bugfixes * vercel/turborepo#4149 * vercel/turborepo#4151 Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Add the new fonts to `next/font/google`.
Added auto-detection of image/x-icon content type by analyzing response buffer fixes #45998 Co-authored-by: Steven <[email protected]>
…46992) `mdx-bundler` is used for server-side transformation of MDX files and currently using it within server components will throw a `Module parse failed: Unexpected token` error. Adding `serverComponentsExternalPackages: ['mdx-bundler']` to `next.config.js` fixes the issue, but it's probably good to add to the default exclusion list as `mdx-bundler` is a relatively popular approach for using MDX in Next.js apps.
Set the output bundle file path to `/<metadata route>/route.js` to align with other custom app routes, in order to make it easier being handled by app routes in both nextjs and vercel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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]
Can you help keep this open source service alive? 💖 Please sponsor : )