- 10 Mar, 2023 1 commit
-
-
JJ Kasper authored
-
- 09 Mar, 2023 10 commits
-
-
JJ Kasper authored
-
Noemi authored
## 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]: https://github.com/nodejs/node/issues/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 <jj@jjsweb.site>
-
Seiry Yu 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: --> ## 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 <seiry@squareup.com>
-
JJ Kasper authored
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
-
Justin Ridgewell authored
# New Features - https://github.com/vercel/turbo/pull/3975 # Bug Fixes - https://github.com/vercel/turbo/pull/4129 - https://github.com/vercel/turbo/pull/4134 - https://github.com/vercel/turbo/pull/4062 # Performance - https://github.com/vercel/turbo/pull/4093
-
Hannes Bornö authored
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 https://github.com/vercel/next.js/pull/45484 Before  After  Updates the format of the files, from `app/page.js` to `./app/page.js` to align it with other import traces.  Closes NEXT-523
-
Hannes Bornö authored
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.
-
Jiachi Liu authored
Update to latest next channel of react mainly for https://github.com/facebook/react/pull/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) ```
-
Jiachi Liu authored
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
-
JJ Kasper authored
-
- 08 Mar, 2023 15 commits
-
-
Shu Ding authored
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. -
JJ Kasper authored
Follow-up to https://github.com/vercel/next.js/pull/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: https://github.com/vercel/next.js/issues/44646 Fixes: https://github.com/vercel/next.js/issues/38757 x-ref: https://github.com/vercel/next.js/discussions/17977#discussioncomment-142104 x-ref: https://github.com/vercel/next.js/discussions/20076 x-ref: https://github.com/vercel/next.js/discussions/14378
-
Hannes Bornö authored
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 <jj@jjsweb.site>
-
Shu Ding authored
Ensure that the router tree state header is one single, valid value. Fixes NEXT-136.
-
Shu Ding authored
It's possible that the request is missing or having an invalid URL, and got passed to the renderer. Fixes NEXT-139.
-
Hannes Bornö authored
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)
-
JJ Kasper authored
-
Justin Ridgewell authored
# Bug Fixes - https://github.com/vercel/turbo/pull/4121 - https://github.com/vercel/turbo/pull/4111
-
Hannes Bornö authored
`test/development/acceptance-app/hydration-error.test.ts` has a lot of tests because I ported all the tests in https://github.com/facebook/react/blob/main/packages/react-dom/src/__tests__/ReactDOMHydrationDiff-test.js. Running all those tests takes a lot of time, and to include all the different cases is overkill. This PR removes most tests but keeps one test case per type of hydration error, and also one using suspense. This makes more sense, it should only test that all the different hydration error messages are picked up.
-
Shu Ding authored
Similar to #46888, this PR adds support for the case: ```js async function foo () {} export default foo ``` ...where you export an ident as a default export expression. Closes NEXT-770 ~Should be landed after #46881.~ -
Donny/강동윤 authored
## Bugfixes - https://github.com/vercel/turbo/pull/3526 - https://github.com/vercel/turbo/pull/4084 - https://github.com/vercel/turbo/pull/4083 - https://github.com/vercel/turbo/pull/4067 - https://github.com/vercel/turbo/pull/3959 - https://github.com/vercel/turbo/pull/4060 - https://github.com/vercel/turbo/pull/4081 - https://github.com/vercel/turbo/pull/4103 - https://github.com/vercel/turbo/pull/4100 - https://github.com/vercel/turbo/pull/4108 - https://github.com/vercel/turbo/pull/4101 - https://github.com/vercel/turbo/pull/4112 - https://github.com/vercel/turbo/pull/3956 - https://github.com/vercel/turbo/pull/4118 - https://github.com/vercel/turbo/pull/4117 ## Feature - https://github.com/vercel/turbo/pull/4058 - https://github.com/vercel/turbo/pull/4013 - https://github.com/vercel/turbo/pull/4005 - https://github.com/vercel/turbo/pull/4001 - https://github.com/vercel/turbo/pull/3839 - https://github.com/vercel/turbo/pull/4017 - https://github.com/vercel/turbo/pull/4086 - https://github.com/vercel/turbo/pull/4067 ## Performance - https://github.com/vercel/turbo/pull/4040 - https://github.com/vercel/turbo/pull/4110 ## Refactor - https://github.com/vercel/turbo/pull/4098
-
Jiachi Liu authored
### Bug Fix Update vendor react to fix the unexpected hoist tags issue x-ref: https://github.com/facebook/react/pull/26256 * Fixes #42648 * Closes NEXT-655 * tests added
-
Jan Kaifer authored
fixes https://github.com/vercel/next.js/issues/46549 The docs are wrong for now, this limitation is just in `pages/`, you can use it anywhere in `app/`. Since `app/` is still not stable we will emit that warning in all files outside of `app/`.
-
JJ Kasper authored
This ensures we leverage the fetch cache when calling `generateStaticParams` and also ensures paths with `generateStaticParams` without `dynamicParams = false` don't error when only partial params are provided. x-ref: [slack thread](https://vercel.slack.com/archives/C035J346QQL/p1678149362238089)
-
Ray Wong authored
fixes #46838 This PR fixes the snapshot test failure of examples `with-jest` and `with-jest-babel`. I have tested by running tests in the files generated by these 2 commands: ``` $ npx create-next-app@latest --example https://github.com/rayrw/next.js/tree/fix-with-jest-example-test-failure/examples/with-jest fix-snapshots-failure $ npx create-next-app@latest --example https://github.com/rayrw/next.js/tree/fix-with-jest-example-test-failure/examples/with-jest-babel fix-snapshots-failure ```
-
- 07 Mar, 2023 14 commits
-
-
Shu Ding authored
This one seems to be flaky ([example](https://github.com/vercel/next.js/actions/runs/4357945817/jobs/7618498044)) as the default `page.goto` timeout is set to 30s, while it already takes 15~20s to load locally on my laptop. So let's add some retries here.
-
JJ Kasper authored
-
Shu Ding authored
Reverts vercel/next.js#46861. This requires https://github.com/vercel/turbo/pull/4102 to be released and bindings to be updated first. ~Also depends on #46896 to be merged first, and conflicts to be resolved.~
-
JJ Kasper authored
This ensures we properly check for the none cached content correctly x-ref: https://github.com/vercel/next.js/actions/runs/4351711739/jobs/7603961011
-
Jiachi Liu authored
Add unique identifier `@app@` / `@pages@` / `@root@` for entry key of on demand entries, so that they'll be unique for each path when the page key is similar bewteen app and pages like (`"app/page"` and `"pages/page"` will both end up with `/page`) ## Bug Follow up for #46736 Closes NEXT-472 - [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) ---------
-
Shu Ding authored
This should be a special case of having a function as the client boundary's prop. Fixes NEXT-732, fixes #46573.
-
Shu Ding authored
Fixes NEXT-540.
-
Hannes Bornö authored
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.
-
Shu Ding authored
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. -
Hannes Bornö authored
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)
-
Balázs Orbán authored
### 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
-
Balázs Orbán authored
## 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
-
JJ Kasper authored
-
JJ Kasper authored
Follow-up to https://github.com/vercel/next.js/pull/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)
-