Commit graph

9720 commits

Author SHA1 Message Date
Tim Neutkens
1ddd8de166
Add Next.js version to trace (#30881) 2021-11-03 12:51:55 +01:00
Maia Teegarden
5f72810dd6
Fix lost combinator before global (#30771) 2021-11-03 10:00:49 +01:00
Donny/강동윤
2004d49198
Update swc (#30859) 2021-11-03 09:31:31 +01:00
jj@jjsweb.site
5f19f766fd
v12.0.3-canary.2 2021-11-02 21:19:41 -05:00
Shu Ding
0fa233b727
Fix client component imports are not being correctly tracked (#30853)
* ensure client components are correctly tracked in the client compilation

* fix test
2021-11-02 21:14:14 -05:00
JJ Kasper
3aff5d4f00
Ensure correct tmpdir is used for install-native (#30855)
* Ensure correct tmpdir is used for install-native

* Use execa for Windows

* lint-fix
2021-11-02 20:30:44 -05:00
JJ Kasper
507ac981ef
Ensure dev react bundles are not ignored in traces (#30849)
* Ensure dev react bundles are not ignored in traces

* update test

* update lock
2021-11-02 19:02:16 -05:00
Maia Teegarden
b2b7e78cef
Add postinstall script to install native packages (#30850)
* Add postinstall script to install native packages

* Use a subdirectory of tmpdir

* Ensure tmpdir exists

* Remove tmpdir once done

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

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-11-02 16:37:25 -07:00
Tobias Koppers
3674ccb3df
update mini-css-plugin and remove experimentalUseImportModule (#30617)
- Fixes #30366
- Closes #30367
2021-11-02 21:56:11 +00:00
Jiachi Liu
ce1a170687
Improve error message for importing unsupported native modules (#30829)
Improvement for #30696, covering more native module when failed on edge runtime
2021-11-02 21:03:29 +00:00
Steven
14841c9430
Fix incorrect _document.js error when disableStaticImages: true (#30768)
Fixes #30600
2021-11-02 20:25:12 +00:00
Evan Bradley
f3f4fced09
Don't require source files to be writeable in dev mode (#30758)
Currently, hot reloading is broken when running dev mode in systems
like Bazel, where the source files are marked as read-only. The goal of
the check is merely to see if a file exists, so checking for read
permissions should be sufficient.

Let me know if any additional information is needed. I didn't see any
good spots to add tests, but I'm willing to add them with some
guidance.


## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2021-11-02 19:48:23 +00:00
JJ Kasper
c8d0a1bc0b
Re-enable minifying middleware chunks (#30823)
This re-enables minifying middleware chunks as testing on nextjs.org and front shows it is working properly now. The separation of middleware chunks from other client chunks is still kept in this PR to ensure client code doesn't leak into middleware bundles. 

Closes: https://github.com/vercel/next.js/issues/30798

## 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`
2021-11-02 17:37:50 +00:00
Tim Neutkens
cbc52d1b31
Update loader-utils (#30743)
Co-authored-by: jj@jjsweb.site <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2021-11-02 16:13:15 +01:00
Iris van Ollefen
d5d1bc0012
Update response-helpers.md (#30816)
In Setting the status code of a response, it says "returns a name property with the value of John Doe as a JSON response". But, the code example actually returns a message property with a different value.

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-11-02 13:08:36 +00:00
Tim Neutkens
bc7a0be64a v12.0.3-canary.1 2021-11-02 12:22:31 +01:00
Tim Neutkens
64e414160d
Add regenerator path (#30786) 2021-11-02 12:11:53 +01:00
Donny/강동윤
e79f788f74
Update swc (#30790)
## 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`



This PR applies

 - https://github.com/swc-project/swc/pull/2610

This increases the pass limit (which is required to prevent hanging) from 30 to 100.
Fixes https://github.com/vercel/next.js/issues/30636.

 - https://github.com/swc-project/swc/pull/2625

This marks assignment with operators as `usage`+ `assign`. Previously it was only `assisgn`. This is to preserve assignments to variables used like `(a += '').split('.'))`.

Fixes https://github.com/vercel/next.js/issues/30414.

---

I expect this to fix some more issues on next.js repository, but I didn't list them because it's not tested.
2021-11-02 10:57:09 +00:00
JJ Kasper
7cd9ffc519
Add note about rewrites query updating (#30747)
This adds a note for the query being updated for rewrites on static pages. 

Closes: https://github.com/vercel/next.js/issues/30720

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-11-02 10:17:09 +00:00
PrashoonB
147b0f9ebc
Upgraded the node-notifier version to 8.0.1 (#30777)
## 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`
2021-11-02 10:05:26 +00:00
Rodrigo Delduca
4aa17e7eba
Optimize other fonts provide by Google (#30554)
Co-authored-by: Steven <steven@ceriously.com>
2021-11-02 10:24:55 +01:00
Tim Neutkens
c6b98d59c7 v12.0.3-canary.0 2021-11-02 09:26:26 +01:00
Kam Figy
b95bc4b74b
Prevent storing page props cache when in SSG + preview mode (#30757)
In Next 12, `router.replace()` treats the page props cache as authoritative when fetching SSG props in preview mode. This makes sense outside preview mode (static props won't change), but within preview mode this prevents reloading the preview data dynamically without force-refreshing the page.

This PR fixes the problem by instructing Next to bypass the props cache if it's an SSG route AND preview mode is on.

Repro: https://github.com/kamsar/next-replace-previewmode-staticprops/blob/main/pages/index.js



## Bug

- [x] Related issues linked using `fixes #number`: Fixes https://github.com/vercel/next.js/issues/30756
- [ ] Integration tests added: Did not find existing tests for the router, but I'd be happy to write one if someone could point me in the right direction.
2021-11-02 00:42:29 +00:00
Rishabh Poddar
597594d429
Updates dependencies for with-supertokens example (#30162) 2021-11-01 19:07:03 -05:00
Steven
f3fcb81d92
Relax restriction of images.path in next.config.js (#30741)
The built-in `imgixLoader()` unexpectedly works with `image.path = ''` and `src` as an absolute URL.

So we need to relax this restriction for now until we can officially deprecate built-in loaders (eventually they can all be implemented in userland via loader prop).

- Follow up to #30080
2021-11-02 00:00:47 +00:00
ihmpavel
2027d1fe7d
Fix invalid character in next/image header "Content-Disposition" (#30287)
* Image content disposition

* Add tests

* Fixed import

* Add TS types

* Revert readme.md

* Alphabet sorting

* Compile `content-disposition`

* Rename for tests

* Fix test

* Fix accidentally added letter

Co-authored-by: Steven <steven@ceriously.com>
2021-11-01 19:23:24 -04:00
Steven
beedff291e
Add Node.js 17 to CI (#30760)
This will make sure #30743 doesn't regress
2021-11-01 21:24:15 +00:00
stef
5abfea3765
Recommend using next CLI for Docker entrypoint and not yarn (#29024)
Fixes #29023 

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] 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
2021-11-01 20:26:14 +00:00
Maia Teegarden
a89e65133d
Keep attempting to load binary files after failure (#30755)
Multiple binaries may be installed when only one of them will work with
the host machine (limitation of `optionalDependencies`). Failing to
`require` a binary that exists does not necessarily mean there is a
problem with the binary. We need to keep checking if other binaries work.

Fixes #30713



## 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`
2021-11-01 20:14:28 +00:00
Jiachi Liu
4ac0227423
docs: update react 18 configuration (#30726)
* Add `next/head` as unsupported for rsc
* Change the description about `_document` page
2021-11-01 19:34:13 +00:00
Vadym Shymko
bcdfb99e5a
Fix link to Elasticsearch products page (#30752)
Small typo fix in `with-elasticsearch` example

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-11-01 19:22:29 +00:00
matamatanot
187ad180c2
remove binary-cache (#30658) 2021-11-01 14:11:14 -05:00
JJ Kasper
fc21a20311
Fix a couple more missing doc only checks (#30748) 2021-11-01 11:51:30 -05:00
JJ Kasper
ea91b9def5
Ensure dev binary download skips for docs only change (#30746) 2021-11-01 11:20:46 -05:00
Erik Hedberg
cd36e8c9d4
Fix spelling error (#30737) 2021-11-01 16:30:40 +01:00
Shu Ding
73928c01f1
Improve error message for importing native Node APIs in the edge runtime (#30696)
This PR improves the error message for the case that `fs` is being imported under `concurrentFeatures`. This is a common error, but the current console output isn't very clear about the cause.

The new output will be:

> Native Node.js APIs are not supported in the Edge Runtime with \`concurrentFeatures\` enabled. Found \`fs\` imported.

Related to #30424.

## Bug

- [x] 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`
2021-11-01 11:40:21 +00:00
Lee Robinson
a9ec61ea03
Add workaround for prefixing the default locale to the docs. (#30673) 2021-11-01 07:37:07 +01:00
Lee Robinson
175dd0f286
Add security notes to the URL imports documentation. (#30708) 2021-11-01 07:35:25 +01:00
JJ Kasper
900ec48c03
Add note about HMR WebSocket to upgrade guide (#30704)
Co-authored-by: Lee Robinson <me@leerob.io>
2021-11-01 07:27:04 +01:00
Tim Neutkens
99abb8bfd7 v12.0.2 2021-10-31 15:55:15 +01:00
Tim Neutkens
98287900d0 v12.0.2-canary.14 2021-10-31 14:35:36 +01:00
Donny/강동윤
39283f1846
Update swc (#30685)
## 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`




- This fixes error message about unsupported cpu features.
- This applies https://github.com/swc-project/swc/pull/2597
  - This fix an infinite loop issue related to `@ericblade/quagga2`
2021-10-31 12:15:39 +00:00
jj@jjsweb.site
02e0dbc3c2
v12.0.2-canary.13 2021-10-30 18:20:25 -05:00
Tim Neutkens
8a6307fc57
Remove isCommonJS check as it has been moved to next-swc (#30677)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-10-30 17:37:35 -05:00
Jiachi Liu
622a1a5549
Provide default fallback _document and _app for for concurrent mode (#30642)
* if _app is not provided, fallback to default _app page
* If _document is not provided, fallback to inline functional components version or use the default
* if Document gIP is provided, error

Closes #30654
2021-10-30 21:35:31 +00:00
Julien Zapata Duque
c12ae5ea39
correct Next.js 11 upgrade instructions (#30665)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-30 21:20:17 +02:00
Tim Neutkens
90fad00dfe v12.0.2-canary.12 2021-10-30 15:56:45 +02:00
Donny/강동윤
4ada314663
Add auto-commonjs and update swc (#30661)
Closes #30596



## 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`


 - This patch contains several patches from swc.

This includes https://github.com/swc-project/swc/pull/2581, which allows customizing the import path for regenerator.

 - This adds auto-detection of common js.

If `module.exports` is found and module config is not set, module config becomes common js.

 - As bonus, this includes some performance improvements

The logic for analyzing the input source file and parsing options as json is moved from the js thread to a background worker thread.
2021-10-30 13:31:58 +00:00
Leroy Witteveen
d8cb8c5fbc
Fixed "Expected jsx identifier" error on TypeScript generics & angle bracket type assertions in .ts files (#30619)
* Fixed "Expected jsx identifier" error on TypeScript generics & angle bracket type assertions

* Ignore error from node-notifier on M1

* Add tests

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-30 14:51:42 +02:00
JJ Kasper
d7d1a05208
Ensure native binary is available for release stats (#30649) 2021-10-30 12:54:42 +02:00