Commit graph

4347 commits

Author SHA1 Message Date
JJ Kasper
63024d32b4
Update publish-native to not block on error (#30565) 2021-10-28 11:26:09 -05:00
Keen Yee Liau
7077bf8c26
add warning to update featureName in FEATURE_USAGE backend (#30283)
`featureName` is restricted to certain values for security reasons.
Before any change is made in the client, backend code has to be updated first.
2021-10-28 11:16:42 -05:00
Tobias Koppers
ac58857d7d v12.0.2-canary.5 2021-10-28 17:08:30 +02:00
Tobias Koppers
93341345db
Update swc (#30552)
Co-authored-by: Donny/강동윤 <kdy1997.dev@gmail.com>
2021-10-28 17:07:48 +02:00
Tobias Koppers
c0dd481ea6
exclude musl from target (#30557) 2021-10-28 16:58:58 +02:00
Tobias Koppers
0d924ca025 v12.0.2-canary.4 2021-10-28 15:17:08 +02:00
Tobias Koppers
215fa85c8e
Revert "Update swc to fix minifier issue (#30540)" (#30551)
This reverts commit 387d6564ae.
2021-10-28 15:11:55 +02:00
Donny/강동윤
14d3f01a98
Exclude musl from target (#30548) 2021-10-28 14:59:20 +02:00
Donny/강동윤
387d6564ae
Update swc to fix minifier issue (#30540)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-28 13:59:45 +02:00
Donny/강동윤
3a9f008c99
Update swc (#30509)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-28 12:25:54 +02:00
JJ Kasper
215cc58562
Update to copy necessary RSC files from dep (#30505)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-28 11:07:13 +02:00
Tim Neutkens
88131eb704 v12.0.2-canary.3 2021-10-28 10:17:16 +02:00
JJ Kasper
82001f2d54
Share resolve logic for trace and externals (#30499)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-28 10:14:09 +02:00
Maia Teegarden
fe16ab0f22
Fix issue with placeholder followed by numbers (#30493)
* Fix issue with placeholder followed by numbers

* Build next-swc binaries
2021-10-27 17:07:45 -07:00
JJ Kasper
e465e90fe5
Fix native-url containing non-es5 usage (#30474)
This ensures we don't add non-es5 code from ncc'ing 

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

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
2021-10-27 20:13:28 +00:00
Tim Neutkens
207e8add0e v12.0.2-canary.2 2021-10-27 19:48:49 +02:00
Tim Neutkens
aadc653665
Make sure externals is an array (#30466)
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2021-10-27 19:48:10 +02:00
Steven
3292713654
Relax warning for next/image parent element (#30453)
This warning was incorrectly displaying for the "background" use case demonstrated here: https://image-component.nextjs.gallery/background
2021-10-27 16:43:02 +00:00
Tobias Koppers
02ba241105 v12.0.2-canary.1 2021-10-27 17:16:48 +02:00
Tobias Koppers
ddc916ce74
remove console.log (#30447) 2021-10-27 17:13:57 +02:00
Donny/강동윤
ddcfab4447
Update swc (#30426)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2021-10-27 16:55:35 +02:00
Tim Neutkens
ecc7f6f86a v12.0.2-canary.0 2021-10-27 16:31:15 +02:00
Tobias Koppers
f7048b55ec
fix external fallback for invalid packages (#30427)
fallback to alternative external version also when it fails because of base resolve mismatch#

fix resolved .mjs modules treated as external

fixes #30330
2021-10-27 13:53:44 +00:00
Donny/강동윤
979e9bd94f
Update swc (#30404)
## Bug

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

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

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


This includes

 - https://github.com/swc-project/swc/pull/2530
   - Strip out `declare`-d class properties properly.

 - https://github.com/swc-project/swc/pull/2538
   - Marks method properties as a scope while renaming variables.
   - Fix regression of object-rest pattern handler.
   - Improve name mangler a bit, by marking it as a scope.

 - https://github.com/swc-project/swc/pull/2551
   - Fix a bug of the property inlining pass which can break many react apps.

There is a minor regression in the minifier due to added aliasing check.


(I manually selected crates to update)
2021-10-27 08:18:21 +00:00
Tobias Koppers
431178bf53
update tsconfig correctly when compilerOptions is not set yet (#30355)
A tsconfig like:

```
{
  "extends": "..."
}
```

currently fails the build if the config that is extended from has not the expected configuration (and we want to update it)

Fixes: https://github.com/vercel/next.js/issues/30360
2021-10-27 04:11:07 +00:00
jj@jjsweb.site
ff926d5c1b
v12.0.1 2021-10-26 20:59:41 -05:00
jj@jjsweb.site
6467de14b2
v12.0.1-canary.5 2021-10-26 20:02:05 -05:00
Steven
3bdf80dde5
Fix PerformanceObserver usage for older browsers and CI (#30387)
Browsers older than 2017 don't have PerformanceObserver https://caniuse.com/mdn-api_performanceobserver


- Fixes https://github.com/vercel/next.js/issues/30322
- Fixes https://twitter.com/fmgordillo/status/1453037730141716492
2021-10-27 00:37:19 +00:00
jj@jjsweb.site
89e244ec41
v12.0.1-canary.4 2021-10-26 18:56:13 -05:00
Donny/강동윤
a796cedf97
Disable loading of .swcrc (#30384)
We found that `.swcrc` was unintentionally loaded breaking applications as it is not tested for that yet, customization will be added at a later point in time



## Bug

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

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-10-26 23:54:55 +00:00
Jiachi Liu
8e4055433e
Fix exportRuntime and react-18 concurrent tests (#30381)
* disable concurrent test cases in short term to improve them later
* remove bad alias in next.config.js
2021-10-26 23:17:55 +00:00
Jiachi Liu
8077f4213d
lint: remove unused (#30370) 2021-10-26 23:02:51 +02:00
Jiachi Liu
da1f8adfef v12.0.1-canary.3 2021-10-26 22:26:30 +02:00
Tobias Koppers
3d035cea3c
fix rsc on windows (#30364) 2021-10-26 22:24:28 +02:00
Tobias Koppers
95607130a0
keep sortedMiddleware intact as it's used by the runtime (#30361)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-26 22:18:08 +02:00
jj@jjsweb.site
17c91ccb8c
v12.0.1-canary.2 2021-10-26 13:14:23 -05:00
Jiachi Liu
c2541e2fd9
Fix flight loader parsing (#30345) 2021-10-26 20:13:51 +02:00
JJ Kasper
4c83292a84
Update SWC OS and CPU fields (#30341)
* Update SWC OS and CPU fields

* co-authored-by: CanKolay5677 <80613396+CanKolay5677@users.noreply.github.com>
2021-10-26 13:11:31 -05:00
Tobias Koppers
520c5a4083
fix missed hmr events (#30309)
When an compilation happens in the timespan between "page loaded client bundle" and "web socket got initial sync event" it didn't apply the hmr update.
2021-10-26 20:06:29 +02:00
Tim Neutkens
2fa8caa999
Clear up confusion around SWC being disabled for Babel while swcMinify is on (#30337) 2021-10-26 12:59:37 -05:00
jj@jjsweb.site
0d236f7380
v12.0.1-canary.1 2021-10-26 11:52:16 -05:00
Shu Ding
5ddee4494b
Add new target for middleware (#30299)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-10-26 18:50:56 +02:00
jj@jjsweb.site
da2bb52349
v12.0.1-canary.0 2021-10-26 11:33:21 -05:00
jj@jjsweb.site
8a450db14a
v12.0.0 2021-10-26 10:35:23 -05:00
jj@jjsweb.site
9f0330f301
Fix TS error 2021-10-26 10:29:17 -05:00
Tim Neutkens
b127efa936 v11.1.3-canary.105 2021-10-26 17:08:23 +02:00
Javi Velasco
c497b3a5ff
Improve deprecation errors for new middleware API (#30316)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com>
2021-10-26 17:03:39 +02:00
JJ Kasper
8b85801852
Ensure null bytes in resolved path are handled (#30313)
This ensures we remove null bytes from the resolved path as it isn't valid when using `path`/`fs`. Additional tests have been added to ensure this is handled properly. 

## 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/30298
2021-10-26 13:16:48 +00:00
Maia Teegarden
0ab8c7ada6
Track usage of swc features (#30297)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-10-26 09:37:38 +02:00
JJ Kasper
9eceb95596
Move outputFileTracing config up (#30295)
* Move outputFileTracing config up

* remove old nftTracing config

* remove old config

Co-authored-by: Steven <steven@ceriously.com>
2021-10-25 23:22:45 -05:00
Steven
3828ebea3c
Fix middleware header propagation (#30288) 2021-10-25 23:26:28 -04:00
JJ Kasper
2f329d2fd4
Update swc-minify-enabled link (#30290) 2021-10-25 21:37:23 -05:00
Maia Teegarden
5a206e528c
v11.1.3-canary.104 2021-10-25 19:32:21 -07:00
Maia Teegarden
697704d998
v11.1.3-canary.103 2021-10-25 19:03:11 -07:00
Maia Teegarden
20da8079f3
Chore/publish all swc (#30289)
* Publish more swc targets

* Remove prebuilt binaries

* Use correct path for caching

* Build next-swc binaries

* Remove unused job dependency
2021-10-25 19:00:36 -07:00
Kara
f6c58cb83a
Warn when mutating res if not streaming (#30284)
In #29010, we started throwing an error if the res was mutated after
getServerSideProps() returned. This was to support classic streaming,
where it would be possible to accidentally mutate the response headers
after they were already sent. However, this change also caught [a few
non-streaming cases](https://github.com/vercel/next.js/pull/29010#issuecomment-943482743) that we don't want to break.

As such, with this change, we only throw the error if res is mutated
after gSSP returns *and* you've opted into using classic streaming.
Otherwise, we will only add a warning to the console.
2021-10-25 20:18:03 -05:00
jj@jjsweb.site
cc4857f3ab
v11.1.3-canary.102 2021-10-25 19:58:13 -05:00
JJ Kasper
73fbd698bd
Fix trace case with tsconfig/jsconfig baseUrl (#30286) 2021-10-25 18:38:30 -05:00
Javi Velasco
0910e8b8ca
New Middleware API signature (#30282)
Co-authored-by: Steven <steven@ceriously.com>
2021-10-25 18:59:41 -04:00
Steven
4782cacecf
Add warning when LCP image is missing priority prop (#30221) 2021-10-25 17:59:00 -04:00
jj@jjsweb.site
04296cef4a
v11.1.3-canary.101 2021-10-25 15:17:00 -05:00
JJ Kasper
a25c1dd15a
Add warning for large amount of page data (#29956)
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-25 21:07:05 +02:00
Tobias Koppers
9072e6f1a7
fix middleware on windows (#30253)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-25 20:51:33 +02:00
Tobias Koppers
149353b8c9
update webpack (#30268) 2021-10-25 13:06:51 -05:00
JJ Kasper
1a10ab8c39
Update error for failing to load SWC bindings (#30269) 2021-10-25 12:23:44 -05:00
Donny/강동윤
085df63bf9
next-swc: Support more platforms (#30254)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-10-25 17:00:48 +02:00
Tim Neutkens
467bf08a8a
Add events polyfill (#30256) 2021-10-25 15:32:01 +02:00
Tim Neutkens
bc3ab3ce94
Move swcMinify out of experimental (#29810) 2021-10-25 13:49:11 +02:00
JJ Kasper
474f1e7d93
Add initial test trace outputs (#30246) 2021-10-25 08:21:57 +02:00
jj@jjsweb.site
9d280afb86
v11.1.3-canary.100 2021-10-24 20:06:36 -05:00
Tim Neutkens
deaf1678b0
Ensure isServer is true when compiling middleware (#30242)
* Ensure isServer is true when compiling middleware

* Update packages/next/build/webpack-config.ts

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>

* Update packages/next/build/webpack-config.ts

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2021-10-24 20:05:27 -05:00
Tobias Koppers
04e1e01f18
test, fix and document all possible import types for URL imports (#30165)
resolve absolute URLs in CSS when using urlImports
remove `[path]` from static static image output path
replace file-loader with asset module, remove file-loader
2021-10-25 01:54:16 +02:00
jj@jjsweb.site
1e82a3f2ec
v11.1.3-canary.99 2021-10-24 17:28:37 -05:00
Steven
367a420d5c
Use Log.warn() instead of console.warn() in next-server (#30240)
* Use Log.warn() instead of console.warn() in next-server

* Update test and update build warn as well

Co-authored-by: jj@jjsweb.site <jj@jjsweb.site>
2021-10-24 17:27:00 -05:00
Tobias Koppers
df613d3909
fix some labels for middleware stuff (#30241)
* show `(client only)` for _middleware files

* show f symbol for _middleware files in summary tree

add explanation
show only used symbols
2021-10-24 17:09:47 -05:00
Tobias Koppers
3bb098f882
hide next-middleware-loader in import trace (#30243) 2021-10-24 23:04:46 +02:00
Tobias Koppers
d2f96f5f9c
partially migrate to webpack 5 types (#30189)
fix type declarations to avoid import from webpack/webpack4/webpack5 in type declarations
2021-10-24 23:04:26 +02:00
JJ Kasper
9d4e7b45dc
Add initial documentation for output file tracing (#30199)
* Add initial documentation for output file tracing

* Apply suggestions from code review

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

Co-authored-by: Steven <steven@ceriously.com>
2021-10-24 10:39:22 -05:00
JJ Kasper
649b41704b
Add deprecation note for target (#30200)
* Add deprecation note for target

* Apply suggestions from code review

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

* Mention Vercel leverages the traces

Co-authored-by: Steven <steven@ceriously.com>
2021-10-24 10:38:24 -05:00
Tim Neutkens
93e3c378bc v11.1.3-canary.98 2021-10-24 15:58:17 +02:00
Donny/강동윤
1acc9dd5da
Update swc (#30230)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-24 15:56:33 +02:00
Tim Neutkens
7edeca13d1
Use SWC for middleware (#30209) 2021-10-24 15:26:36 +02:00
Tim Neutkens
417ad95e04
Add isDevfallback to cache name to create a separate cache for the fallback compiler (#30227) 2021-10-24 15:25:02 +02:00
JJ Kasper
5d8f155e09
Enable outputFileTracing by default (#30202) 2021-10-23 12:37:06 -05:00
Tim Neutkens
45c7beff3a v11.1.3-canary.97 2021-10-23 11:11:52 +02:00
Tim Neutkens
08a7f7f31a
Enable SWC by default when there is no custom Babel config (#29811)
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: jj@jjsweb.site <jj@jjsweb.site>
Co-authored-by: Maia Teegarden <dev@padmaia.rocks>
Co-authored-by: padmaia <padmaia@users.noreply.github.com>
2021-10-23 10:21:44 +02:00
Jiachi Liu
79c25a4a87
Upgrade styled-jsx for react 18 improvement (#30179)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-23 08:07:28 +02:00
Steven
7dbbc9d262 v11.1.3-canary.96 2021-10-22 23:08:42 -04:00
Steven
af5f4a8960
Remove all: initial in favor of specific styles on next/image (#30191)
This reverts some of #30064 which added the `all: initial` style.

That was causing every inline style to be expanded and also prevented `cursor: pointer` from being inherited.

<details>
<summary>View styles</summary>
<p>

```
color: initial; font: initial; font-feature-settings: initial; font-kerning: initial; font-optical-sizing: initial; font-variation-settings: initial; forced-color-adjust: initial; text-orientation: initial; text-rendering: initial; -webkit-font-smoothing: initial; -webkit-locale: initial; -webkit-text-orientation: initial; -webkit-writing-mode: initial; writing-mode: initial; zoom: initial; accent-color: initial; place-content: initial; place-items: initial; place-self: initial; alignment-baseline: initial; animation: initial; appearance: initial; aspect-ratio: initial; backdrop-filter: initial; backface-visibility: initial; background: initial; background-blend-mode: initial; baseline-shift: initial; block-size: initial; border-block: initial; border: initial; border-radius: initial; border-collapse: initial; border-end-end-radius: initial; border-end-start-radius: initial; border-inline: initial; border-start-end-radius: initial; border-start-start-radius: initial; inset: initial; box-shadow: initial; box-sizing: border-box; break-after: initial; break-before: initial; break-inside: initial; buffered-rendering: initial; caption-side: initial; caret-color: initial; clear: initial; clip: initial; clip-path: initial; clip-rule: initial; color-interpolation: initial; color-interpolation-filters: initial; color-rendering: initial; color-scheme: initial; columns: initial; column-fill: initial; gap: initial; column-rule: initial; column-span: initial; contain: initial; contain-intrinsic-size: initial; content: initial; content-visibility: initial; counter-increment: initial; counter-reset: initial; counter-set: initial; cursor: initial; cx: initial; cy: initial; d: initial; display: block; dominant-baseline: initial; empty-cells: initial; fill: initial; fill-opacity: initial; fill-rule: initial; filter: initial; flex: initial; flex-flow: initial; float: initial; flood-color: initial; flood-opacity: initial; grid: initial; grid-area: initial; height: initial; hyphens: initial; image-orientation: initial; image-rendering: initial; inline-size: initial; inset-block: initial; inset-inline: initial; isolation: initial; letter-spacing: initial; lighting-color: initial; line-break: initial; list-style: initial; margin-block: initial; margin: initial; margin-inline: initial; marker: initial; mask: initial; mask-type: initial; max-block-size: initial; max-height: initial; max-inline-size: initial; max-width: 100%; min-block-size: initial; min-height: initial; min-inline-size: initial; min-width: initial; mix-blend-mode: initial; object-fit: initial; object-position: initial; offset: initial; opacity: initial; order: initial; origin-trial-test-property: initial; orphans: initial; outline: initial; outline-offset: initial; overflow-anchor: initial; overflow-clip-margin: initial; overflow-wrap: initial; overflow: initial; overscroll-behavior-block: initial; overscroll-behavior-inline: initial; overscroll-behavior: initial; padding-block: initial; padding: initial; padding-inline: initial; page: initial; page-orientation: initial; paint-order: initial; perspective: initial; perspective-origin: initial; pointer-events: initial; position: initial; quotes: initial; r: initial; resize: initial; ruby-position: initial; rx: initial; ry: initial; scroll-behavior: initial; scroll-margin-block: initial; scroll-margin: initial; scroll-margin-inline: initial; scroll-padding-block: initial; scroll-padding: initial; scroll-padding-inline: initial; scroll-snap-align: initial; scroll-snap-stop: initial; scroll-snap-type: initial; scrollbar-gutter: initial; shape-image-threshold: initial; shape-margin: initial; shape-outside: initial; shape-rendering: initial; size: initial; speak: initial; stop-color: initial; stop-opacity: initial; stroke: initial; stroke-dasharray: initial; stroke-dashoffset: initial; stroke-linecap: initial; stroke-linejoin: initial; stroke-miterlimit: initial; stroke-opacity: initial; stroke-width: initial; tab-size: initial; table-layout: initial; text-align: initial; text-align-last: initial; text-anchor: initial; text-combine-upright: initial; text-decoration: initial; text-decoration-skip-ink: initial; text-indent: initial; text-overflow: initial; text-shadow: initial; text-size-adjust: initial; text-transform: initial; text-underline-offset: initial; text-underline-position: initial; touch-action: initial; transform: initial; transform-box: initial; transform-origin: initial; transform-style: initial; transition: initial; user-select: initial; vector-effect: initial; vertical-align: initial; visibility: initial; -webkit-app-region: initial; border-spacing: initial; -webkit-border-image: initial; -webkit-box-align: initial; -webkit-box-decoration-break: initial; -webkit-box-direction: initial; -webkit-box-flex: initial; -webkit-box-ordinal-group: initial; -webkit-box-orient: initial; -webkit-box-pack: initial; -webkit-box-reflect: initial; -webkit-highlight: initial; -webkit-hyphenate-character: initial; -webkit-line-break: initial; -webkit-line-clamp: initial; -webkit-mask-box-image: initial; -webkit-mask: initial; -webkit-mask-composite: initial; -webkit-perspective-origin-x: initial; -webkit-perspective-origin-y: initial; -webkit-print-color-adjust: initial; -webkit-rtl-ordering: initial; -webkit-ruby-position: initial; -webkit-tap-highlight-color: initial; -webkit-text-combine: initial; -webkit-text-decorations-in-effect: initial; -webkit-text-emphasis: initial; -webkit-text-emphasis-position: initial; -webkit-text-fill-color: initial; -webkit-text-security: initial; -webkit-text-stroke: initial; -webkit-transform-origin-x: initial; -webkit-transform-origin-y: initial; -webkit-transform-origin-z: initial; -webkit-user-drag: initial; -webkit-user-modify: initial; white-space: initial; widows: initial; width: initial; will-change: initial; word-break: initial; word-spacing: initial; x: initial; y: initial; z-index: initial;
```

</p>
</details>

Instead, we will add a few more styles for width/height/opacity to prevent accidentally overriding those.
2021-10-23 02:17:27 +00:00
JJ Kasper
3274efc398
Update to latest caniuse-lite version (#30194) 2021-10-22 20:36:33 -05:00
JJ Kasper
7054096b76
Move tracing next-server to next build (#30190)
As discussed this moves tracing `next-server` into `next build` since the pre-trace at publish time isn't able to reliably give us file locations since `node_module` file locations can vary based on installation. This also adds caching the trace so that we only need to retrace `next-server` when a lockfile changes. 

A follow-up PR will add documentation for these traces explaining how they can be leveraged. 

## Bug

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

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-10-22 23:49:38 +00:00
Maia Teegarden
d5aa0387b9
Add page config swc transform (#30183)
* Add page config swc transform

* Build next-swc binaries

* Disable page config transform in some scenarios

* Build next-swc binaries

* Only skip dropping bundle in dev mode

* Build next-swc binaries

* Allow for amp 'hybrid' configuration

* Build next-swc binaries
2021-10-22 16:08:09 -07:00
Steven
ca65fd8f87
Change AVIF to opt-in via configuration (#30180)
AVIF (shown in purple) is generally slower to encode than WebP (shown in yellow) so it is probably not a good default for on-demand Image Optimization.

Instead, we'll let users opt-in via `formats` configuration.

![performance](https://user-images.githubusercontent.com/229881/138511198-b987d307-17c2-47c2-816f-766a43d77efd.png)
2021-10-22 21:08:03 +00:00
JJ Kasper
243175f049
Add middlewareCount info to build optimized (#30185)
This adds info on number of `_middleware` routes being used. 

## Bug

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

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-10-22 20:12:12 +00:00
Tobias Koppers
ab50a4e344
make import trace consistent between runtime and build (#30175) 2021-10-22 19:32:25 +00:00
JJ Kasper
ff474b01db
Update include/exclude handling for output tracing (#30184)
* Use micromatch for excludes and add tests

* update compiled

* check glob array once per file
2021-10-22 13:55:45 -05:00
JJ Kasper
e39f30e897
De-dupe inflight getStaticProps requests (#30125)
This ensures we de-dupe inflight `getStaticProps` requests the same way we do `getServerSideProps`, this also removes the `_getStaticData` and `_getServerData` methods as they were repeating the same logic so could be combined into `fetchNextData`.
2021-10-22 14:34:57 +00:00
jj@jjsweb.site
94dad198d6
v11.1.3-canary.95 2021-10-22 08:56:12 -05:00
Tobias Koppers
5c35066820
make static image import output path consistent with other media (#30168)
This will ensure an image hashed consistently regardless of how its imported:

- `import file from "./file.png"` -> /_next/static/media/file.12345678.png
- `url(./file.png)` -> /_next/static/media/file.12345678.png
-  `new URL("./file.png", import.meta.url)` -> /_next/static/media/file.12345678.png
2021-10-22 13:25:54 +00:00
Tobias Koppers
8a4d1f75f2
test and fix error reporting for stack overflows and other fatal errors (#30169)
## Bug

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

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-10-22 10:30:50 +00:00
JJ Kasper
67681fe097
Replace middleware flag with warning (#30160)
Follow-up to https://github.com/vercel/next.js/pull/30154 this replaces the experimental flag with a warning that is shown once on usage instead.
2021-10-22 06:40:57 +00:00
JJ Kasper
7e81d13a8e
Add experimental config for middleware (#30154)
* Add experimental config for middleware

* Apply suggestions from code review

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

Co-authored-by: Steven <steven@ceriously.com>
2021-10-21 22:00:51 -05:00
jj@jjsweb.site
25908cf963
v11.1.3-canary.94 2021-10-21 20:38:20 -05:00
Steven
022675404b
Use default next.config.js if not found (#30155)
Some warnings/errors will mention `next.config.js` even if it doesn't exist so we'll make sure to assign a default value of `next.config.js`.

- Follow up to #30152
2021-10-22 01:18:57 +00:00
Steven
6f3e9470a6
Ensure error message prints next.config.mjs (#30152)
This PR ensures we print the correct error message for either `next.config.js` or `next.config.mjs`, whichever was detected.
2021-10-21 23:04:40 +00:00
JJ Kasper
97f0752e47
Update middleware chunk handling (#30151)
* Update middleware chunk handling

* fix lint
2021-10-21 17:00:26 -05:00
jj@jjsweb.site
208667a17a
v11.1.3-canary.93 2021-10-21 13:42:37 -05:00
JJ Kasper
1e2c4c4c00
Ensure we dont attempt minifying middleware-chunks (#30147)
Follow-up to https://github.com/vercel/next.js/pull/30122 this ensures we don't minify the accompanying `middleware-chunks` either.
2021-10-21 18:41:36 +00:00
Tim Neutkens
00fdb64da7 v11.1.3-canary.92 2021-10-21 16:59:15 +02:00
Donny/강동윤
15ad98de32
Update swc (#30141)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-21 16:47:05 +02:00
Tim Neutkens
581e28675c v11.1.3-canary.91 2021-10-21 15:55:07 +02:00
Tobias Koppers
d07107f2c6
add experimental.urlImports option (#30079)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Rich Haines <hello@richardhaines.dev>
2021-10-21 13:14:57 +02:00
Tobias Koppers
be2156f634
fix pageKey and compiling output for on-demand-entries (#30116)
shows `compiling /_error...` instead of `compiling /next/dist/pages/_error...`
2021-10-21 10:52:50 +00:00
Tobias Koppers
8bce51d8a9
avoid showing empty Import trace for requested module (#30130)
## Bug

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

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-10-21 10:07:02 +00:00
Donny/강동윤
5f73633d4d
Update swc (#30127)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-21 08:31:36 +02:00
Maia Teegarden
282c1c9d7c
Fix creation of styled jsx ids (#30124)
Ids of dynamic styles now match ids in dynamic class names (`_JSXStyle.dynamic()`) when there are mixed styles (global/static).

## 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-21 03:56:57 +00:00
jj@jjsweb.site
d87955e882
v11.1.3-canary.90 2021-10-20 22:11:58 -05:00
JJ Kasper
0ac0b3f19f
Skip minifying middleware (#30122)
This skips minifying middleware as it can cause issues in some cases like the below error and also isn't necessary to be minified as we don't currently minify other server pages. 

```
TypeError: (intermediate value)(intermediate value)(intermediate value)(...) is not a function
```
2021-10-21 02:33:42 +00:00
Tobias Koppers
ecf2ee9c51
automatically enable managed paths for all node_modules (#30089)
This improves caching performance in monorepos where there are multiple node_modules folders
Automatically enable immutable paths for Yarn PnP
2021-10-21 01:25:45 +00:00
Roj
dd81d2c97e
Simplify export statement (#30015) 2021-10-21 00:31:14 +00:00
Tobias Koppers
b2a9918165
improve production error message printing (#30065)
* improve production error message printing

* update test cases

* add test case

* improve printing of build errors

* improve types

* fix test cases
2021-10-20 18:23:44 -05:00
Houssein Djirdeh
c8f25ba70b
adds temporary eslint v8 error (#30113) 2021-10-20 17:28:08 -05:00
jj@jjsweb.site
62895a8b29
v11.1.3-canary.89 2021-10-20 16:42:42 -05:00
Tobias Koppers
610d2b37c8
use xxhash64 by default (#30095)
Node.js 17 stopped supporting md4 as hash function

and we wanted to use a faster hash function anyway.

Fixes: https://github.com/vercel/next.js/issues/30078
2021-10-20 21:39:55 +00:00
JJ Kasper
f068319d4d
Enable shared worker pool by default (#30110) 2021-10-20 14:06:43 -05:00
jj@jjsweb.site
7db5c9841e
v11.1.3-canary.88 2021-10-20 13:03:26 -05:00
Javi Velasco
a815ba9f79
Implement Middleware RFC (#30081)
This PR adds support for [Middleware as per RFC ](https://github.com/vercel/next.js/discussions/29750). 

## 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-20 17:52:11 +00:00
Tim Neutkens
157302d593 v11.1.3-canary.87 2021-10-20 16:16:51 +02:00
Tim Neutkens
78ce76553b
Enable fast refresh transform when using SWC (#30106) 2021-10-20 16:07:35 +02:00
Donny/강동윤
981348761b
Update swc (#30086)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-20 14:14:26 +02:00
Steven
f2cf092ee6
Print error when images.loader is assigned but images.path is not (#30080)
Fixes #29744
2021-10-20 00:17:24 +00:00
Tobias Koppers
6f3dc0162f
update webpack (#30073)
https://github.com/webpack/webpack/releases/tag/v5.59.0

We need:
* experiments.buildHttp improvements for the new experimental flag
* managedPaths improvements from the monorepo improvements
* module build hooks for tracing
2021-10-19 21:03:12 +00:00
Steven
7439b976fc v11.1.3-canary.86 2021-10-19 13:29:37 -04:00
Steven
c4e26ab248
Prevent inherited styles on next/image wrapper or sizer (#30064)
As a follow up to #30041 which changed `<div>` to `<span>`, this PR makes sure that unexpected styles are not applied to the image wrapper or sizer spans.

For example: `.content span {}` would apply to all spans and incorrectly style the image wrapper.

This PR adds [`all: initial`](https://developer.mozilla.org/en-US/docs/Web/CSS/all) to effectively reset the span styles.
2021-10-19 17:16:17 +00:00
Donny/강동윤
f308b8a352
Update swc (#30066)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-19 17:50:07 +02:00
Tim Neutkens
3431214f02 v11.1.3-canary.85 2021-10-19 13:36:18 +02:00
Donny/강동윤
6f5ec2bd96
Update swc (#30057)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-19 13:34:54 +02:00
Donny/강동윤
caef3373da
Update swc (#30055)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-19 09:16:59 +02:00
jj@jjsweb.site
ab8e7dbfe2
v11.1.3-canary.84 2021-10-19 00:00:24 -05:00
Ionuț Botizan
d9bd329129
Sanitize the path to the user config before importing (#30003) 2021-10-18 22:46:11 -05:00
JJ Kasper
5e034940d1
Update manifest to include notFound revalidate info (#30046)
This ensures we include `notFound` routes in the `prerender-manifest` routes so that we have the `revalidate` information available.
2021-10-19 00:27:20 +00:00
Jiachi Liu
33c687ac42
Update react 18 streaming api (#30038) 2021-10-18 18:36:51 -05:00
jj@jjsweb.site
74c5c5b762
v11.1.3-canary.83 2021-10-18 17:58:01 -05:00
JJ Kasper
afbb56363b
Fix trace when initial file is also child (#30048)
* Fix trace when initial file is also child

* update page count test
2021-10-18 17:39:18 -05:00
Steven
1a0c1e8a5b
Fix next/image when parent is <p> (#30041)
- Fixes #29717 
- Fixes #21433 
- Closes #21475
2021-10-18 21:29:19 +00:00
jj@jjsweb.site
74ff911e53
v11.1.3-canary.82 2021-10-18 15:08:27 -05:00
JJ Kasper
dfd4069791
Fix eslint loading on Windows (#30040)
This fixes the failing Azure tests from `import` being used to load `eslint` with an absolute path: 

```sh
error - ESLint: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
```
2021-10-18 19:10:20 +00:00
JJ Kasper
071ecb0b7b
Update tracing to collect from reasons (#29975)
This updates the `outputFileTracing` to fix a few cases we noticed where files weren't caught and also ensures we match webpack's `esm` resolving so that we don't include `cjs` files when webpack expects `esm`, it also updates to the latest `@vercel/nft` version which removes the caching in favor of ensuring the `reasons` map contains all parents allowing us to trace all entries in one `nodeFileTrace` run and the collect the separate files for each entry from the `reasons` map giving us much better performance/reliability.  

This also ensures we don't include static image imports when enabled in the traces since they can drastically increase deployment size on larger projects.
2021-10-18 17:01:02 +00:00
Donny/강동윤
b7114bce43
Update swc to fix regenerator issue (#30035)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-18 18:14:25 +02:00
Steven
777957e6b1
Compile native-url and node-libs-browser (#30032)
This prevents useless warnings about querystring.

```
warning next > native-url > querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning next > node-libs-browser > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
```
2021-10-18 15:46:39 +00:00
Donny/강동윤
a4eda09eab
Update swc (#30029)
* Update swc

* Build next-swc binaries

Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-18 15:18:40 +02:00
Tim Neutkens
9759152438 v11.1.3-canary.81 2021-10-18 10:58:42 +02:00
Donny/강동윤
486d82434b
Update swc (#30019)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-18 10:48:26 +02:00
Gerald Monaco
6ba2078b79
Remove obsolete prerender indicator code (#30004)
`isPrerendered` was used for the prerender indicator, which was removed in #18629
2021-10-18 00:27:19 +00:00
Tim Neutkens
ab4b2a9e73 v11.1.3-canary.80 2021-10-17 16:28:33 +02:00
Donny/강동윤
9885ab6282
Update swc to fix minifier (#29989)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-17 16:25:37 +02:00
Tim Neutkens
5edfbf276e v11.1.3-canary.79 2021-10-17 12:18:18 +02:00
Donny/강동윤
7e5391268f
Fix identifier handling ofstyled-jsx (#29986)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-17 12:17:13 +02:00
Tim Neutkens
2a2c1c9ed7 v11.1.3-canary.78 2021-10-17 09:55:07 +02:00
Donny/강동윤
a3fcebc3ee
Update swc (#29969)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-17 09:50:01 +02:00
JJ Kasper
dff6a71e77
Fix config import on Windows and disable test in failing envs (#29971)
Follow-up to https://github.com/vercel/next.js/pull/29935 this fixes the failing tests on Azure as it seems the `import()` needs to be prefixed with `file://` on Windows or an error is thrown. It also disables the config unit tests since a dynamic import inside of `jest` on either an m1 on macOS or Windows using node 14 causes a segfault from being used inside of `vm`. 

<details>

<summary>segfault error in jest</summary>

<img width="962" alt="Screen Shot 2021-10-15 at 16 45 04" src="https://user-images.githubusercontent.com/22380829/137596819-072233e3-1a45-445f-a3dd-c03ec62fb4ce.png">

</details>


<details>

<summary>Windows absolute import error</summary>


<img width="1114" alt="Screen Shot 2021-10-16 at 12 45 59" src="https://user-images.githubusercontent.com/22380829/137597185-200f3164-7f79-488f-acc9-6c812ce5bc4a.png">

</details>
2021-10-16 19:30:00 +00:00
Tim Neutkens
701fa9993f v11.1.3-canary.77 2021-10-16 14:26:21 +02:00
Tim Neutkens
7e370134fb
Use import() to load next.config.js (#29935)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com>
2021-10-16 14:22:42 +02:00
Steven
80e5180e05
Update webpack target to node12.22 (#29953)
Follow up to #29949
2021-10-15 22:33:44 +00:00
Steven
fdb2cc80b1
Bump "engines" to node >= 12.22.0 (#29949)
Older versions of Node.js don't have a stable ESM implementation

https://nodejs.org/api/esm.html#esm_modules_ecmascript_modules
2021-10-15 20:55:14 +00:00
Tim Neutkens
73a3a957db v11.1.3-canary.76 2021-10-15 22:13:13 +02:00
Tim Neutkens
cf9eb36e7c Remove unused SWC option 2021-10-15 22:10:18 +02:00
mohamed bel haj youssef
9cf0809b77
Fix Log Typo (#29937) 2021-10-15 13:07:24 -04:00
Tim Neutkens
00431087d7 v11.1.3-canary.75 2021-10-15 17:26:16 +02:00
Donny/강동윤
e844582400
Upate swc to allow line comments in css (#29943)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-10-15 17:25:31 +02:00
Tim Neutkens
32029ef5e9 v11.1.3-canary.74 2021-10-15 12:45:39 +02:00
Tim Neutkens
e7aa36f133 v11.1.3-canary.73 2021-10-15 12:10:26 +02:00
Tim Neutkens
b24036b7e0 v11.1.3-canary.72 2021-10-15 12:09:30 +02:00
Donny/강동윤
9375c7fe52
Update swc (#29938)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-15 11:39:09 +02:00
Tim Neutkens
bd53816aff v11.1.3-canary.71 2021-10-15 09:17:45 +02:00
JJ Kasper
75748caf7f
Migrate server-sent events HMR connection to WebSocket (#29903)
This replaces the server-sent events HMR connection with a WebSocket connection to prevent hitting browser connection limits, allow sending events back from the browser, and overall better performance. 

This approach sets up the the `upgrade` event listener on the server immediately when created via `next dev` and on the first request using `req.socket.server` when created via a custom server. In a follow-up PR we can push the files changed via the WebSocket as well. 

x-ref: https://github.com/vercel/next.js/issues/10061
x-ref: https://github.com/vercel/next.js/issues/8064
x-ref: https://github.com/vercel/next.js/issues/4495

## 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-15 07:09:54 +00:00
Denis Homolík
ea0cdc5a36
Add revalidate to the GetStaticPropsResult (#29919)
Fixes #28687

According to the answer in #28687, `GetStaticPropsResult` should allow specifying `revalidate` next to the `notFound: true`. Right now it's missing in the types def and allows to return any type. Also this may lead to confusion, that `revalidate` can't be used with the `notFound: true`

Example:
```ts
export const getStaticProps: GetStaticProps = async ({ locale }) => {
  const data = await fetchData();

  if (!data) {
    return {
      notFound: true,
      revalidate: new Date() // ts doesn't know the revalidate field and allows this
    };
  }

  return {
    props: { data },
    revalidate: new Date() // ts know the revalidate field, so it doesn't allow this
  };
};
```

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

- [x] Make sure the linting passes
2021-10-15 02:14:25 +00:00
Tim Neutkens
fd5522d923 v11.1.3-canary.70 2021-10-14 20:15:19 +02:00
Donny/강동윤
e45d1381e5
Update swc (#29913)
## 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-14 15:15:23 +00:00
jj@jjsweb.site
0d4d95f5c7
v11.1.3-canary.69 2021-10-14 09:38:52 -05:00
Tim Neutkens
40cf931338
Remove unused options from swc-loader (#29907)
Since this is not a swcrc option and will be removed in the future it's best to prune it from next-swc already.

## 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-14 08:50:55 +00:00
JJ Kasper
6f3c338745
Update to latest @vercel/nft (#29902)
This updates to the latest version of `@vercel/nft` which includes better shared caching between runs. 

x-ref: https://github.com/vercel/nft/pull/239
x-ref: https://github.com/vercel/nft/pull/238
x-ref: https://github.com/vercel/nft/pull/237
2021-10-14 06:12:33 +00:00
Kara
5760ceac86
Refactor Document to prep for classic streaming (#29834)
This refactor is the first of a few changes to support "classic" (two-part)
streaming. This one should be a noop that doesn't actually change the behavior.
It re-organizes the way that functions are wrapped in Document Head/NextScript
so anything that will be part of the second flush can be separated out from the
first flush. It also adds the structure for a useMaybeDeferContent hook, but
currently always assumes that nothing should be deferred.

The next PRs will actually implement streaming.
2021-10-13 17:07:18 -05:00
Tim Neutkens
d62253406b
Enable esmExternals by default (#29878)
## 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-13 21:11:52 +00:00
Tim Neutkens
d1d7a951d5 v11.1.3-canary.68 2021-10-13 18:56:20 +02:00
Donny/강동윤
bf9e998ae3
Update swc & Improve CI time (#29884)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-13 18:55:35 +02:00
Tobias Koppers
f530b0d312
only listen to drain even once (#29885)
gets rid of `(node:670) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit`
2021-10-13 16:29:52 +00:00
Tim Neutkens
a002f612c3
Add experimental option to enable fullySpecified (#29880) 2021-10-13 17:23:50 +02:00
Tobias Koppers
ecd31ab62f
update webpack (#29870) 2021-10-13 17:21:15 +02:00
Tim Neutkens
9cf49ddf43 v11.1.3-canary.67 2021-10-13 16:27:51 +02:00
Donny/강동윤
b99cfb8cfa
Update swc (#29881)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-13 16:24:31 +02:00
Tim Neutkens
96c2980c77 v11.1.3-canary.66 2021-10-13 13:49:49 +02:00
Donny/강동윤
c3971010f5
Update swc (#29866)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-13 13:45:38 +02:00
Jan Nicklas
31a701b9da
feat(jsconfig-paths-plugin): Resolve paths synchronously (#29467) 2021-10-13 12:17:54 +02:00
Genet Schneider
e40785e1e2
Avoid TypeError when comparing path param (#29821)
## Bug

Fixes a TypeError when accessing url with no path params `_next/data/<BUILD_ID>`
```
TypeError: Cannot read property 'endsWith' of undefined
  at Object.fn (/app/node_modules/next/server/next-server.ts:644:52)
  at Router.execute (/app/node_modules/next/server/router.ts:346:40)
  at Server.run (/app/node_modules/next/server/next-server.ts:1229:41)
  at Server.handleRequest (/app/node_modules/next/server/next-server.ts:489:25)
  at /app/node_modules/next/server/next.ts:47:14
```

- [ ] 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

- [x] Make sure the linting passes
2021-10-13 04:56:38 +00:00
Steven
bda4ca6ef3 v11.1.3-canary.65 2021-10-12 13:50:38 -04:00
Donny/강동윤
7b3cce3f94
Update swc (#29843)
Co-authored-by: kdy1 <kdy1@users.noreply.github.com>
2021-10-12 16:43:45 +02:00
Steven
cc1f3b8a38
Add support for AVIF to next/image (#29683)
Add support for AVIF to `next/image`

- Fixes #27882 
- Closes #27432 

## Feature

- [x] Implements an existing feature request
- [x] Related issues linked
- [x] Integration tests added
- [x] Documentation added
- [x] Update manifest output
- [x] Warn when `sharp` is outdated
- [x] Errors & Warnings have helpful link attached
- [ ] Remove `image-size` in favor of `squoosh`/`sharp` (optional, need to benchmark)
2021-10-11 23:17:47 +00:00
Keen Yee Liau
13f68debfe
Collect feature usage for optimizeCss (#29828)
`optimizeCss` is a feature that inlines critical CSS using critters.
The Aurora team would like to gauge adoption rate for this feature.



## 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
- [x] 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-10-11 21:15:18 +00:00
Tim Neutkens
e61068bff6 v11.1.3-canary.64 2021-10-11 20:47:06 +02:00
Tobias Koppers
e679f5b7d1
allow to reload disposed client pages (#29815) 2021-10-11 20:36:01 +02:00
Tobias Koppers
a773e6fc77
handle new hmr connection as heartbeat signal (#29818)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-11 19:49:32 +02:00
Tobias Koppers
7a38bbb4d9
add summary logging option (#29814) 2021-10-11 19:31:12 +02:00
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