Commit graph

10968 commits

Author SHA1 Message Date
Kiko Beats
46d3f0e216
fix(next-url): print properly using logger symbol (#36097)
Hello,

This PR adds a method to have a custom inspect for `NextURL`

closes #35519
2022-04-12 15:31:29 +00:00
LongYinan
da6f271d9b
Interpolate module.exports as default import (#36082)
fixes https://github.com/vercel/next.js/issues/34412

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-12 14:32:42 +00:00
JJ Kasper
a9d6d9f71a
v12.1.5-canary.6 2022-04-11 16:27:07 -05:00
JJ Kasper
95a8f31d86
Fix outputStandalone with optimizeCss (#36028) 2022-04-11 16:14:28 -05:00
Ethan Arrowood
8c5797959c
update @vercel/nft to 0.18.1 (#36075)
* update @vercel/nft to 0.18.1

* update-compiled

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-04-11 15:45:40 -05:00
Gianmarco
807abde2ed
docs: suggest cloning with depth=1 to avoid huge downloads (#36064)
* docs: suggest cloning with depth=1 to avoid huge downloads

* Update contributing.md

Co-authored-by: JJ Kasper <jj@jjsweb.site>

* lint-fix

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-04-11 14:52:16 -05:00
JJ Kasper
505302619d
Update turbo cache key (#36074)
Seems we can download the wrong turbo cache depending on the target causing incorrect cache hits for example: https://github.com/vercel/next.js/runs/5976740062?check_suite_focus=true#step:16:11
2022-04-11 19:36:50 +00:00
JJ Kasper
da39e29c27
v12.1.5-canary.5 2022-04-11 12:00:35 -05:00
Rich Haines
d38a46e2e4
Revert "Improvements to the MDX Docs and replaced a leftover reference to babel" (#36066)
Reverts vercel/next.js#35332
2022-04-11 16:11:35 +00:00
Naoyuki Kanezawa
93678b569b
Do not add locale to link for api route and middleware preflight (#35994)
Fixes https://github.com/vercel/next.js/issues/33578

This PR fixes `Link` component as well to not add locale for api routes since both preflight redirect and link should work the same.

Additionally, it fixes the webdriver method `browser.waitForCondition()` for playwright to not wrap with function string.

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2022-04-11 15:59:07 +00:00
LongYinan
aaa823c3fa
Interpolate default exports is now unnecessary (#36065)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-11 15:36:25 +00:00
Aravind Putrevu
4f3e9e1009
[Examples] Updating with-elasticsearch to latest Elasticsearch lib version (#36063)
## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-04-11 14:52:17 +00:00
Amy Burns
9a7d175915
Moving middleware file (#36009)
This PR fixes a request from `@rauchg` that we specify more clearly that Middleware is Beta and organize it properly within the navigation. 

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-04-11 14:01:14 +00:00
Rishabh Poddar
3931888378
Update to with-supertokens example (#35991)
* add-supertokens-to-authentication.md

* bump supertokens deps

* update SuperTokens Auth doc

* Update docs/authentication.md

Co-authored-by: Lee Robinson <me@leerob.io>

* Update docs/authentication.md

Co-authored-by: Lee Robinson <me@leerob.io>

* updates supertokens dependency and optimises for serverless execution

* runs prettier-fix

* adds supertokens to 'Bring Your Own Database' section as well

* does not show home page if not logged in

* extracts config into its own file and calls it in all serverless functions

* removes need for backend init in app.jsx

* simplifies use of dynamic

* refreshes page after getServerSideProps

* removes unnecessary check in API

* update to docs pertaining SuperTokens

* adds placeholder secrets so that the UI loads on first run

* changes to readme

* updates version of supertokens frontend and backend SDK, and a few other fixes

* Update docs/authentication.md

Co-authored-by: Lee Robinson <me@leerob.io>

* updates to readme for supertokens example

* updates version of dependency

* updates dependency version

* updates to dependencies

* removes unnecessary config on frontend

* changes how redirection is done post signout

* update to dependency

* updates examples

* updates code to use for new package

* updates dependencies

* updates auth-react package

* with-supertokens example updated to use supertokens-node v7

* updates dependency

* updates supertokens-node version

* Update examples/with-supertokens/package.json

Co-authored-by: Lee Robinson <me@leerob.io>

* updates based on check-examples.sh script

* linter fix

* updates supertokens-auth-react dependency version

* adds development OAuth key to example

* removes section from README

* removes unnecessary file

* updates dependency versions

* with-supertokens: reduced bundle size by removing node lib from bundle

Linting fix

* Removed accidentally added config file

* adds sign in with apple

* extracted oauth keys to .env file

* fixes node init issue race condition

* removes unnecessary file

* updates supertokens-auth-react dependency

* updates superttokens-node dependency

* adds a cap to react dependency

* updates eslint-config-next version

* removes unnecessary dev dependency

* updates to latest version of supertokens-auth-react SDK

* Updated nextjs in supertokens example

* Update examples/with-supertokens/package.json

* Update examples/with-supertokens/package.json

* Update package.json

* Update examples/with-supertokens/package.json

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* Update examples/with-supertokens/package.json

Co-authored-by: Balázs Orbán <info@balazsorban.com>

Co-authored-by: NkxxkN <kevin@supertokens.io>
Co-authored-by: NkxxkN <kevin.antoine@protonmail.com>
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Rishabh <rishabh@supertokens.io>
Co-authored-by: Bhumil Sarvaiya <sarvaiyabhumil@gmail.com>
Co-authored-by: jscyo <joelsteve97@hotmail.com>
Co-authored-by: Mihaly Lengyel <mihaly.lengyel@tresorit.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-04-11 12:22:47 +02:00
Markos-Th09
5bf7265c35
Improvements to the MDX Docs and replaced a leftover reference to babel (#35332)
* Added next.config.mjs for @next/mdx

* Replaced leftover reference to babel

* Fixed formatting problem

* Added next-mdx-remote and @mdx-js/mdx as options
2022-04-11 12:21:43 +02:00
JJ Kasper
f6de29f9d4
Add note to contributing about docs manifest (#36020)
* Add note to contributing about docs manifest

* Update contributing.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-04-11 12:12:40 +02:00
Henrik Wenz
6c1cfc1000
[example] Fix bird animations in with-three-js example (#36053)
* Fix bird animations

* Use memo for birds generation
2022-04-11 12:11:08 +02:00
Donny/강동윤
16f7084e7f
feat(next-swc): Update swc crates (#35996)
* Move

* Adjust

* publish = false

* Tree

* Move tests

* fixup

* Split `emotion`

* Split `styled_jsx`

* Split `styled_jsx`

* fmt

* `--fix`

* clippy

* Update crates

* fixup

* publish

* Bump

* Rename

* authors

* Update

* More update

* Oh

* Update test refs

* Update test refs

* Update again

* Fix
2022-04-11 11:59:16 +02:00
LongYinan
01109734ce
Interpolate default exports (#35933)
* Add failing test for next/link next/image with "type": "module"

* Interpolate default exports

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2022-04-11 16:43:44 +08:00
Shu Ding
1ed38dd2d0
Support export all syntax in client components (#36027)
This PR adds the support of the `export * from './foo'` syntax in client components.

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-09 01:26:16 +00:00
Steven
0a04ab7478
Fix leaking internal config to user-defined loader prop in next/image (#36013)
The `config` was changed from a global variable to a function parameter of the `loader()` function in PR https://github.com/vercel/next.js/pull/33559 as an implementation detail, not as a public API. It was not meant to be used by the end user which is why it was [undocumented](https://nextjs.org/docs/api-reference/next/image#loader).

This config is meant for the default Image Optimization API. Since the `loader` prop bypasses the default Image Optimization API in favor of a custom function, that config is no longer be relevant because the function can implement the optimization url however it desires.

- Fixes #35115
2022-04-08 22:19:25 +00:00
JJ Kasper
a0924fc7c7
Add docs for x-nextjs-cache header (#36023)
This adds documentation for the `x-nextjs-cache` header which is now exposed for ISR pages and image optimization requests to help signal the cache state. 

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

Co-authored-by: Steven <steven@ceriously.com>
2022-04-08 17:38:50 -04:00
Tobias Koppers
f4fbb83d4a
allow to provide postcss plugin options as a string (#35173)
fixes https://github.com/vercel/next.js/issues/35117

@balazsorban44 this needs a test case

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`


Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2022-04-08 16:58:50 +00:00
Shu Ding
3d4f4c6995
Update the docs for Switchable Runtime (#36015)
As per the feedback in #35952.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-08 16:26:14 +00:00
Björn
9c12d85c5d
Mention HTTP 303 See Other in redirects section (#35997)
Migrating from express to nextjs API routes broke one of our APIs because of how `redirect` works in nextjs vs. how it works in express. We need to redirect the user to a confirmation page via GET after making a POST request, which is not possible with `redirect`.

HTTP 303 seems to be the way to go in that case and I think it should be mentioned here.


## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-08 15:52:34 +00:00
Jiachi Liu
de0bc57b6e
test: organize react 18 tests (#36003)
* Organize react 18 test cases, group invalid cases to speed up the regular test cases
* Add `runDevSuite` and `runProdSuite` for group next dev/prod test cases

```js
runDevSuite(name, appDir, {
  runTests: (context, env) => { ... },
  beforeAll,
  afterAll,
})

runProdvSuite(name, appDir, {
  runTests: (context, env) => { ... },
  beforeAll,
  afterAll,
})
```
2022-04-08 15:29:35 +00:00
Shu Ding
1c92591466
Update docs related to React 18 (#35952)
* update docs of streaming

* add switchable runtime docs

* add page to manifest

* Apply suggestions from code review

Co-authored-by: Steven <steven@ceriously.com>

* Update docs/advanced-features/react-18/streaming.md

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Steven <steven@ceriously.com>
2022-04-08 17:09:55 +02:00
Jiachi Liu
eddf1715ee
Use renderToString for flush effects (#35999)
Use render to string call to render flush effects instead of rendering with stream plus converting to string
2022-04-08 14:22:25 +00:00
Shu Ding
d8623bb90f
Use eager import to include client modules (#35979)
Eager import does almost the same thing as `require()` but it instead also supports loading an ES module.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-08 10:53:02 +00:00
Francis Gulotta
5feb400aff
docs: clarify when you use getServerSideProps (#35922)
Removed the misleading TTFB information. It was easy to read that incorrectly and while getStaticProps does have a better TTFB that's not why you might need to avoid getServerSideProps, I gave better examples. 

I also wanted to answer "well how do I cache `getServerSideProps`?" and now there's a link.

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-04-07 22:00:28 +00:00
Jiachi Liu
630bf80a22
Support shared component with next built-in client components (#35975)
Fixes #35449

Include the shared components (from source code) is in client bundles, previously we lost them so that the client components imported by them are lost in module graph

* let flight server loader apply to all pages and imported modules (except node_modules at the moment)
* if it's a shared component from source code, include it in client bundle
* ignore handling node_modules at the moment (due to the limitation support of esm imports with RSC)

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
2022-04-07 19:45:33 +00:00
Shu Ding
51d7153ea8
Add test case for module resolution in node_modules from different contexts (#35978)
The same module should be created as 2 instances if it's imported from different contexts (server or client).

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-07 19:16:02 +00:00
JJ Kasper
345f5cc351
v12.1.5-canary.4 2022-04-07 11:41:10 -05:00
JJ Kasper
26aacb04fb
Ensure minimalMode previousCache expire time is capped (#35954) 2022-04-07 11:32:45 -05:00
Tobias Koppers
0164ac60f2
update webpack (#35867)
https://github.com/webpack/webpack/releases/tag/v5.70.0
https://github.com/webpack/webpack/releases/tag/v5.71.0
https://github.com/webpack/webpack/releases/tag/v5.72.0
2022-04-07 16:00:26 +00:00
Jake Jarvis
f308826603
Add .eslintrc.cjs to list of supported next lint config files (#35440)
The logic for finding a user's custom `.eslintrc` config file is missing a check for `.eslintrc.cjs`, which is listed as one of the valid filenames in ESLint's docs:

https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats

...so this PR makes `next lint`'s list of possible config files consistent with ESLint's.

I stumbled upon this when trying to rename my own config file, since I've pretty much moved completely to ESM by now... but [ESLint doesn't support modules yet](https://github.com/eslint/eslint/issues/14137#issuecomment-785421664), so renaming the file to `.cjs` just keeps things cleaner (and VS Code happier). This is my first PR here so even though I've only changed a couple of lines, please let me know if I'm overlooking something! 😊

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2022-04-07 15:03:40 +00:00
Shu Ding
049bb22c1c
Update polyfill of web streams (#35571)
* attach pipeTo and pipeThrough polyfills to instance

* remove transformer polyfill

* remove polyfill

* fix missing polyfill in sandbox

* always polyfill the runtime

* always polyfill web streams in renderer

* fix missing AbortController and AbortSignal

* type fix

* fix type generation

* use global

Co-authored-by: Shu Ding <shu@shus-mac-studio.localdomain>
2022-04-07 16:26:30 +02:00
John Daly
9110b5a4f1
Emotion SWC Plugin - Allow for jsxImportSource to be configurable (#35963)
* Allowing the jsxImportSource to be configurable when using the Emotion SWC plugin

* Adding test case

* Addressing PR feedback

* Moving getEmotionOptions call back to where it was previously

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-04-07 14:33:38 +02:00
Naoyuki Kanezawa
633050402f
fix: add locale prefix to middleware preflight url (#35911)
Fixes part of https://github.com/vercel/next.js/issues/34274

Navigating to `/` causes to redirect preflight request to a url of browser language like `/en`. 
This PR fixes to add the locale prefix always so that the redirect does not happen anymore and middleware can get a correct locale.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-07 11:39:49 +00:00
Shu Ding
ad99734489
Fix flaky test (#35951)
Failed here: https://github.com/vercel/next.js/runs/5855144575?check_suite_focus=true#step:9:1795

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-06 20:41:13 +00:00
JJ Kasper
211ce73c87
v12.1.5-canary.3 2022-04-06 13:34:56 -05:00
Shu Ding
d0bf3ee64c
Code refactoring (#35937)
Clean up some code in the renderer and make it more readable.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-06 15:45:06 +00:00
Samuel
cb565d69cf
Update: Add appropriate error message when for getServerSideProps invalid return value (#35887) 2022-04-06 10:25:27 -05:00
Sølve Tornøe
07723be8b3
Refactor default locale prefix to support clone() (#35874)
## Bug
fixes https://github.com/vercel/next.js/issues/35273

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`


## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-06 15:00:39 +00:00
Naoyuki Kanezawa
9805399faa
Revert "fix the dynamic routing of middleware" (#35932)
Reverts vercel/next.js#32601
2022-04-06 14:35:52 +00:00
Shu Ding
d3af135f99
Fix data encoder and decoder to use stream in renderer (#35936)
There are several places where the decoder should have `stream: true`. Also changed the `encodeText(extraChunk + decodeText(chunk))` pattern to just emit two chunks.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-06 13:34:24 +00:00
白宦成
5a627019e9
fix: toBeInTheDocument is not a function (#35930)
fix when run jest with error "TypeError: expect(...).toBeInTheDocument is not a function"



![image](https://user-images.githubusercontent.com/13283837/161903133-501f6f6b-8623-4b1f-986f-0faa32b3ef91.png)

## Feature
- [x] Documentation added

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-04-06 13:13:45 +00:00
Aman Mittal
5429e8f12e
Update Manual Steps in Getting Started guide (#35898)
This PR add necessary information to the Manual Section to add directories such as `pages` and `public`.

## Bug

- [x] Related issues linked using fixes #29479 
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-06 13:06:50 +00:00
JJ Kasper
e146168c3b
v12.1.5-canary.2 2022-04-05 18:34:29 -05:00
Steven
cec388cde2
Fix Firefox flash of white on next/image with placeholder=blur (#35889)
## History

In PR #24153, `placeholder=blur` was added and it set `element.style.backgroundImage = 'none'` instead of using react state to re-render. Then in PR  #25916, a delay was added to handle removing the blur placeholder. Then in PR #25994, `img.decode()` was utilized but we found this caused problems in Firefox in #26011.

## Today

This PR changes the the blur placeholder removal to use react state to re-render. This _should_ prevent Firefox from erroring although we should probably keep the catch() just in case. This was pointed out when React 18 caused subtle differences in Firefox in this comment https://github.com/vercel/next.js/issues/30128#issuecomment-1086754374
2022-04-05 22:47:55 +00:00