- [x] Depends on https://github.com/vercel/next.js/pull/45776
Turbotrace occupies too many memories while running; this PR makes it
run after the webpack build is finished, it can reduce the memory
hogging by webpack and turbotrace, thus avoiding OOM
The `maxFiles` option in turbotrace is removed because there is
`memoryLimit` option takes over its role.
Close WEB-556
Fixes#44424 by adding the `app` folder to an `ESLINT_DEFAULT_DIRS`
constant which defines all folders where the linter should go through.
## 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)
---------
Co-authored-by: JJ Kasper <jj@jjsweb.site>
This fixes a regression in our source map generating which got lost in
the big diff from the `src` folder restructure in
https://github.com/vercel/next.js/pull/44405
These invalid source maps broken plugins that attempted to leverage them
like `@sentry/nextjs` which only attempts in a production environment
15ec85bead/packages/nextjs/src/config/webpack.ts (L586)
For a regression test in a follow-up we will need to investigate a
production test fixture with `@sentry/nextjs` although this requires a
DSN be configured.
This also ensures we setup `unhandledRejection` and `uncaughtException`
listeners during build so that we have proper stack information when
these occur and the process isn't left hanging.
This also moves the `extensionAlias` config from
https://github.com/vercel/next.js/pull/44177 to an experimental config
as it seems to cause conflicts with ESM packages that define `exports`
in their `package.json` which can be considered a breaking change.
## Bug
- [x] 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)
Fixes: https://github.com/vercel/next.js/issues/45419
x-ref: [slack
thread](https://vercel.slack.com/archives/C03DQ3QFV7C/p1674937545579229)
We currently don't make it obvious when next export is being leveraged
and middleware is present which won't work when deployed to a static
host so this ensures we warn the same way we do for API routes.
x-ref: https://github.com/vercel/vercel/pull/9319
This option was initialial added in #8378.
This pr removes `config.experimental.profiling` since this option is no
longer used.
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Fixes handling in isolated tests for windows and adds initial setup to run the main `app-dir` test suite. Also adds retrying when fetching test timings fails due to rate limiting.
Closes: https://github.com/vercel/next.js/pull/44331
The default behavior for svg is `dangerouslyAllowSVG: false` which means we won't try to optimize the image because its vector (see #34431 for more).
However, svg was incorrectly getting the `srcset` attribute assigned which would contain duplicate information like:
```
/test.svg 1x, /test.svg 2x
```
So this PR makes sure we treat svg the same as `unoptimized: true`, meaning there is no `srcset` generated. Note that this PR won't change the behavior if `loader` is defined or if `dangerouslyAllowSVG: true`.
This fixes a bug where next.config.js was configured with `images.unoptimzed: true` but the Image Optimization API was not truly disabled. Since there is no way to override the config at the component level, its safe to say the API can be disabled.
# Reverts vercel/next.js#43587
PR #43587 breaks the `placeholder="blur"` property on the `<Image />`
component by keeping the `blurStyles`, e.g. the blurred image, after the
image is loaded.
**This regression does _not_ introduce any breaking changes or bugs.**
---
The reason for the original PR was:
> This PR remove `React.useState()` from the `next/image` component. It
was only used in the `onError` case and it was causing Safari to become
very slow when there were many images on the same page. We were seeing
1s delay blocking the main thread when there were about 350 images on
the same page. Chrome and Firefox were not slow.
The original PR is a performance improvement for Safari on a corner
case.
Additionally, when tackling this performance improvement again, the
`blurStyle` needs to know when the the image is done loading so it can
get rid of the blur. The state is updated in `handeLoading()` and isn't
just used `onError`.
## Fixes issues
- Fixes#43829
- Fixes#43689
## To reproduce
For reference this when #43587 was pulled into Next.js
[v13.0.6-canary.3](https://github.com/vercel/next.js/blob/v13.0.6-canary.3/packages/next/client/image.tsx)
- Regress the `image.tsx` to
[v13.0.6-canary.2](https://github.com/vercel/next.js/blob/v13.0.6-canary.2/packages/next/client/image.tsx)
- Do a local build with the regressed `image.tsx` on (current canary
build)
[v13.0.8-canary.0](https://github.com/vercel/next.js/releases/tag/v13.0.8-canary.0)
- Example code, (import any image you like) make sure to use
`placeholder="blur"`
```typescript
import Image from 'next/image'
import CatImage from '../public/cat.png'
<Image
src={CatImage}
width={500}
height={500}
alt="Cat"
priority
placeholder="blur"
/>
```
- Image will still have the blur after the image is loaded
- Before and after screenshot
![before](https://user-images.githubusercontent.com/1037693/208206084-bd6fa143-ca19-4fda-9f4e-8fcec9836848.png)
![after](https://user-images.githubusercontent.com/229881/208470446-3a00eac6-f82e-4017-bd9f-7c6145456959.png)
Co-authored-by: Steven <steven@ceriously.com>
<!--
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 that you're making:
-->
These tests are run via an env variable now instead so we can remove the
hard coded handling
## 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)
Fixes#43854 , followup for #44011. Normalize the bundlePath so it works
in all cases
## 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)