- 07 Sep, 2023 3 commits
-
-
vercel-release-bot authored
-
Dalton McPhaden authored
-
OJ Kwon authored
### What? There are tests under `next-dev-tests` which used native binary to run tests for Turbopack. This should belong to next.js integration tests, and also indeed there are overlaps. As a first step, PR removes duplicated styled-jsx test and mark existing test under turbopack test filter as enabled. Closes WEB-1510
-
- 06 Sep, 2023 16 commits
-
-
Callum Silcock authored
nonce's are limited to characters found in base64 encoding, uuids contain '-' which breaks the spec, converting to a base64 string after generating simplifies this --- This was a bit gotcha in our project, there are a few tools that only expect there to be a single `-` and do a split based off it (so when there are >1 they fail) ## Rules for nonce's - The nonce must be unique for each HTTP response - The nonce should be generated using a cryptographically secure random generator - The nonce should have sufficient length, aim for at least 128 bits of entropy (32 hex characters, or about 24 base64 characters). - Script tags that have a nonce attribute must not have any untrusted / unescaped variables within them. - The characters that can be used in the nonce string are limited to the characters found in base64 encoding.
-
Will Binns-Smith authored
This addresses failures from the latest versions of turbo-tasks. Test Plan: `cargo check` when building against turbo. Closes WEB-1509
-
Will Binns-Smith authored
This adds session ids and anonymous ids to trace metadata. Note: This required setting `session`id on the `Telemetry` object as a public property. Set as readonly. Closes WEB-1500
-
Zack Tanner authored
This moves `resolve-href` into `next/src/client` to make sure that when it calls `normalizeTrailingSlash`, that function has access to `process.env.__NEXT_MANUAL_TRAILING_SLASH` (inlined via `DefinePlugin`). Closes NEXT-1599 Fixes #54984
-
Tobias Koppers authored
### What? Switch the default for `--turbo` to the new `--experimental-turbo`, remove the old code in next.js ### Why? The new approach will be used in future Closes WEB-1506
-
Jiachi Liu authored
Merge app-dir base path related tests into one
-
Lee Robinson authored
-
Steven authored
This changes to lazy import so that babel code-frame isn't loaded until it is needed.
-
Jimmy Lai authored
Slight tweaks to the dev config for split chunks. I disabled the default groups for chunking to make sure we only chunked the ones from the node_modules + augmented the number of parallel requests possible per Tobias suggestion. <!-- 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: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
-
Jimmy Lai authored
This PR will enable minifying the *server* part of the user code by default when running `next build`. ## Explanation Next.js compiles two versions of your code: the client version for the app that runs in the browser, and the server for the code that will run on the server. Whilst the client code has always been minified and optimised, we haven't done so historically for the server side. ## How does this impact me? There are several consequences to this change: - minified code makes error stacks less readable. To fix that, you can use source maps, which you can enable with `experimental.serverSourceMaps`. This is not enabled by default as this is an expensive operation. - however the server code will be optimised for size so as a result, cold boots should improve ## opting out you can opt out via specifying `experimental.serverMinification: false` in `next.config.js`
-
Shu Ding authored
Added a few popular libs (all tested locally), removed some that don't have barrel entries.
-
CSY54 authored
There is a quotation mark missing in the docs. Adding it back in this PR.
-
迷悟 authored
-
Hyewon Kim authored
<!-- 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: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> - Fix typo in [Next.js Project Structure: Top-level files](https://nextjs.org/docs/getting-started/project-structure#top-level-files) - It's common to create it as `next-env.d.ts` without dots.
-
Ryota Murakami authored
My "pnpm@v8.7.0" was not working and I noticed it by accident and sent a PR. Co-authored-by:Steven <229881+styfle@users.noreply.github.com>
-
Jiachi Liu authored
In dev mode, we're using a catch-all route for dynamic metadata routes, e.g. page path `/twitter-image` would become `/twitter-image/[[...metadata_id...]]/route` as a dynamic custom app route. But we're missing to convert it in filesystem scanning for routing purpose, adding the metadata related normalizing logic for app page to align with other places.
-
- 05 Sep, 2023 14 commits
-
-
vercel-release-bot authored
-
Shu Ding authored
Server React API optimization of `useEffect`, `useLayoutEffect` and `useState` under a `experimental.optimizePackageImports` flag.
-
Shu Ding authored
@MaxLeiter ran into an issue with this, need to investigate.
-
JJ Kasper authored
Closes: https://github.com/vercel/next.js/issues/54105
-
vercel-release-bot authored
-
JJ Kasper authored
Looks liket his has been broken since https://github.com/vercel/next.js/pull/54713 due to the text it watches for being changed.
-
Jimmy Lai authored
This PR introduces a change in the Next.js server that should improve memory usage nicely during dev. ## How While investigating the repro cases in #54708, @timneutkens and I noticed that the high memory usage often involved `googleapis`. Digging a bit more, I also saw that in dev, the bundle generated for a page using `googleapis` was around 80MB and that requiring it in Node.js increased memory by 160MB 🥲 and that requiring another page that also used this also increased the memory by 160MB. The problem is that Next.js, on new navigations and hot reloads, might need to load/reload all the code required for the page *all the time*. This issue is also exacerbated by the fact that there's a nasty Node.js bug that makes it impossible to clean that memory up, leading to memory bloat and overall a pretty bad DX. So if we can't clean this up, what can we do about it? The change I'm introducing in this PR is that I'm changing Next.js in order to split the code you're using from `node_modules` from the code you've written in different chunks. The idea is that the heavy code you're loading from `node_modules` is only gonna be loaded once per session this time. This should make a navigation/page reload only load the user bundle now. On my simple test case, the cost of navigation went from ~200MB to ~40MB. A few notes on the implementation: - The chunks for the `node_modules` are split at the module level, this is to ensure that each of the node_modules dependencies is split in the most memory efficient manner. If it was a big monolithic chunk, it would potentially be reloaded again and again whenever reloaded, leading to leakage. - I'm guessing we could do the same for the Edge server - the first load for a page will still be fairly heavy memory wise, there's probably something else we can do there - there's also an issue with the webpack require cache being flushed, whereas it could be reused ## comparisons ### navigating a page before <img width="284" alt="CleanShot 2023-09-04 at 21 00 46@2x" src="https://github.com/vercel/next.js/assets/11064311/44e37df8-4414-4ca1-b6bf-fb0fb11751ea"> after <img width="392" alt="CleanShot 2023-09-04 at 20 58 53@2x" src="https://github.com/vercel/next.js/assets/11064311/46226123-a73a-4132-a99d-fb812e59df46">
-
Tim Neutkens authored
Continuation of the previous PRs that introduce HMR event types for the server-side code, this leverages those types client-side too.
-
Florentin / 珞辰 authored
When using page routes we need to pass the contents of the `export const config` to the `extraConfig` populating the functions config manifest rather then relying on named exports like in app router.
-
Lee Robinson authored
Building off https://github.com/vercel/next.js/pull/54891, updates the `with-jest` and `with-vitest` examples with updated packages and App Router tests.
-
Kiko Beats authored
Fixing `Headers#getSetCookie` method
-
Damien Simonin Feugas authored
### 🧐 What's in there? As discussed with @huozhi, it's restoring code from #52393 which I forgot to restore in #54891. It is unlikely to make a difference, but we'll set globalWindow based on the desired test environment. This will not make any difference for most people. ### 🧪 How to test? Once you've rebuilt your local version of Next, `pnpm testheadless jest/rsc` Co-authored-by:Jiachi Liu <4800338+huozhi@users.noreply.github.com>
-
Balázs Orbán authored
This bumps `undici` to the latest version to match the one used in newer Node.js versions', potentially fixing compatibility issues. I also cleaned up some related `global as any` usage.
-
Jiachi Liu authored
The current logging styles has been existed for a while, this PR gives a fresh impression for the logging output from Next.js. We want to achieve few new goals that makes the output clean, modernized, sweet
🍫 . Few goals are addressed with this redesign: ## Refresh Impression & Simplification The new design of logging is much more information centralized and streamlined. * Given a `ready` message at the begining when compilers are bootstrapped. * Only show `compiled` event with green check mark indicating succesful compilation, this will merge the unclear `compiling` event which shows `(client and server)` before, now tell you the route compilation info in one line. hello world app ### `next dev` #### After vs Before <img src="https://github.com/vercel/next.js/assets/4800338/9649b340-8241-4756-a2b3-a989f0b74003" height="120"> <img src="https://github.com/vercel/next.js/assets/4800338/ee181263-3dd4-40d0-9ffc-819a56b45900" height="120"> ### `next build` #### After vs Before <img src="https://github.com/vercel/next.js/assets/4800338/5db9829a-9ffc-49f0-b030-93ee92f5c248" width="360"> <img src="https://github.com/vercel/next.js/assets/4800338/b9527b83-27c8-4426-9c0d-c0d4072b7d58" width="360"> ### error status #### After vs Before <img src="https://github.com/vercel/next.js/assets/4800338/00455226-ace7-468b-8d90-0d36bf038489" height="120"> <img src="https://github.com/vercel/next.js/assets/4800338/1be8c451-d3f0-465c-9ef7-6b0dde7cff85" height="120"> ## Streamlization If you have customized envs and experiments Next.js will give the brief in the early summary about your network information, env vars, and enabled experimental features <img src="https://github.com/vercel/next.js/assets/4800338/ca1a7409-1532-46cb-850f-687e61e587b2" width="400"> ## Polish ### fetching logging structure #### After vs Before <img src="https://github.com/vercel/next.js/assets/4800338/97526397-dffe-4736-88ed-e5cbe5e945bd" width="400"> <img src="https://github.com/vercel/next.js/assets/4800338/ab77c907-5ab5-48bb-8347-6146d2e60932" width="400"> ### Dedupe Duplicates The logging is moved from `@next/env` to `next` itself, `@next/env` will only notify the invoker that the env is reloaded. Then the duplicated logs for the env reloading cases can be avoid. #### After vs Before <img src="https://github.com/vercel/next.js/assets/4800338/04799295-e739-4035-87aa-61cec962fc39" width="400"> <img src="https://github.com/vercel/next.js/assets/4800338/e29020c9-0031-4bf3-a21b-8b64633f43a2" width="400"> ### Different indicators Use unicode text icons for different situation: * passed -> check mark * warning -> warning * error -> red cross * loading -> circle <img src="https://github.com/vercel/next.js/assets/4800338/715c34bd-298f-4990-a5d7-e12e455ead44" width="400"> Co-authored-by:Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
-
- 04 Sep, 2023 7 commits
-
-
Lee Robinson authored
Ports content from the Pages and Layouts section about templates and formats to match other API reference pages. Co-authored-by:Michael Novotny <446260+manovotny@users.noreply.github.com>
-
Tim Neutkens authored
Additional HMR actions that weren't using the types yet.
-
Tim Neutkens authored
While investigating the HMR event types I noticed `pong` is not being used in Pages Router nor in App Router. This PR removes the code that sends it as it's essentially dead code.
-
vercel-release-bot authored
-
Damien Simonin Feugas authored
Co-authored-by:Jiachi Liu <inbox@huozhi.im>
-
Jiachi Liu authored
add huozhi to `next-swc` package scope
-
Tim Neutkens authored
Adds `serverError` to the list of HMR actions, missed this in the earlier PRs as it wasn't using `hotReloader.send`. Also ensures on-demand-entry-handler reuses the hotReloader.send method.
-