The `encode-decode.ts` file is completely replaceable with the
[`TextDecoderStream`](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoderStream)
api, but also we can simplify the `streamToString` function too.
Working on some benchmarks now - wanted to get CI running to see if this
breaks anything though.
### What?
I'm recreating a PR because CI of
https://github.com/vercel/next.js/pull/58712 uses `lightningcss@1.14.0`
for an unknown reason.
Add an opt-in feature to use `lightningcss` instead of webpack
css-loader.
### Why?
In the name of performance.
### How?
This PR is largely based on https://github.com/fz6m/lightningcss-loader
by @fz6m.
(Thank you for nice work)
Closes PACK-1998
Closes PACK-2124
---------
Co-authored-by: OJ Kwon <1210596+kwonoj@users.noreply.github.com>
### What
I noticed the font manifest generated by Turbopack was always empty.
Debugging showed that the path to the client_root was always incorrect
when calculating `get_font_paths_from_root`. And also fixed an issue
where for certain paths, the (`/index`) manifest key should contain the
original path.
Closes PACK-2666
Similar to #62611, this implements error stack translation for edge
runtime app render errors.
Test Plan: `TURBOPACK=1 pnpm test-dev
test/development/app-render-error-log/app-render-error-log.test.ts`
Closes PACK-2665
We didn't set the property of manifest before, this PR fixes the missing
prop
> If the manifest requires credentials to fetch, the crossorigin
attribute must be set to use-credentials, even if the manifest file is
in the same origin as the current page.
x-ref: https://developer.mozilla.org/en-US/docs/Web/Manifest
Fixes NEXT-2706
Small update to mention TS paths when changing to src/ directory as it
is something most users will need to do.
Co-authored-by: Sam Ko <sam@vercel.com>
app dir is always "enabled", but not always exists. Rename to the proper
word to describe. Found this confusion while developing other fetaures
Closes NEXT-2691
In other output modes, link and script tags do not contain a crossorigin
attribute by default.
When using output: "export", it should also follow the other output
modes, to avoid unnecessary CORS issues, especially when hosting the
assets on a different domain (i.e. a CDN).
fixes#61210
Co-authored-by: Steven <steven@ceriously.com>
This simplifies our `getLastStable` handling to use our GitHub latest
release as the source of truth instead of trying to parse this from the
git history as that can be less reliable depending on the checkout depth
and the order of releases.
x-ref:
https://github.com/vercel/next.js/actions/runs/8149447058/job/22274305183
Closes NEXT-2704
To reproduce:
- go to https://next.new/
- run `next build`
- it breaks
```sh
~/projects/nextjs-pdjpmx
❯ npm install && npx next dev
added 328 packages in 6s
116 packages are looking for funding
run `npm fund` for details
▲ Next.js 14.1.0
- Local: http://localhost:3000
Downloading swc package @next/swc-wasm-nodejs...
✓ Ready in 5.7s
○ Compiling / ...
✓ Compiled / in 9.2s (510 modules)
✓ Compiled in 483ms (240 modules)
^C
~/projects/nextjs-pdjpmx 27s
❯ npx next build
▲ Next.js 14.1.0
Creating an optimized production build ...
> Build error occurred
TypeError: process.stdout._handle.setBlocking is not a function
at loadBindings (file:///home/projects/nextjs-pdjpmx/node_modules/next/dist/build/swc/index.js:231:32)
at getBaseWebpackConfig (file:///home/projects/nextjs-pdjpmx/node_modules/next/dist/build/webpack-config.js:333:37)
at eval (file:///home/projects/nextjs-pdjpmx/node_modules/next/dist/build/webpack-build/impl.js:140:40)
at async Span.traceAsyncFn (file:///home/projects/nextjs-pdjpmx/node_modules/next/dist/trace/trace.js:151:20)
at async webpackBuildImpl (file:///home/projects/nextjs-pdjpmx/node_modules/next/dist/build/webpack-build/impl.js:133:21)
at async Object.workerMain (file:///home/projects/nextjs-pdjpmx/node_modules/next/dist/build/webpack-build/impl.js:313:20) {
type: 'TypeError'
}
```
fixes#61848
<!-- 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 #
-->
Co-authored-by: JJ Kasper <jj@jjsweb.site>
As discussed this updates our canary semver bumping to use `preminor`
instead of `prerelease` to avoid overlap with patches/backports and make
it more clear for users which versions go along together.
x-ref: [slack
thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1709583075769789)
Closes NEXT-2701
This removes the hacky handling for executing lerna with using the
official commands directly, this also removes the legacy package.json
scripts we had for publishing.
Closes NEXT-2700
---------
Co-authored-by: Zack Tanner <zacktanner@gmail.com>
This PR reverts part of #61877 passing an absolute path to the distDir
value when running `next lint`.
Fixes#62796
Co-authored-by: Sam Ko <sam@vercel.com>
These tests were added back when the router would suspend in reducers,
primarily to test that things were working as expected during concurrent
rendering. Now that we don't suspend in reducers, most of these tests
aren't actually adding much value, and instead introduce friction
anytime we want to change the router state since they're currently
relying on snapshotting.
Before removing these tests, I verified that we have a corresponding e2e
test that covers the expected behaviors more explicitly. Specifically:
- `test/e2e/app-dir/actions` (server actions)
- `test/e2e/app-dir/navigation` (navigation tests & router.refresh)
- `test/e2e/app-dir/app-client-cache` and
`test/e2e/app-dir/app-prefetch` (prefetch & router cache behavior)
- `test/e2e/app-dir/router-autoscroll` (navigation auto-scrolling
behavior)
<!-- 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 #
-->
Closes NEXT-2669
Reverting this experimental flag as it should not be used and we are
going to investigate experimenting with this further upstream so that it
can be done properly.
This reverts commit 2bdcaa0fda.
x-ref: https://github.com/vercel/next.js/pull/62668
Closes NEXT-2689
### What
Align with original route loader, explicitly throw on invalid handler
import.
This does not fixes test currently - other failures on the specific test
need to be solved.
Closes PACK-2652