Commit graph

6068 commits

Author SHA1 Message Date
JJ Kasper
47a6120738
Update .env HMR handling (#39566) 2022-08-13 11:55:55 -05:00
Tim Neutkens
91d09bbad0
Rename page -> entry in on-demand-entry-handler (#39564)
Given that it's not just pages now I've renamed the entry handling.


## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-12 21:40:41 +00:00
Shu Ding
9cfa9945f0
Eliminate Amp in Edge runtime (#39560)
Amp mode is always disabled in the Edge runtime:

b5aa571c71/packages/next/server/render.tsx (L588)

So we can safely add the additional condition (`process.env.NEXT_RUNTIME !== 'edge' &&`) for the compiler to do DCE.

## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-12 19:29:39 +00:00
Jiachi Liu
aef60dc581
Support multiple flush effects (#39559)
Bring more flexibility for consume flush effects in separate places. Then you can move it into different client components roots
2022-08-12 19:06:08 +00:00
Tim Neutkens
2b2c2acf6e
Refactor handling of addPageEntry promise (#39547)
Follow-up to #39162. Refactors `addPageEntry` to no longer add into the `added` map.


## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-12 17:41:04 +00:00
Jiachi Liu
3c9ad33c69
Remove precopied styled-jsx (#39520)
follow-up for #39518

* revert `styled-jsx/style` import path to `next/dist/shared/styled-jsx`
* Since `styled-jsx` cannot be resolved through `node_modules/next/node_modules` by external resolving, we forcedly resolve styled-jsx as cjs external in webpack


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-12 17:08:38 +00:00
Shu Ding
0c95a93858
Eliminate path polyfill and incremental-cache from base server (#39548)
Continue to optimize the base server to make it leaner. These are only needed by the Node.js server currently.

Related:
- #39433
- #39045
- #39044
- #39037

## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-12 15:25:47 +00:00
Tim Neutkens
b5aa571c71
Refactor client entry plugin to separate methods. (#39162)
WIP.


## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


Co-authored-by: Shu Ding <3676859+shuding@users.noreply.github.com>
2022-08-12 13:01:19 +00:00
JJ Kasper
911ba233d9
v12.2.5 2022-08-11 20:50:08 -05:00
JJ Kasper
d06fc0f0c4
v12.2.5-canary.7 2022-08-11 19:17:02 -05:00
JJ Kasper
4049cd7cb5
Re-add styled-jsx as a normal dependency (#39518)
This re-adds `styled-jsx` as a normal dependency for now leaving the require hook in place so that we can correctly handle mis-matching versions in the module tree. 

x-ref: [slack thread](https://vercel.slack.com/archives/C02CDC2ALJH/p1660254377444709)

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2022-08-11 23:54:26 +00:00
JJ Kasper
de1bf3e471
v12.2.5-canary.6 2022-08-11 16:46:44 -05:00
Tim Neutkens
db9040b0b8
Enable @typescript-eslint/no-use-before-define variables,enums,typedefs for core files (#39511)
* Enable @typescript-eslint/no-use-before-define typedefs and enums

* Enable variables

* Move in client/index

* Revert "Move in client/index"

This reverts commit 592d70cf3d9cd39e741905faf9229f664c9b4ebd.

* Move wrapApp

* Revert "Revert "Move in client/index""

This reverts commit 14b6105eb45ab87b3b4a1d6f2907d8b9e9657888.

* Fix classes cases
2022-08-11 16:32:52 -05:00
Tim
d510758b52
fix: ensure hidden iframe apps render in development mode (#39514) 2022-08-11 16:22:19 -05:00
Alex Castle
13a5eb2228
Add position styling to future fill images (#39438)
This PR adds default style properties to a fill-mode image using `next/future/image` of 0 for all positions. This should replicate the existing `layout="fill"` behavior better, and make it easier to migrate.

Tests are also added for fill styling.
2022-08-11 18:16:05 +00:00
JJ Kasper
a9b415b850
v12.2.5-canary.5 2022-08-11 12:09:48 -05:00
Jiachi Liu
7f54585f8d
Bump styled-jsx and remove manual types creation (#39506) 2022-08-11 10:13:26 -05:00
JJ Kasper
d158c0c580
Make dev watch ignore more specific (#39504)
This fixes the case where we were incorrectly ignoring the next-auth API endpoint since it matched the `.next` watch ignore and also adds a test case to ensure we match this route correctly. 

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/39495
2022-08-11 15:09:57 +00:00
JJ Kasper
f863ba7193
v12.2.5-canary.4 2022-08-10 23:00:59 -05:00
Noel Kim (김민혁)
40f0eb126b
feat(next-swc/modularize_imports): Add Kebab case (#38583)
* Feat: Add Kebab case

* Add document

* Feat: Add Kebab case

* Add document

* Add Test cases
2022-08-10 22:51:05 -05:00
JJ Kasper
4e6d05575e
Add hot-reloading for env file changes (#38483)
* Add hot-reloading for env file changes

* update watching

* update test

* update initial env handling

* undo test change

* add comment for entries clearing

* update on-demand-entry-handler restart handling

* lint-fix

* handle bad plugin
2022-08-10 22:27:48 -05:00
X7Becka
970469f359
FIX GAUSSIAN BLUR IN FUTURE\IMAGE (#39190)
## Bug

- [fixes #39035 ] 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-11 00:09:42 +00:00
JJ Kasper
d246257602
v12.2.5-canary.3 2022-08-10 18:18:54 -05:00
JJ Kasper
44eea0c9c9
v12.2.5-canary.2 2022-08-10 15:32:25 -05:00
JJ Kasper
c9aa2ea2cf
Tweak styled-jsx type declarations (#39474)
* Tweak styled-jsx type declarations

* fix lint
2022-08-10 15:26:54 -05:00
Wyatt Johnson
f5cab2f515
App Build Stats (#38884)
## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-10 19:31:01 +00:00
JJ Kasper
b15a976e11
Handle rewriting WebSocket requests (#39463)
This ensures we properly handle rewrites when the request is a WebSocket request. This also adds an integration test to ensure it is working as expected in dev and production mode. 

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/32634
Closes: https://github.com/vercel/next.js/pull/38455
2022-08-10 17:00:30 +00:00
JJ Kasper
d64a1507a9
Ensure default _app is used when falling back to default _error (#39467)
* Ensure default _app is used when falling back to default _error

* make render check less specific due to arbitrary wait
2022-08-10 11:36:22 -05:00
Gal Schlezinger
b899d01fff
Bump edge-runtime packages (#39450)
This version fixes a bug where [crypto buffers (ArrayBuffer, Uint8Array) not compatible with text decoding](17475e4df7).
2022-08-10 09:19:48 +00:00
JJ Kasper
a6bc38799a
v12.2.5-canary.1 2022-08-09 18:03:15 -05:00
Damien Simonin Feugas
15a216b856
feat(middleware): augments / matcher with /index (#39397)
* feat(middleware): augments / matcher with /index

* fix(#39396): not invoked with i18n and trailingSlash

* add test case

* tweak matcher a bit and add tests

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-09 17:58:40 -05:00
JJ Kasper
997e3c0cf9
Ensure locale redirects are not applied in minimal mode (#39436) 2022-08-09 15:06:00 -05:00
Shu Ding
ed14af308d
Extract redirect utils into a separate file (#39433)
extract redirect utils
2022-08-09 14:34:25 -05:00
Jiachi Liu
3e19ad5c5f
typing: upgrade styled-jsx to remove workaround in build script (#39408)
Improve styled-jsx types in next.js, previously there's no `declare module` for styled-jsx and there's type name conflicts in `styled-jsx/index.d.ts` and we use a rename hack to avoid the conflicts. Now styled-jsx 5.0.3 fixed those issues.

x-ref: https://github.com/vercel/styled-jsx/pull/805
2022-08-09 17:10:33 +00:00
Balázs Orbán
5ac50a9be0
fix: ensure trailing slash on registry URL when fetching wasm fallback (#39427)
fix: ensure trailing slash on registry URL
2022-08-09 09:32:29 -05:00
Jiachi Liu
71f5f258ab
Setup require hook in next-server for styled-jsx resolving (#39305)
* Use require hook and alias to resolve styled-jsx

* re-export styled-jsx types from compiled

* fix lint

* add test for styled-jsx css

* setup require hook in server

* compile import path to styled-jsx/style

* revert require hook

* add test for server styled-jsx resolving

* update test

* pre copy styled-jsx assets

* fix styled-jsx dts

* add npmrc for styled-jsx e2e test

* load require hook directly

* rm legacy test

* fix lint

* fix pnpm install error

* split require hook

* only alias styled-jsx

* make styled-jsx resolving statically analyzable

* update test

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-08 20:27:42 -05:00
JJ Kasper
b0f590162c
v12.2.5-canary.0 2022-08-08 18:44:10 -05:00
pekarja5
289bfa6af9
Fix Link generation for SSG pages if locale domains are used (#36818)
* Fix SSG Link generation if using domain locales

* Updated condition and test

* Changed export worker domain locale check

* Update check

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-08 18:42:40 -05:00
Balázs Orbán
b292bdc293
fix(ts): Middleware type tweaks (#38625)
* fix internal type

* allow `void` to be returned from Middleware

* mark deprecated APIs in JSDoc

* fix typo

* add missing error page

* remove unused import
2022-08-08 09:40:44 -05:00
Julien Deniau
8ebd1a24cb
Update polyfill for eslint no-unwanted-polyfillio rule (#33170)
Fixes #33072

I documented all `esXXX` features to be sure that they were already polyfilled. Only `es2019` feature `Object.fromEntries` is not already polyfilled by nextjs.

I added some unwanted polyfill (that are polyfilled by nextjs).

I kept the `es5`, `es6` and `es2015` "as-is" as they contain functions that does not seem to be explicitly polyfilled (all `Math` functions or `Date.now` for example) in the [polyfill file](https://github.com/vercel/next.js/blob/master/packages/next-polyfill-nomodule/src/index.js)

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-08 05:56:31 +00:00
Everton Nunes
59b144c264
[ESLint] Adds --output-file flag (#36420)
Add support for `--output-file` on ESLint cli, based on this discussion https://github.com/vercel/next.js/discussions/26179, and this closed PR https://github.com/vercel/next.js/pull/35154. With this flag, it is possible to save the output in a file and use it for any purpose.

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


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-08 05:29:23 +00:00
Sukka
4199da09b8
Add Object#fromEntries polyfill (#36426) 2022-08-08 00:04:19 -05:00
Michael Novotny
ab48f54786
Adds eslint-plugin-eslint-plugin to ensure eslint-plugin-next rules follow ESLint rule best practices along with enforcing some consistency. (#37920)
* Adds eslint-plugin-eslint-plugin and recommended rules.

* Removes `fixable` as none of the rules contain fixers.

* Adds description and url rules.

* Adds message format.

* Removes optional dependencies.

* Lints eslint-plugin-next tests too.

* Removes optional dependencies from pnpm lock file.

* Resets pnpm lock file.

* Resets package.json too.

* Fixes pnpm lockfile.
2022-08-07 23:52:02 -05:00
양현석
160da6b806
next/image imgix loader can use multiple auto params (#34808)
fix: imgixLoader can use multiple auto params
2022-08-07 23:27:00 -05:00
LongYinan
4264408b16
Fix emotion shouldForwardProp options breaks component selectors (#39390)
fixes https://github.com/vercel/next.js/issues/38291



## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-08 03:46:11 +00:00
Sicarius
b30ae643a4
Add yarn 2 Setup Files to Valid Files for create-next-app (#30936)
* added yarn 2 based files/dirs to valid files

* remove package.json

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-07 22:05:48 -05:00
LongYinan
4da09da1a2
Fix emotion labelFormat and sourcemap options (#39389)
fixes https://github.com/vercel/next.js/issues/39386
2022-08-07 21:52:44 -05:00
Aniket Singh Rawat
8ddcc6aedb
Fix removing whitespacing in dev overlay (#28277)
## Bug

- [x] Related issues linked using `fixes #number`

fixes #14434 

Before
![image](https://user-images.githubusercontent.com/31622972/130001431-392efc66-69b3-47b5-802a-251a545983fd.png)

After
![image](https://user-images.githubusercontent.com/31622972/130001455-f553c977-c64b-43da-8e27-b513c6ea4179.png)



Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-08 02:16:42 +00:00
Lucas Rosa
a5029e9fd4
Allow custom path for preview mode cookies (#38313)
* Allow custom path for preview mode cookies

* update params order and tests

* update tests

* fix tests and update docs

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-07 20:45:30 -05:00
Josh Goldberg
963585a4fc
fix: improve logging for _devPagesManifest.json loading failures (#38046)
## Bug

- [x] Fixes #38047
- ~[ ] Integration tests added: do you want them added for such an unusual edge case?~ [Comment below: skipping](https://github.com/vercel/next.js/pull/38046#issuecomment-1207444526)
- [x] Errors have helpful link attached, see `contributing.md`: ~I'll wait until this approach & error message are confirmed before thinking more deeply on how to explain the error~

Sending a draft PR as reference ahead of time. 🙂 

Doesn't resolve the root issue of why `_devPagesManifest.json` might fail to load. But does improve the log for when it happens. I'd suggest applying this same fix to `_devMiddlewareManifest.json` too.

<table>
<thead>
<tr>
<th></th>
<th>Before</th>
<th>After</th>
</tr>
</thead>
<tbody>
<tr>
<th>Console</th>
<td>
<pre>
<code>
Failed to fetch devPagesManifest TypeError: Failed to fetch
    at PageLoader.getPageList (page-loader.js?e87a:30:53)
    at _callee$ (router.js?8684:955:45)
    at ...
</code>
</pre>
<pre>
<code>
router.js?8684:1319 Uncaught (in promise) TypeError: Cannot \
read properties of undefined (reading 'includes')
    at resolveDynamicRoute (router.js?8684:1319:16)
    at _callee$
    at ...
</code>
</pre>
</td>
<td>
<pre>
<code>
Failed to fetch devPagesManifest: TypeError: Failed to fetch
    at PageLoader.getPageList (page-loader.js?e87a:30:53)
    at _callee$ (router.js?8684:955:45)
    at ...
</code>
</pre>
</td>
</tr>
<tr>
<th>Visual</th>
<td><img alt="Screenshot of a Next.js runtime error: TypeError: Cannot read properties of undefined (reading 'includes')" src="https://user-images.githubusercontent.com/3335181/175854728-8d5c2051-1229-4da7-8af1-fc95236befae.png" /></td>
<td><img alt="Screenshot of a Next.js runtime error: Error: Failed to fetch _devPagesManifest.json. Is something blocking that network request?" src="https://user-images.githubusercontent.com/3335181/175854774-07895846-1a1c-4bb8-bf57-fa696b8c6ba4.png" /></td>
</tr>
</tbody>
</table>
2022-08-07 19:36:03 +00:00