Commit graph

3994 commits

Author SHA1 Message Date
Tobias Koppers
41abf8b6c4
reduce default maxInactiveAge to 15s (#29817)
With persistent caching and other disposing fixes we can safely reduce the time before pages are disposed.

The last 2 client pages are still never disposed.
2021-10-11 17:12:16 +00:00
Tobias Koppers
d8437478c5
only schedule pages for disposing and dispose on next compile (#29816)
this avoids sending 'invalid' for pages that are removed from entries but not yet uncompiled (client still has page)
2021-10-11 16:12:48 +00:00
Tobias Koppers
1d2d41a502
hide build error when returning to old build (#29813)
In some cases, e. g. when introducing a build error and then returning to the successful build again, the build error modal stays open. That shouldn't happen
2021-10-11 15:31:22 +00:00
Tim Neutkens
e7f02d4a8e v11.1.3-canary.63 2021-10-11 16:49:37 +02:00
Tim Neutkens
bbe8cb0905 v11.1.3-canary.62 2021-10-11 15:41:06 +02:00
Tim Neutkens
0aa3aee594 v11.1.3-canary.61 2021-10-11 14:23:48 +02:00
Tim Neutkens
1653b4641f v11.1.3-canary.60 2021-10-11 13:14:30 +02:00
Tim Neutkens
205260236b v11.1.3-canary.59 2021-10-11 10:58:56 +02:00
Tim Neutkens
e7f503abd3
Pass sourcemap when swcMinify is enabled (#29794) 2021-10-11 10:57:21 +02:00
Donny/강동윤
bcb8e44b7e
Update swc (#29798)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-11 10:55:59 +02:00
Tobias Koppers
87d0fc9fd7
avoid using absolute paths in import/require (#29797)
Using absolute paths leads to unnecessary watched paths and tested paths for resolving
2021-10-11 08:52:59 +00:00
Tobias Koppers
77b65327cf
show partial compiled message and correct module count (#29795)
```
event - compiled successfully in 4.1s (1597 modules)
event - compiled client successfully in 271 ms (1076 modules)
```

instead of

```
event - compiled successfully in 4.1 s (1597 modules)
event - compiled successfully in 271 ms (1708 modules)
```

* spacing for seconds
* module count only counts modules from compilers that were running
* add a note to message when only one compiler had something to do
2021-10-11 08:14:52 +00:00
Tim Neutkens
71c013b142 v11.1.3-canary.58 2021-10-11 08:38:20 +02:00
Donny/강동윤
2874791ab1
Fix styled-jsx: Don't drop extra selectors (#29791)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-11 08:36:23 +02:00
Donny/강동윤
99fed15b8b
Update test refs (#29776) 2021-10-10 10:36:43 -05:00
Tim Neutkens
1f5ef906bd v11.1.3-canary.57 2021-10-10 13:21:34 +02:00
Tim Neutkens
23686594be v11.1.3-canary.56 2021-10-10 12:47:21 +02:00
Donny/강동윤
2cd52aed26
Fix bugs of styled-jsx and swc (#29774)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-10 12:46:44 +02:00
Tim Neutkens
2c2a4005e1 v11.1.3-canary.55 2021-10-10 08:09:00 +02:00
Donny/강동윤
f1c62d5073
feat(build/swc): Add debug utilities (#29730)
* Make debug build faster

* Organize for easier testing

* Add example tests

* Test system

* Update test refs

* Ensure that we are fully processing

* Update test refs

* Update test system

* Update swc

* Fix

* Update test refs

* Update test refs

* Ignore tests in nextbuild task

* Fix attrs

* Add a test

* Update test refs

* Add a test

* Fix hygiene bug

* Update test refs

* Update swc

* Build next-swc binaries

Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-10 07:25:15 +02:00
Tim Neutkens
628bb397b3
Fix bug with getServerSideProps when swcLoader is enabled (#29760)
Ported from #29185

These are all related to `swcLoader`:
- Fixes commonjs code being output as ESM
- Fixes bug with `getServerSideProps` not getting querystrings and added tests for it
- Disable SWC on Babel test suites
- Disable SWC on no-anon-default-export test suite
- Disable SWC on page-config test suite (pending porting of the Babel plugin)
- Ensure `sourcesContent` is part of the sourcemap



## 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-09 14:39:53 +00:00
Tim Neutkens
81b2745fe9 v11.1.3-canary.54 2021-10-09 13:19:59 +02:00
Tim Neutkens
a7932cbb6c
Add trace span for module readFile (#29759) 2021-10-09 13:18:58 +02:00
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
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