Commit graph

4453 commits

Author SHA1 Message Date
Tim Neutkens
2e2c558a62 v11.1.3-canary.53 2021-10-09 12:05:41 +02:00
Tobias Koppers
3e22b22afc
Hmr DX improvements (#29753) 2021-10-09 11:51:37 +02:00
Tobias Koppers
597fc3312f
serverOnlyChanges should be determined when both compilers are done (#29757) 2021-10-09 11:50:51 +02:00
Tobias Koppers
4d50ff30ba
update webpack (#29738) 2021-10-08 15:56:23 +02:00
Tim Neutkens
fcdba560eb v11.1.3-canary.52 2021-10-08 10:33:48 +02:00
Tobias Koppers
20aecdebc0
update webpack (#29708)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-08 10:29:56 +02:00
Maia Teegarden
e5776847a6
v11.1.3-canary.51 2021-10-07 17:05:44 -07:00
Maia Teegarden
3e3f09f4e1
Use correct arg for require.resolveWeak (#29719)
* Use correct arg for require.resolveWeak

* Build next-swc binaries
2021-10-07 17:02:13 -07:00
Tim Neutkens
fb529e65a0 v11.1.3-canary.50 2021-10-07 18:20:42 +02:00
Donny/강동윤
0a803bafcd
fix(styled-jsx): Use correct SyntaxContext for identifiers (#29705)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
Co-authored-by: Maia Teegarden <dev@padmaia.rocks>
2021-10-07 18:17:29 +02:00
Gustavo Edinger
9b22406e36
fix: Prevent image redirection when trailingSlash is set (#29640)
* fix: Prevent image redirection when trailingSlash is set

* test: Trailing slash test for next/image

* lint-fix

Co-authored-by: Gustavo Edinger <gbe@nect.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com>
2021-10-07 11:10:26 -05:00
Tim Neutkens
6455bae3bb v11.1.3-canary.49 2021-10-07 14:58:57 +02:00
Donny/강동윤
ac187a5b43
chore: Update swc (#29689)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-07 12:11:53 +02:00
Tim Neutkens
351d225fc5
Remove isWebpack5 checks (#29677)
* Remove isWebpack5 checks

* Remove next-babel-loader (replaced by babel-turbo-loader), hotSelfAccept, and BuildStatsPlugin

* Remove cacache file

* Remove unused variable

* remove old test

* lint-fix

* update babel-loader tests

* lint-fix

* update compiled

Co-authored-by: jj@jjsweb.site <jj@jjsweb.site>
2021-10-06 18:46:46 -05:00
Steven
40c32fa275 v11.1.3-canary.48 2021-10-06 14:29:23 -04:00
Maia Teegarden
a3656567f8
v11.1.3-canary.47 2021-10-06 10:17:44 -07:00
Maia Teegarden
d1308b8ab0
Chore/update swc (#29675)
* Update swc deps

* Build next-swc binaries
2021-10-06 10:16:27 -07:00
JJ Kasper
a20b0d59f5
Ensure conditional resolve alias does not affect server (#29673)
This ensures we don't add the no-op resolve alias when rewrites aren't used for the server resolving since it is still needed while tracing server files. 

## Bug

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

Fixes: https://github.com/vercel/next.js/pull/25538#issuecomment-936101951
2021-10-06 17:16:01 +00:00
Tim Neutkens
aa8a885599
Remove webpack 4 support (#29660)
Co-authored-by: jj@jjsweb.site <jj@jjsweb.site>
2021-10-06 17:40:01 +02:00
Steven
8ae36804a8 v11.1.3-canary.46 2021-10-06 10:59:18 -04:00
Steven
5e29723b05
Bump squoosh to the latest version (#29506)
Bump `squoosh` to the latest version, currently commit [cad09160](cad09160b6).

Ideally, we would use the version published to npm but it hasn't been published in [two months](https://www.npmjs.com/package/@squoosh/lib?activeTab=versions) and we have a patch (#23565) that isn't available upstream.

This also is a precursor to getting support for AVIF.

- Fixes #27092
- Fixes #26527 
- Reapplies the patch from #23565
2021-10-06 14:47:48 +00:00
Tobias Koppers
761eadbd42
update webpack (#29644)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-06 12:02:36 +02:00
Jonathan Wu
affbc15898
Fix conflicting paths grammar (#29658) 2021-10-05 22:22:46 -05:00
jj@jjsweb.site
4877d3c7d6
v11.1.3-canary.45 2021-10-05 14:37:17 -05:00
Keen Yee Liau
53628fba69
Create TelemetryPlugin for collecting feature usage metrics (#29145)
This commit creates a new Webpack `TelemetryPlugin` to gather information
about usage of certain features, for example `next/image` and `next/script`.
2021-10-05 14:31:48 -05:00
JJ Kasper
ebc1b0e559
Fix missing trace items and migrate required files test (#29649) 2021-10-05 13:52:19 -05:00
Maia Teegarden
dffcfe8223
v11.1.3-canary.44 2021-10-05 11:38:38 -07:00
Donny/강동윤
ce73df8d59
Update swc crates (#29643)
* Update deps

* Update

* Build next-swc binaries

Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
Co-authored-by: Maia Teegarden <dev@padmaia.rocks>
2021-10-05 10:21:11 -07:00
JJ Kasper
39b30e5ef5
Update to latest version of node-file-trace (#29617) 2021-10-05 09:11:00 -05:00
Tim Neutkens
90904e4b7e v11.1.3-canary.43 2021-10-05 12:53:51 +02:00
Tim Neutkens
f74ee78c3d
Add trace file for "next dev" (#29633)
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2021-10-05 12:52:45 +02:00
jj@jjsweb.site
7af61f69f3
v11.1.3-canary.42 2021-10-04 19:30:19 -05:00
Tobias Koppers
15822516e7
fixes #29553 (#29611)
fixes #29553

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2021-10-04 23:57:27 +00:00
Maia Teegarden
92c2dd4971
Upgrade swc deps (#29620)
* Upgrade swc deps

* Build next-swc binaries
2021-10-04 14:28:04 -07:00
Donny/강동윤
b701d018f2
Update swc_css_parser (#29572) 2021-10-03 17:29:22 +02:00
Maia Teegarden
260e0e44f6
Include param vars in nearest scope bindings (#29536)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-03 17:26:27 +02:00
Tobias Koppers
5e03ad76e6
upgrade webpack (#29549)
## 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
2021-10-01 21:45:30 +00:00
Ivan Tyrnov
a8d8480164
Update version @babel/runtime (#29458)
* Update version @babel/runtime

* update fix version @babel/runtime

* update yarn.lock
2021-10-01 15:54:07 -05:00
jj@jjsweb.site
d0b7d1579e
v11.1.3-canary.41 2021-10-01 10:25:21 -05:00
JJ Kasper
d8ed5be4f7
Fix ie11 from untranspiled vitals (#29532)
* Fix ie11 tests from untranspiled vitals

* move vitals into client folder

* undo test change
2021-10-01 10:19:36 -05:00
Gerald Monaco
d8bb022e9c
Add page mapping for Server Components (#29508)
* Add page mapping for Server Components

* Transform client components too

* Refactor and add to on-demand-entry-handler too

* Simplify implementation via pageExtensions

* Fix up errors
2021-10-01 09:40:07 -05:00
JJ Kasper
458e34d680
Ensure all package.json files are traced correctly (#29539)
This fixes cases where not all `package.json`s were being added to the traces correctly while using webpack's resolving with the `outputFileTracing`. The specific case notice while testing has been added as an integration test to ensure it is working as expected.
2021-10-01 10:45:10 +00:00
Maia Teegarden
bab7d912cb
v11.1.3-canary.40 2021-09-30 18:38:04 -07:00
Maia Teegarden
d3b8d708af
Upgrade swc deps (#29531)
* Upgrade swc deps

* Build next-swc binaries

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-30 14:21:19 -07:00
jj@jjsweb.site
4eda88145e
v11.1.3-canary.39 2021-09-30 16:11:10 -05:00
Jackson Hardaker
ffd88aa739
Fix custom app file regex (#29525)
* Add lodash.escaperegexp

* Add compiled lodash.escaperegexp

* Refactor to escape special characters

* Test for build paths containing a special character

* Replace lodash.escaperegexp with previously compiled dep

* Revert yarn.lock change

* Remove backslash replace

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

* lint-fix

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-09-30 16:10:20 -05:00
Maia Teegarden
950ef1a5b5
Fix root global jsx style (#29505)
* Fix root global jsx style

* Build next-swc binaries

* Prettier fix

* Build next-swc binaries
2021-09-30 13:11:03 -07:00
JJ Kasper
8ee6127812
Update resolve options for nft (#29524)
Follow-up to https://github.com/vercel/next.js/pull/29473 after additional testing it seems we need to ensure the `main` field is used when tracing packages during builds so that `module` isn't being used unexpectedly.
2021-09-30 17:03:42 +00:00
Tobias Koppers
59b6967e00
make client and server independent for on-demand-entries (#29518)
allow to dispose server while client is making changes
allow to dispose other entries while making changes
avoid recompiling when disposing entries



## 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
2021-09-30 13:52:26 +00:00
Maia Teegarden
5778f9ffb3
Remove error that is too strict in next/dynamic swc transform (#29511) 2021-09-30 08:18:45 +02:00
jj@jjsweb.site
cee573f582
v11.1.3-canary.38 2021-09-29 14:47:42 -05:00
JJ Kasper
38ac55dd20
Update output tracing resolving (#29473) 2021-09-29 12:38:21 -05:00
Tim Neutkens
47a905b855
Invalidate webpack cache when swc options are enabled/disabled (#29497)
Ensures webpack caching is invalidated when switching between SWC on/off.

## 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
2021-09-29 15:55:15 +00:00
Shu Ding
df6df1959e
Parallelize requirePage when loading components (#29494)
We can potentially speed it up a little bit by using `Promise.all` here. This was raised by @devknoll in https://github.com/vercel/next.js/pull/29470#pullrequestreview-766039044.
2021-09-29 14:42:35 +00:00
Tim Neutkens
27b4681922 v11.1.3-canary.37 2021-09-29 12:46:35 +02:00
Tobias Koppers
6f89d8f862
update webpack (#29469) 2021-09-29 12:29:45 +02:00
Tim Neutkens
88e15a5bfc v11.1.3-canary.36 2021-09-29 11:19:01 +02:00
Donny/강동윤
90a33e7994
Update css parser (#29484)
Co-authored-by: timneutkens <timneutkens@users.noreply.github.com>
2021-09-29 11:09:33 +02:00
Gerald Monaco
0f1a4fa649
Rename onReadyToStream -> onCompleteShell (#29442) 2021-09-28 15:04:15 -05:00
jj@jjsweb.site
0e0b51ea7b
v11.1.3-canary.35 2021-09-28 12:40:43 -05:00
JJ Kasper
a71addf2e4
Ensure initial imports are included in traces correctly (#29437) 2021-09-28 12:04:16 -05:00
JJ Kasper
f49ff1fbcb
Fix SWC unit test (#29466) 2021-09-28 11:03:54 -05:00
Tim Neutkens
0df68366ca v11.1.3-canary.34 2021-09-28 16:48:35 +02:00
Tim Neutkens
5061fcd62c
Build next-swc binaries (#29465)
Co-authored-by: timneutkens <timneutkens@users.noreply.github.com>
2021-09-28 16:40:44 +02:00
Donny/강동윤
b4d6e535a8
Update swc (#29460) 2021-09-28 15:31:14 +02:00
JJ Kasper
7bbaff74c4
Ensure blurDataURL is correct in dev with basePath (#29436)
Follow-up to https://github.com/vercel/next.js/pull/29307 this ensures the `blurDataURL` is correctly prefixed with the `basePath` in development since we use the `_next/image` endpoint to generate the placeholder in dev mode. 

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/29289#issuecomment-927758204
2021-09-27 21:13:23 +00:00
Tim Neutkens
ace8963df2
Remove inline-source-map for Windows (#28893)
## 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
2021-09-27 12:04:40 +00:00
Tim Neutkens
0baced3e54 v11.1.3-canary.33 2021-09-27 13:27:47 +02:00
Tim Neutkens
3375e66324
Additional bench tracing improvements (#29325) 2021-09-27 12:57:37 +02:00
Steven
2271cd841d
Fix onLoadingComplete() callback when image src is Data URL (#29367)
Fixes #29363 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
2021-09-26 15:03:07 +00:00
Tobias Koppers
0976ce2ff0
upgrade webpack and enable experiments.cacheUnaffected (#29369) 2021-09-24 20:45:33 +00:00
Tobias Koppers
5c8bf8fc30
enable unsafeCache for better incremental build performance (#29175) 2021-09-24 22:04:22 +02:00
Jiachi Liu
741ef9032c
Experimental: hook version of reportWebVitals (#28769)
### Experimental

Introduce `next/vitals` and `useExperimentalWebVitalsReport` API which is not limited by `_app`.

`pages/index.js`
```jsx
import { useExperimentalWebVitalsReport } from 'next/vitals'

export default function Index() {
   useExperimentalWebVitalsReport((metric) => {
    // handle metric...
  })
  return 'sup'
}
```
2021-09-24 18:35:33 +00:00
C. Lewis
e2e747ef2d
fix(create-next-app): starter styling errors (#28096)
Fixes #27770.

Projects initialized with `create-next-app` should not only be totally functional in terms of styling, but ideally there would be as minimal CSS as possible to serve as a "jumping off point" for users (related: #24709, where I initially proposed this fix).

However, minor issues with the specific styling approaches in the template created by `create-next-app` break the page for small viewports. This is caused by an improper use of `display: flex` in conjunction with `min-height: 100vh` on the `.container` class, and I imagine it places a drag on the initial user experience due to the fact that every user who creates a project with `create-next-app` must *independently fix* this viewport sizing issue themselves.

For example, the top of the viewport on a small display (here, iPhone SE):

![image](https://user-images.githubusercontent.com/1657236/129430078-229d5fab-b719-458c-8a94-10fb8be3490d.png)

Notice the "Welcome to Next.js" message is missing: Its container is larger than the viewport, and is set to be a flex column with `justify-center`—so we are staring at the center of the container. To demonstrate better, here is the full page render for before and after this PR:

![image](https://user-images.githubusercontent.com/1657236/129430409-52134198-651a-4cf8-915d-68b699febd77.png)

This PR adjusts the styling to fix this issue, and also other styling issues on small screens, like grid width issues causing text to overflow (and the footer padding as seen above):

![image](https://user-images.githubusercontent.com/1657236/129430114-1dda7674-3b02-45d4-a4b3-37fc5053c6c4.png)

After these changes, and minor padding tweaks, this is the top of the viewport on an iPhone X (full render above):

![image](https://user-images.githubusercontent.com/1657236/129430224-1991c1a6-8c7e-4246-b4a5-44919fb850c6.png)

And on an iPhone SE:

![image](https://user-images.githubusercontent.com/1657236/129430259-4408c52f-6fc6-4f22-9cc6-bbdbbe8d7a1a.png)
2021-09-24 17:13:05 +00:00
jj@jjsweb.site
81925f9e15
v11.1.3-canary.32 2021-09-24 10:09:58 -05:00
JJ Kasper
a9865811ba
Use webpack resolve with nft (#29342)
This is a follow-up to https://github.com/vercel/next.js/pull/29341 to add using the webpack resolver while tracing for better performance.
2021-09-24 13:39:48 +00:00
JJ Kasper
5dbb8704cc
Ensure static image works correctly with basePath (#29307)
This ensures we prefix the `src` for static images with the `basePath` correctly, this also copies over the static image tests to the basePath image-component suite. 

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/29289
2021-09-23 23:26:51 +00:00
Casper
9343b67c11
feat: allow setting custom tsconfig file (#28104)
Ability to provide a custom tsconfig file. 

**Example Usage:**

```js
// next.config.js
module.exports = {
	typescript: {
		tsconfigPath: "myconfig.json"
	}
}
```


## 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.
- [x] Related issues linked using [`fixes #23972 (discussion)`](https://github.com/vercel/next.js/discussions/23972)
- [x] Integration tests added
- [x] 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-09-23 22:52:05 +00:00
JJ Kasper
c3a395ab7f
Update to latest @vercel/nft and use async fs methods (#29341)
This updates to the latest version of `node-file-trace` and leverages the new async fs handling with webpack. In a follow-up PR we will implement the async resolver to share resolving with webpack as well. 

x-ref: https://github.com/vercel/nft/pull/236
2021-09-23 21:22:14 +00:00
jj@jjsweb.site
f2c266ba4d
v11.1.3-canary.31 2021-09-22 22:57:15 -05:00
Tim Neutkens
0d4e4e9092
Fix add-entry span duration (#29288)
Currently the span is finished on seal but that's not the actual timing where the entry span is finished as there's a `succeedEntry` hook. This PR changes the span to finish on `succeedEntry`.

## 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
2021-09-22 22:30:51 +00:00
JJ Kasper
ead56eaab6
Fix invalid project dir casing breaking Next.js on Windows (#29205)
This fixes Next.js running into unexpected errors on Windows when invalid casing for a project directory is used. I was able to reproduce the issue on my local Windows machine and this resolved the issue there. 

<details>

<summary>screenshot of error while reproducing</summary>

<img width="838" alt="Screen Shot 2021-09-18 at 23 21 40" src="https://user-images.githubusercontent.com/22380829/133915825-ac4abdd2-fcf8-4309-9873-e6d88dfe485d.png">

</details>

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/27396
Fixes: https://github.com/vercel/next.js/issues/16535
Fixes: https://github.com/vercel/next.js/issues/17592
2021-09-22 21:29:27 +00:00
Tim Neutkens
6f5bea1b72 Update webpack5 import when using local webpack version 2021-09-22 07:38:51 +02:00
Tim Neutkens
3be2480a56 v11.1.3-canary.30 2021-09-22 07:22:02 +02:00
Tim Neutkens
60f198584d
Add internal mode for debugging Next.js core webpack (#29254)
Co-authored-by: jj@jjsweb.site <jj@jjsweb.site>
2021-09-22 07:20:18 +02:00
Steven
9c86953745
Rename experimental tracing to outputFileTracing (#29267)
Renaming this prop for clarity before we move this out of experimental
2021-09-21 22:18:12 +00:00
jj@jjsweb.site
53a59336e9
v11.1.3-canary.29 2021-09-21 16:12:44 -05:00
jj@jjsweb.site
7b74f7771c
v11.1.3-canary.28 2021-09-21 14:19:19 -05:00
Tim Neutkens
dc43e297b7 v11.1.3-canary.27 2021-09-21 19:37:49 +02:00
Tobias Koppers
4f212ee91d
the way towards webpack 5 typings (#29105)
Co-authored-by: sokra <sokra@users.noreply.github.com>
2021-09-21 19:17:16 +02:00
Tim Neutkens
90a3b50ce1
Remove collect-dependencies span as it balloons trace size (#29266)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-21 19:10:13 +02:00
JJ Kasper
800b2beef6
Remove docker usage for running development tests (#29264) 2021-09-21 19:04:23 +02:00
JJ Kasper
b4d8aa8c48
Fix default static /500 with i18n (#29250) 2021-09-21 16:23:23 +02:00
JJ Kasper
d5b1d595c5
Fix basePath: false not being honored for client-side redirect (#29235)
* Fix basePath: false not being honored for client-side redirect

* update test

* fix remove flakey exit
2021-09-21 09:23:13 -05:00
Tobias Koppers
84c299bd57
upgrade webpack to 5.53.0 (#29168) 2021-09-21 16:22:57 +02:00
JJ Kasper
50c75282cd
Fix resolving href with query and matching as (#29246) 2021-09-21 16:21:27 +02:00
JJ Kasper
8e52126ea6
Migrate prerender tests to new set-up (#29245) 2021-09-21 16:21:05 +02:00
JJ Kasper
371ca582d1
Ensure trailingSlash is correct for index with query (#29217) 2021-09-21 16:18:42 +02:00
Maia Teegarden
4a5fc41b24
Fix dynamic style issue (#29163)
* Fix dynamic style issue

* Update affected tests

* Build next-swc binaries

* Remove clone

* Build next-swc binaries
2021-09-21 16:14:38 +02:00
Tim Neutkens
adf7fa67d3 v11.1.3-canary.26 2021-09-21 09:50:33 +02:00
Tim Neutkens
2b57edc63a
Add spans for hot-reloader start (#29251) 2021-09-21 09:49:53 +02:00
Tobias Koppers
e90825ad88
fix compilation relationship (#29174)
* fix compilation relationship

* fix compilation relationship

* Ensure loader span is provided correctly

* Fix webpack 4 childcompiler run

* Use compilation hook instead of make hook

Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2021-09-20 22:19:00 +02:00
jj@jjsweb.site
0568d24205
v11.1.3-canary.25 2021-09-20 09:30:41 -05:00
Luan Devecchi
23ce41e2bc
Preserve next-env.d.ts line ending (#28100)
* Preserve `next-env.d.ts` line ending

Prevent next from changing already existing line ending on
`next-env.d.ts` for no good reason

* Update comparison

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

* Update checks and add tests

* update test

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: jj@jjsweb.site <jj@jjsweb.site>
2021-09-19 22:55:46 -05:00
Emilio Cobos Álvarez
05a732eb7a
Remove useless getComputedStyle call. (#27969)
See https://github.com/w3c/csswg-drafts/issues/6501 to see how I found this.

This line doesn't recompute layout in browsers, because `"height"` is given as a pseudo-element name rather than a property.

The right way to do what it wants is `getComputedStyle(document.body).height`, but given nobody noticed this (and this is generally never needed, manually triggering layout should never be needed to avoid FOUC) it seems better to keep current behavior and just remove the call.
2021-09-20 03:03:36 +00:00
JJ Kasper
5b963422c0
Fix array query value has matching (#29216) 2021-09-19 20:32:30 -05:00
Flo
76dee14db4
Fix #11107 - don't prefetch preloaded modules (#22818)
This PR proposes a fix for https://github.com/vercel/next.js/issues/11107 (JS modules are loaded twice). A more detailed explanation of the investigation that led to this PR can be found in the issue's comments (https://github.com/vercel/next.js/issues/11107#issuecomment-791780168).

## Replicability

To identify that the issue replicates on any given project, you need to 
1. look at the network tab (first/clean load of site, so preferably ⌘+⇧+R on an incognito tab), 
2. sort by "name", and filter requests by `mime-type:application/javascript` (selecting "JS" in the devtools filters will actually show all "script" types, but ignore all "javascript" types)
3. look for pairs of identical calls with one originating from initial HTML (`preload` of priority "high" originating from "(index)" or "([page name])")  and another one from a script (`prefetch` of priority "lowest" originating from a .js file), where neither of the files is served from the cache.

Here's a screenshot of an example of what to look for:
<img width="601" alt="Screen Shot 2021-03-07 at 09 59 18" src="https://user-images.githubusercontent.com/1325721/110234627-cf1c6d00-7f2b-11eb-9cd7-749bf881ba56.png">


The issue was reproduced easily on the following projects:
- On [nextjs.org](https://nextjs.org/) where duplicates add up to ~70kB of transferred javascript out of 470kB (14.9%).
- On [vercel.com](https://vercel.com/) where duplicates add up to ~105kB of transferred javascript out of 557kB (18.8%).
- On [tiktok.com](https://tiktok.com/en) where duplicates add up to ~514kB of transferred javascript out of 1556kB (33%).
- In my own project using `"next": "^10.0.1"` (private repo) where duplicates add up to about 5% of total transferred javascript.
- In the issue's comments, a developer reported a replication using `"^10.0.7"` on a [public repo](https://github.com/SidOfc/sidneyliebrand.io).


## Some information about the fix

- Both `preload` and `prefetch` values for `<link rel="x">` behave similarly, with the difference being in network priority level (preload is high priority, prefetch is lowest priority).

- Next.js uses `<link rel="preload">` in its initial HTML but then *only* uses `<link rel="prefetch">` for the rest of the lifetime of the page. 

- However, when Next.js detects that a script should be requested in advance, it only checks for matching `<link rel="prefetch">` and not `<link rel="preload">` (which have higher priority and are present earlier in the DOM, thus have a greater likelihood of being already loaded). 

This PR aims to fix that oversight.

## Potential issues (none AFAIK)

As far as I can tell by looking through the codebase, **there is no downside** not to add a `prefetch` when a `preload` is already in the DOM. No other script looks for a `<link>` based on its `rel` attribute.
2021-09-19 17:51:04 +00:00
Andrew Hurle
88f27ef947
Fix bug where returning { notFound: true } from GSP broke next export (#24481)
* Fix bug where returning `{ notFound: true }` from GSP broke `next export`

We could just as easily omit the notFoundRoutes check, but I didn't want
to mask other potential bugs that would result in missing files

* update check

* move check

Co-authored-by: jj@jjsweb.site <jj@jjsweb.site>
2021-09-18 10:20:45 -05:00
jj@jjsweb.site
f579767e60
v11.1.3-canary.24 2021-09-17 15:00:16 -05:00
Tobias Koppers
797dabe351
add support for new URL() (#28940)
Currently `new URL()` for server assets is completely broken because of the `publicPath` that is used for them too. `new URL()` for SSR is broken on windows as it's using absolute urls on the windows filesystem. And `new URL()` is using an incorrect filename

* Place all `asset`s correctly in `/_next/static/media` with `[name].[hash:8][ext]`
* Added a separate runtime chunk for api entries, without `publicPath`
* Introduce separate layer for api entries, which uses server-side URLs.
* Otherwise new URL() will return a faked relative URL, that is identical in SSR and CSR
* Disables react-refresh for api entries

Fixes #27413



## 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`
- [x] 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
2021-09-17 19:20:09 +00:00
Tobias Koppers
e3c6739ee0
make code consistent with babel externals (#28867)
* make code consistent with babel externals

* update compiled

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-09-17 12:27:03 -05:00
Tobias Koppers
fa9ee197a4
suggest incremental typescript for typescript >= 4.4.2 (#29169)
This is now safe to enable since it no longer causes performance regressions
2021-09-17 15:42:27 +00:00
Tim Neutkens
367f8d6e6d v11.1.3-canary.23 2021-09-17 09:35:40 +02:00
Tim Neutkens
002ed25087
Add name to invalidated span (#29170) 2021-09-17 09:34:37 +02:00
Tim Neutkens
84ce15bba5 v11.1.3-canary.22 2021-09-16 19:48:00 +02:00
Tim Neutkens
3e8f470e49
Ensure traces are flushed in development when there is an error (#29149) 2021-09-16 19:43:28 +02:00
Maia Teegarden
16a737d9b5
Update expected test output (#29146) 2021-09-16 11:52:16 -05:00
Tobias Koppers
d78bb6fe46
upgrade to typescript 4.4.3 (#29112)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-16 18:06:57 +02:00
JJ Kasper
cefd9cf283
Add crawler blocking for fallback: true (#29121)
* Add crawler blocking for fallback: true

* update test

* Update check

* Add note to docs

* use browser agent for non-crawler test
2021-09-16 11:01:28 -05:00
Tim Neutkens
e98690c307 v11.1.3-canary.21 2021-09-16 17:13:46 +02:00
Tim Neutkens
2ac5e1c1f0
Build next-swc binaries (#29144)
Co-authored-by: timneutkens <timneutkens@users.noreply.github.com>
2021-09-16 17:12:08 +02:00
강동윤
81c5511b74
next-ssg: Don't inject __N_SSP for files without server props. (#29141) 2021-09-16 16:26:38 +02:00
Tim Neutkens
10daef9607
Ensure Next.js dist files are commonjs compatible with swcLoader enabled (#29138)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-16 16:11:30 +02:00
Tim Neutkens
60560a941d v11.1.3-canary.20 2021-09-16 15:48:46 +02:00
Tim Neutkens
c39b7d19bd
Update next-swc binaries (#29140)
Co-authored-by: timneutkens <timneutkens@users.noreply.github.com>
2021-09-16 15:47:46 +02:00
강동윤
2c82615bde
Fix transform of ` in styled-jsx (#29136) 2021-09-16 15:08:42 +02:00
Tim Neutkens
c491adfe12 v11.1.3-canary.19 2021-09-16 08:59:20 +02:00
Tim Neutkens
172a536c61
Update next-swc binaries (#29132)
Co-authored-by: timneutkens <timneutkens@users.noreply.github.com>
2021-09-16 08:58:36 +02:00
Maia Teegarden
c6cec752c7
Fix partial one off global selectors (#29128) 2021-09-16 08:16:10 +02:00
JJ Kasper
e313398468
Update trace ignores for next import (#29119) 2021-09-15 15:00:52 -05:00
Tim Neutkens
1f788b5430
Development tracing improvements (#29076) 2021-09-15 20:06:24 +02:00
JJ Kasper
85b8399856
Remove log from failing to parse source map (#29118)
This removes the log when we fail to parse the source maps in the `wellknown-errors-plugin` since this log isn't really actionable by users and clutters the error output. 

x-ref: https://github.com/vercel/next.js/issues/27783#issuecomment-915654054
2021-09-15 17:53:22 +00:00
Janicklas Ralph
73408211aa
Remove inert font tag in font optimization (#28869)
* Remove inert font tag in font optimization

* Fix lint

* Remove inert font tag during font optimization

* Fix lint

* Fix lint

* Fix lint

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-09-15 11:43:13 -05:00
Tim Neutkens
4b41b48a8e v11.1.3-canary.18 2021-09-15 17:34:32 +02:00
Tim Neutkens
ae305f6aa9
Update styled-jsx (#29103)
Includes a fix for when a tree is rendered without the styled-jsx registry being provided. It'll noop in this new version.

## 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
2021-09-15 14:19:20 +00:00
Tim Neutkens
ca27e34167 v11.1.3-canary.17 2021-09-15 09:32:44 +02:00
Maia Teegarden
4a2d5a1b49
Add/styled jsx swc (#29005)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-09-15 09:24:31 +02:00
jj@jjsweb.site
2cfdc68650
v11.1.3-canary.16 2021-09-14 16:05:21 -05:00
JJ Kasper
49c99cc323
Fix host segment replacing for custom routes (#29090)
This fixes segments inside of the host of the destination failing to parse with url.parse due to the unexpected colon by escaping the colon for segments and then unescaping them after we have parsed the URL.

## Bug

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

x-ref: https://github.com/vercel/vercel/pull/6713
2021-09-14 20:13:46 +00:00
Tim Neutkens
7d664d5b36
Add stats config for SWC (#28883)
* Add stats config for SWC

* Remove stats for deprecated mode

* Include native binaries in local linking

* Expose minify in next-swc

* Build next-swc binaries

* Only upload changed binary artifact

* Build next-swc binaries

* Expose minify in js binding

* Use new minify function in terser plugin

* Build next-swc binaries

* Build next-swc binaries

* Build next-swc binaries

* Pass pagesDir option to SWC for next/dynamic

* Build next-swc binaries

* Add spans for next-trace-entrypoints-plugin

* Fix linting

Co-authored-by: Maia Teegarden <dev@padmaia.rocks>
Co-authored-by: padmaia <padmaia@users.noreply.github.com>
Co-authored-by: timneutkens <timneutkens@users.noreply.github.com>
2021-09-14 18:13:11 +02:00
Tobias Koppers
0e29a2d08f
reload the page to show 404 when receiving invalid event from on-demand-entries (#29074) 2021-09-14 17:11:00 +02:00
Jeff Wen
07fe406bd5
Add crossOrigin type to the NextConfig (#29033) 2021-09-14 09:51:10 -05:00
Maia Teegarden
a784d54ab5
Fix/upload binary artifact (#29069)
* Fix upload of binary artifacts

* Build next-swc binaries

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-13 16:40:06 -07:00
Kara
41484f62cc
Throw error if res is accessed after gSSP returns (#29010)
* Throw error if res is accessed after gSSP returns

Currently it's possible to access the `ServerResponse` through `context.res`
in `getServerSideProps()`. If one was to store that response and mutate
its headers or status code after gSSP returns (e.g. during rendering), it
would currently happen to work because of when headers are sent. However,
this is an anti-pattern that relies an implementation detail of the framework
and shouldn't be allowed. This will be particularly important once Next.js
starts to support basic streaming (two-part flush: routing then data) because
then the headers will be sent as soon as gSSP returns, which explicitly breaks
this pattern.

With this commit, the framework now throws an error in development mode if
the ServerResponse is accessed after gSSP returns.

* fixup! Throw error if res is accessed after gSSP returns
2021-09-13 17:10:46 -05:00
JJ Kasper
e49829bb8e
Fix webpack version and safari test and update compiled (#29059)
* Fix webpack version and safari test and update compiled

* Update compiled again
2021-09-13 10:56:07 -05:00
Tim Neutkens
c1e5f5b260
Make traces in development reliable (#28990)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2021-09-13 15:49:29 +02:00
JJ Kasper
a92a5caec2
Update test set-up to leverage playwright when able to (#28634)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-13 14:36:25 +02:00
강동윤
fd2af1422d
next/dynamic: Accept pagesDir (#29055)
* Add pages_dir

* Add `pages_dir` to `next/dynamic` pass

* Dep

* Fix next/dynamic psss

* Fix

* Update test refs

* Add a test
2021-09-13 13:37:07 +02:00
강동윤
c38e702347
Make next-ssg optional (#28862)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-09-13 12:20:38 +02:00
Tim Neutkens
9572b30849
Deprecate webpack 4 support (#28840) 2021-09-13 09:18:04 +02:00
Maia Teegarden
0d0f34ba18
Pass code as buffer to swc minify (#29009)
This should fix this: https://github.com/vercel/next.js/pull/28883/checks?check_run_id=3560578176#step:4:353



## 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
2021-09-11 00:57:01 +00:00
Gerald Monaco
1f99c3009f
Use Writable instead of Observable (#29007)
Use `Writable` instead of `Observable` and remove the `zen-observable` dependencies. I initially opted to use `Observable` for simplicity and fast iteration, but we should really just use `Writable` directly (or some other stream in the future).

React's streaming SSR has some [specific requirements](https://github.com/reactwg/react-18/discussions/66#discussioncomment-944266) on the stream API. Rather than trying to also squeeze a `Readable` in here, which might be more standard for node apps, I've just followed React's lead. By limiting ourselves to just `Writable`, it ought to be easier to adopt a different stream type in the future if desired.

The React `pipeToNodeWritable` API requires us to pass a stream immediately, but we don't actually have a `ServerResponse` to give it until `RenderResult.pipe(...)` is called later. For that reason, we pass React a `Writable` that we will simply forward to `res` later. This mechanism of deferring is `NodeWritablePiper`, which is just a function that can be called with `ServerResponse` (or another `Writable`, as we now do to render to string for static results) to have content written to it. `NodeWritablePiper` takes a `next` argument so that we can chain both synchronous and asynchronous pipers together.

Also does some clean up and adds another streaming test for backpressure.
2021-09-11 00:17:56 +00:00
Kara
c27e3a41dc
Update gSSP type to support props as a promise (#28999)
In a previous PR, `getServerSideProps` was altered to support returning
`props` as a promise. This change updates the TS types to permit promises
as well, so you can write type `GetServerSideProps<Props>` instead of
`GetServerSideProps<Promise<Props>>`. e.g.:

```typescript
type Props = {
  data: string
}

export const getServerSideProps: GetServerSideProps<Props> = async (
  context
) => {
  return {
    props: (async function () {
      return { data: 'some data' }
    })(),
  }
}
```

## Feature

- [x] 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`
- [x] 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`
2021-09-10 19:36:40 +00:00
Tim Neutkens
5fed96dd88 v11.1.3-canary.15 2021-09-10 11:20:55 +02:00
JJ Kasper
a00de0c2f0
Ensure cache-control is correct for notFound: true with revalidate (#28973)
This ensures we have the correct `cache-control` header when `revalidate` is used with `notFound: true` on `getStaticProps` or `getServerSideProps` pages. 

## Bug

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

Fixes: https://app.clubhouse.io/vercel/story/23445
2021-09-10 08:15:13 +00:00
Maia Teegarden
63e71b585d
Update swc in next-swc (#28970)
* Update swc in next-swc

* Fix typo

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

* Build next-swc binaries

Co-authored-by: Steven <steven@ceriously.com>
2021-09-09 20:02:57 +02:00
강동윤
a84389591d
Update swc (#28946)
## 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



I updated rust dependencies and node dependencies.
2021-09-09 09:30:22 +00:00
Adrien HARNAY
2abc4f2d6a
Support node-sass@6 (#28710)
* support node-sass@6

* bump sass-loader

* Update precompiled

Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-09 11:00:19 +02:00
JJ Kasper
f4c6cd68d8
Fix ensurePage race condition (#28939)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-09 10:14:30 +02:00
Jiachi Liu
57d9076e58
Adopt context based experimental styled-jsx version (#28646)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-09 10:13:50 +02:00
CatNose
13893395dc
fix: should allow optional properties for images option (#28709)
## Bug
- Fixes #28708

- [x] Related issues linked using `fixes #number`
2021-09-08 22:03:52 +00:00
Gerald Monaco
dd55f98291
Simplify RenderResult (#28900)
We're no longer currently planning on supporting caching for dynamic responses, so we can do some cleaning & simplification:
* Multiplexing can be removed since we only ever subscribe once (via `RenderResult.pipe`, described below)
* `RenderResult.toUnchunkedString` can become synchronous since static responses are never chunked
* `RenderResult.forEach` can become `RenderResult.pipe` which helps encapsulate some of the details of `RenderResult`
2021-09-08 16:56:31 +00:00
Tim Neutkens
dab4ac2d12 v11.1.3-canary.14 2021-09-08 08:39:32 +02:00
JJ Kasper
b71df190e5
Ensure timed out prefetches are cleaned up correctly (#28899)
This applies the fix from the awesome investigation done in https://github.com/vercel/next.js/issues/28797 by @jayphelps and adds a test to ensure this is working as expected. It seems that the `route-loader` has a race condition while prefetching and if a script is executed before we have created a current "future" entry to resolve the entry stays in a pending state causing routes to hang so this handles the condition by ensuring pending/errored entries do not stay around. 

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/28797
Fixes: https://github.com/vercel/next.js/issues/27783
2021-09-08 06:37:04 +00:00
Maia Teegarden
4f8d883acd
Fix/swc minify (#28898)
* Expose minify in next-swc

* Expose minify in js binding

* Use new minify function in terser plugin

* Only upload changed binary artifact

* Build next-swc binaries

* Add swc license info to copied file
2021-09-07 15:57:47 -07:00
Gerald Monaco
620ca1b06b
Update concurrent tests and enable experimental streaming (#28892)
Updates the React 18 concurrent tests to support streaming, by using webdriver (instead of cheerio) to support dynamic updates, and being more explicit about SSR vs. hydrated content.

Also enables streaming support by setting `supportsDynamicHTML: true` in `pipe(...)` for non-bot user agents.
2021-09-07 22:34:21 +00:00
Tim Neutkens
7266d7563f
Remove unused dependencies (#28876) 2021-09-07 15:36:12 +02:00
Tim Neutkens
53c4daa557
Remove unused profiler (#28844) 2021-09-07 13:46:38 +02:00
Tim Neutkens
cab846481d
Remove outdated webpack conformance experiment (#28846) 2021-09-07 13:27:23 +02:00
Tim Neutkens
49a2fa2b07 v11.1.3-canary.13 2021-09-07 12:25:22 +02:00
Tim Neutkens
b16751283c v11.1.3-canary.12 2021-09-07 10:39:51 +02:00
Tim Neutkens
1ee74ebcf1 v11.1.3-canary.11 2021-09-07 08:15:53 +02:00
Tim Neutkens
fb3aff4139 v11.1.3-canary.10 2021-09-07 07:20:56 +02:00
Tim Neutkens
786b157c2e Update precompiled 2021-09-07 07:20:06 +02:00
Tim Neutkens
c5f724df0a v11.1.3-canary.9 2021-09-06 19:25:29 +02:00
Perry Olsson
3b55a37c81
Webpack rule to block importing images into _document (#28475) 2021-09-06 13:41:18 +02:00
Sam Royal
c4f9f1e1e0
Add line break to typescript template (#28760) 2021-09-06 13:37:40 +02:00
Houssein Djirdeh
4141aaefa5
[ESLint] Support single-file linting in next lint (necessary for lint-staged) (#28042)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-06 13:05:40 +02:00
Gerald Monaco
eab3db20c3
Simplify static + dynamic HTML generation (#28793) 2021-09-06 12:23:07 +02:00
Tim Neutkens
f9987b09e2
Add tracing for css-loader (#28756)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Steven <steven@ceriously.com>
2021-09-06 10:59:38 +02:00
Tobias Koppers
dc1e906eb2
update webpack to 5.52.0 (#28771) 2021-09-06 10:59:23 +02:00
Tobias Koppers
289edaea16
mini-css-extract-plugin should not bundle webpack code (#28822) 2021-09-06 10:53:06 +02:00
Tim Neutkens
16d6eba1c9
Reuse warning from postcss-loader (#28727)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-09-05 14:22:34 +02:00
Gerald Monaco
7f83e6d15d
Add RenderResult class (#28776) 2021-09-04 09:41:06 -05:00
JJ Kasper
85366a0244
v11.1.3-canary.8 2021-09-03 16:48:00 -05:00
Pablo Espinosa
a8088bfd67
feat: Adding generic typing for previewData (#28668)
on GetServerSidePropsContext and GetStaticPropsContext

As discussed on #21574 having a generic type will give it more flexibility and remove linting errors.

## 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 #21574 
- [ ] 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`
2021-09-03 21:27:17 +00:00
Burak
1b8bc249c7
Change create-next-app getting started text in TypeScript template (#28718)
## 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
2021-09-03 20:39:19 +00:00
Houssein Djirdeh
d0563127c6
[ESLint Plugin] Updates no-document-import-in-page rule to use path separators (#28768)
Context: https://github.com/vercel/next.js/pull/28745/files#r701418932
2021-09-03 18:51:21 +00:00
JJ Kasper
14a999ed73
Ensure build trace handles mixed modules (#28770) 2021-09-03 11:30:00 -05:00
Steven
1eb3bd9240 v11.1.3-canary.7 2021-09-02 19:09:08 -04:00
Steven
31fef9ae5d v11.1.3-canary.6 2021-09-02 18:24:42 -04:00
jj@jjsweb.site
2c27f995e4
v11.1.3-canary.5 2021-09-02 16:48:25 -05:00
Steven
7980bcd453 v11.1.3-canary.4 2021-09-02 17:32:48 -04:00
Steven
9bbba98c01
Fix next lint no-document-import-in-page on Windows (#28745)
Fixes #28596
2021-09-02 20:51:22 +00:00
Jiachi Liu
7f09df3483
Fix typings of dynamic suspense (#28740)
x-ref: https://github.com/vercel/next.js/pull/27611#issuecomment-911743160
2021-09-02 16:14:48 +00:00
Tim Neutkens
d310009c9b v11.1.3-canary.3 2021-09-02 13:40:21 +02:00
Tim Neutkens
5a2634e015
Update css-loader runtime to use compiled files (#28735) 2021-09-02 13:39:19 +02:00
Tim Neutkens
eaea8cb294
Remove .next/traces directory as it's not used (#28728)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-02 13:28:51 +02:00
Prateek Bhatnagar
7c29a262e1
Bug fix for lint rule (#28677) 2021-09-02 10:45:27 +02:00
Tim Neutkens
3693ed2e0e v11.1.3-canary.2 2021-09-02 08:55:58 +02:00
Tim Neutkens
9a56fdba82
Use consistent postcss version for all transforms (#28529)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-09-02 08:45:35 +02:00
jj@jjsweb.site
899683c3d5
v11.1.3-canary.1 2021-09-01 14:44:53 -05:00
JJ Kasper
2d1cb8fe8b
Ensure @babel/core is not duplicated (#28716)
Follow-up to https://github.com/vercel/next.js/pull/28713 this ensures we also don't duplicate `@babel/core` in our `babel-packages` bundle. This was occurring from us re-using the `@babel/core` package name which causes us to remove it from the externals [here](77c0e09371/packages/next/taskfile-ncc.js (L18-L21)).
2021-09-01 19:29:35 +00:00
JJ Kasper
77c0e09371
Ensure @babel/types is not duplicated (#28713)
This is a follow-up to https://github.com/vercel/next.js/pull/28174 to ensure we de-dupe `@babel/types` correctly as this increased the compiled `babel` packages quite a bit.
2021-09-01 17:46:50 +00:00
Jiachi Liu
ed9b8863b4
fix: should allow nullable param for res.end (#28694)
## Bug
Fixes #28693

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2021-09-01 17:01:00 +00:00
JJ Kasper
9a6542ba68
Ensure build trace is correct with extra entries (#28667)
* Ensure build trace is correct with extra entries

* lint-fix

* fix check on windows
2021-09-01 10:56:04 -05:00
Eungyeol
c1dbc12609
Do not have the required package error fix (#28662)
The following error occurred 
when I created a project with the typecript template of createp-next-app 
and did the 'next build'.

```shell
It looks like you're trying to use TypeScript but do not have the required package(s) installed.

Please install @types/node by running:

        yarn add --dev @types/node

If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your pages directory).
```

This issue was resolved by adding @types/node.
So I added @types/node to the devDependencies of the create-next-app typecript template.
2021-09-01 02:01:55 +00:00
jj@jjsweb.site
c1a97e557b
v11.1.3-canary.0 2021-08-31 16:11:16 -05:00
Rahul Gaba
c21cbdf899
Fix for next-script-for-ga ESLint rule crashing when a method is used in dangerouslySetInnerHTML (#28675)
Fixes #28635



## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
2021-08-31 20:23:21 +00:00
Steven
acf65f92dc
Fix TS type conflict for <img> tag (#28672)
This type was added in PR #28269 but doesn't need to be public and was causing conflicts with `@types/react@17`.

We currently use `@types/react@16` so ideally we should upgrade to `@types/react@17` and then remove the `ts-ignore`.

Fixes #28647
2021-08-31 19:03:08 +00:00
Tobias Koppers
f6d8a112df
fix esm externals edge case with "module" condition (#28612)
prefer commonjs externals even if "module" condition is used in package.json



## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2021-08-31 08:32:33 +00:00
Tim Neutkens
97456e81ce v11.1.2 2021-08-31 07:15:17 +02:00
jj@jjsweb.site
248b34105b
v11.1.2-canary.0 2021-08-30 21:48:53 -05:00
JJ Kasper
ff9dcc6a47
Ensure custom app regex is correct for Windows (#28631)
* Ensure custom app regex is correct for Windows

* lint-fix

* update test for ie

* update test

* lint-fix
2021-08-30 20:09:48 -05:00
Kara
9be387c7f4
getServerSideProps should support props value as Promise (#28607)
Previous to this change, getServerSideProps could only return plain objects
for props, e.g.:

```javascript
export async function getServerSideProps() {
  return {
    props: {
      text: 'some value',
    }
  }
}
```

With this commit, the props object can also be a Promise, e.g.

```javascript
export async function getServerSideProps() {
  return {
    props: (async function () {
      return {
        text: 'promise value',
      }
    })(),
  }
}
```

For now, the framework simply waits for the results of the props Promise to resolve,
but this small change sets the groundwork for later allowing props to be streamed (cc @devknoll).

## Feature

- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. -- *This is part of @devknoll's ongoing work to support streaming.*
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not. *not sure if this applies here*
- [ ] Errors have helpful link attached, see `contributing.md`
2021-08-30 19:52:15 +00:00
Jiachi Liu
8c553e8dc0
chore: upgrade styled-jsx to 4.0.1 (#28626)
Fix warning of peer dep on yarn (berry version) install
2021-08-30 19:15:14 +00:00
Steven
804971fd9a v11.1.1 2021-08-30 14:24:52 -04:00
jj@jjsweb.site
194d70f068
v11.1.1-canary.19 2021-08-30 13:20:57 -05:00
Steven
a60690f59b v11.1.1-canary.18 2021-08-30 13:06:42 -04:00
Steven
7afc97c574
Add CSP to Image Optimization API (#28620)
Add CSP header to Image Optimization API
2021-08-30 16:51:47 +00:00
JJ Kasper
f1dbc9260d
Ensure dev server side errors are correct (#28520) 2021-08-27 14:29:30 +02:00
Gerald Monaco
2cc2cb4f77
Support for functional Document components (#28515) 2021-08-26 10:05:01 -05:00
Steven
d8093ec4b4
Update warning when parent styles break next/image (#28517)
- Follow up to #28221 
- Fixes #27644
2021-08-26 00:09:04 +00:00
Steven
ed6ce1ae27 v11.1.1-canary.17 2021-08-25 15:25:53 -04:00
Houssein Djirdeh
9442925f50
handle edge case for no-import-document rule (#28261)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-08-25 13:30:49 -05:00
Steven
d835402f28 v11.1.1-canary.16 2021-08-25 12:53:06 -04:00
JJ Kasper
ead10f1f81
Fix handling for 204 status code with a body (#28479)
This ensures we handle 204 and 304 status codes correctly in API routes.  

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/28464
2021-08-25 15:52:43 +00:00
JJ Kasper
f21685549a
Update i18n locales limit to warning (#28429)
* Update i18n locales limit to warning

* update version -> versions

* bump

* Use Log.warn instead

* Apply suggestions from code review

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


Co-authored-by: Lee Robinson <me@leerob.io>
2021-08-25 08:54:38 -05:00
Tim Neutkens
c65248d732 Remove unused imports 2021-08-25 11:11:45 +02:00
Tim Neutkens
a509d906a6 v11.1.1-canary.15 2021-08-25 10:49:43 +02:00
Tim Neutkens
9316dc0a8e
Add default trace format that is exported automatically (#28461)
Co-authored-by: Steven <steven@ceriously.com>
2021-08-25 10:47:16 +02:00
JJ Kasper
706547e0c3
Ensure error is shown correctly for empty headers field (#28430)
* Ensure error is shown correctly for empty headers field

* Apply suggestions from code review

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

Co-authored-by: Steven <steven@ceriously.com>
2021-08-24 19:26:33 -05:00
Janicklas Ralph
fd1c56e66a
next/script fix duplicate scripts (#28428)
* Fix #27747

* Fix lint error

* Add data attribute to script component

* Fix #28036

* Fix tests

* Fix tests

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-08-24 11:07:38 -05:00
jj@jjsweb.site
ee462442c8
v11.1.1-canary.14 2021-08-24 09:54:07 -05:00
Mateusz Burzyński
c1a09471ff
Add missing typescript property to NextConfig (#28459)
This is similar to https://github.com/vercel/next.js/pull/27126 , https://github.com/vercel/next.js/pull/27446 and https://github.com/vercel/next.js/pull/27974

## 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
2021-08-24 14:08:18 +00:00
JJ Kasper
ece79a4e00
Update test config to leverage swc (#28400)
This updates our `jest` configuration to no longer use `babel-jest` and instead uses `@swc/jest` which is much faster. This also updates to the latest version of `jest`, fixes our `tsconfig.json` used for tests (previously types in `node_modules` weren't resolved correctly), and ensures `next/dist` isn't un-necessarily transpiled in `jest`. 

Timings for `yarn testheadless test/unit/` on CI
- before: 3m 30s - 4m ([example run](https://github.com/vercel/next.js/runs/3394701995))
- after: under 1m ([example run](https://github.com/vercel/next.js/pull/28400/checks?check_run_id=3395161621))

Timings for `yarn testheadless test/unit/` locally on m1 mac 
- before: 90.16 seconds
- after: 29.92 seconds
2021-08-23 18:36:56 +00:00
Houssein Djirdeh
80921b6a54
enables eslint caching by default (#28349)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-08-23 12:56:21 -05:00
vcnc-hex
00f1519ae7
Fix forked NODE_OPTIONS except for inspect (#28420) 2021-08-23 12:14:17 -05:00
JJ Kasper
83209a4be4
Ensure @babel/core is de-duped when nccing (#28384)
* Ensure @babel/core is de-duped when nccing

* lint-fix

* ncc babel packages together

* remove un-needed env

* bump
2021-08-22 14:06:58 -05:00
Janicklas Ralph
26255a685d
Add data attribute to script component (#28310)
Add data attribute `data-nscript` to the script component
2021-08-20 20:48:48 +00:00
Alex Castle
a0f64ba4a5
Add layout to data-nimg attribute (#28312) 2021-08-20 14:43:44 +02:00
Jiachi Liu
b74ffffa96
Fix next env vars injection in dynamic (#28309)
* Treat `next/dynamic` as non external modules
* add feature flags to webpack cache version
2021-08-20 03:50:11 +00:00
stefanprobst
da4203d032
Add eslint rule for id attribute on inline next/script (#27853)
This adds a new ESLint rule to `eslint-plugin-next` to check that `next/script` components with inline content have the required `id` attribute.

Also adjusted the code example for inline scripts in the `next/script` docs, which were actually missing an `id` attribute.
And also updated the `next/scripts` integration test to also have the required `id` attribute.

Unsure about the required heading levels in the errors .md document (other examples have h1 and h4??)

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

## Documentation / Examples

- [ ] Make sure the linting passes
2021-08-19 20:08:04 +00:00
jj@jjsweb.site
52b858a4ea
v11.1.1-canary.13 2021-08-19 12:27:49 -05:00
Houssein Djirdeh
4e7691139f
[ESLint] Adds process.exit to next lint success output (#28299)
This PR ensures that `next lint` always exits after the process is complete. This fixes #28194.
2021-08-19 17:16:59 +00:00
jj@jjsweb.site
517ea6dc20
v11.1.1-canary.12 2021-08-19 11:25:39 -05:00
Tobias Koppers
426d732feb
upgrade webpack to 5.51.1 (#28291)
https://github.com/webpack/webpack/releases/tag/v5.51.0
2021-08-19 15:32:17 +00:00
JJ Kasper
9b09b92a14
Ensure adding _app/_document HMRs correctly (#28279)
This is a follow-up to https://github.com/vercel/next.js/pull/28227 to ensure `_app` and `_document` HMR correctly when you start the dev server and then add `_app` and `_document`. 

## Bug

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

x-ref: https://github.com/vercel/next.js/issues/27888
2021-08-19 08:12:12 +00:00
Steven
53f0973aba
Fix next/image blur placeholder when JS is disabled (#28269)
This PR does a few things:

- Moves `<noscript>` usage below the blur image since so that the `<noscript>` image renders on top of the blur image
- Remove the `isVisible` check for `<noscript>` since we can't rely on client-side JS
- Add `loading=lazy` to the `<noscript>` image to take advantage of native lazy loading (can't rely on JS lazy loading)

Fixes #28251
2021-08-19 04:26:07 +00:00
jj@jjsweb.site
f4b85dc9e8
v11.1.1-canary.11 2021-08-18 11:30:31 -05:00