Commit graph

84 commits

Author SHA1 Message Date
Tobias Koppers
446b172780
update turbopack (#52899)
* https://github.com/vercel/turbo/pull/5563
2023-07-19 18:17:57 +00:00
Tobias Koppers
0aeda3aedc
Turbopack: ensure output assets reference only output assets (#52832)
### What?

refactoring see https://github.com/vercel/turbo/pull/5557

### Turbopack Changes

* https://github.com/vercel/turbo/pull/5506 <!-- Leah -
feat(turbopack-ecmascript): implement acyclic SCC graph for ESM imports
-->
* https://github.com/vercel/turbo/pull/5557 <!-- Tobias Koppers - Ensure
output assets reference only output assets -->
2023-07-18 21:54:38 +02:00
Tobias Koppers
3f1b9178cc
Turbopack: move references() to specific traits (#52822)
### What?

refactoring

see https://github.com/vercel/turbo/pull/5555

### Turbopack Changes

* https://github.com/vercel/turbo/pull/5544 <!-- Tobias Koppers - add
direct cycle detection -->
* https://github.com/vercel/turbo/pull/5547 <!-- Alex Kirszenberg - Add
missing feature to syn -->
* https://github.com/vercel/turbo/pull/5555 <!-- Tobias Koppers - move
references() to specific traits -->
2023-07-18 15:32:00 +02:00
Tobias Koppers
80572b373f
Turbopack: move Asset::ident to more specific traits (#52683)
### What?

see https://github.com/vercel/turbo/pull/5528

### Turbopack Changes
2023-07-17 17:07:05 +00:00
Alex Kirszenberg
dd56a77e91
Turbopack: Experimental dev app pages support (#52680)
This implements app pages and routes for the Nexturbo API.

## Turbopack updates

* https://github.com/vercel/turbo/pull/5527 <!-- Alex Kirszenberg -
AdjacencyMap::reverse_topological (+ fixes) -->
2023-07-17 18:03:14 +02:00
Alex Kirszenberg
5964b289e1
Turbopack: Vc<T> and Turbo Engine type system improvements (#51792)
This is the Next.js side of https://github.com/vercel/turbo/pull/4587, which makes changes to Turbo Engine to allow expressing value cells as `Vc<Type>` instead of `TypeVc`, leveraging the type system to bring a slew of other improvements to writing Turbo Engine code.

## Turbopack updates

* https://github.com/vercel/turbo/pull/4587
2023-07-16 13:56:20 +00:00
Tobias Koppers
ca1129c463
Turobpack: Next.rs API (part 1) (#52259)
### What?

Creates a NAPI api for Next.rs to be used in Next.js

### Why?

### How?



Co-authored-by: Alex Kirszenberg <1621758+alexkirsz@users.noreply.github.com>
2023-07-13 17:17:38 +00:00
Tobias Koppers
ee28f947fb
Turbopack: OutputAsset trait (#52606)
### What?

refactoring for cleaner typing of assets

see https://github.com/vercel/turbo/pull/5507
2023-07-13 13:26:15 +00:00
Alex Kirszenberg
38dafa1609
Turbopack: App Router build POC (#52036)
This PR adds proof-of-concept support for the App Router to `next build
--experimental-turbo`.

It introduces a new way to generate Next.js manifests in Turbopack.
Currently, in dev, we pass proxy objects in lieu of manifests, and rely
on the entries to know which chunks they need loaded on the client.
However, this can't work for builds because it requires control over
Next.js rendering, which is not compatible with a Next->Turbo approach.
We would need to modify Next.js to support these "lazy" entries. So for
now, we add well-known assets (`NextDynamicAsset`,
`NextServerComponentAsset`, `NextClientReferenceAsset`, etc.) to the
graph, which will get picked up when walking it during asset processing.
This lets us collect all possible entries before chunking.

This two-step process (collecting all entries, then chunking them) is
also a good first step towards production chunking.

## Turbopack updates

* https://github.com/vercel/turbo/pull/5494 <!-- Tobias Koppers - add
reporting of console messages -->
* https://github.com/vercel/turbo/pull/5448 <!-- Alex Kirszenberg -
Misc. changes to support App Router build -->
2023-07-12 11:26:48 +02:00
Tobias Koppers
56fcd7ac33
Turbopack: Source trait (#52511)
### What?

refactoring see https://github.com/vercel/turbo/pull/5483

### Turbopack Changes

* https://github.com/vercel/turbo/pull/5483 <!-- Tobias Koppers - Source
trait -->
2023-07-11 12:34:32 +02:00
Tobias Koppers
8643014b13
turbopack: Module Trait (#52401)
### What?

refactoring see https://github.com/vercel/turbo/pull/5477

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-07-10 14:35:53 +02:00
Alex Kirszenberg
b8589dfdb0
Update Rust nightly toolchain (#51757)
Matching turbo PR: https://github.com/vercel/turbo/pull/5376

## Turbopack updates

* https://github.com/vercel/turbo/pull/5376 <!-- Alex Kirszenberg -
Update nightly toolchain -->
2023-07-07 18:17:07 -04:00
Donny/강동윤
d11aafb740
Update swc_core to v0.79.13 (#52371)
### What?

Update SWC crates to `v0.79.13`.

### Why?

 - Explicit resource management proposal is now fully implemented, although it's behind a parser flag because it's stage 3
 - Some bugs of `swcMinify` are fixed.

### How?

Closes WEB-1272

## Turbopack updates

* https://github.com/vercel/turbo/pull/5475 


Co-authored-by: Alex Kirszenberg <1621758+alexkirsz@users.noreply.github.com>
2023-07-07 19:37:05 +00:00
Alex Kirszenberg
ec19537127
Named page chunks (#51921)
Depends on https://github.com/vercel/turbo/pull/5398 (and downstack) on
the Turbo side.

This PR makes it so the output path of Node.js entry chunks for pages is
determined solely from the pathname. This isn't actually necessary for
pages, but it makes for easier debugging anyway. See the Turbo PR for
more details.

This also changes the page structure so it also works if there is no
`pages` directory. In this case, we still want to use pages' default
_app, _document, and _error pages, even with existing app routes. So an
empty page structure should still have an effect.

## Turbopack updates

* https://github.com/vercel/turbo/pull/5415 <!-- Will Binns-Smith -
Turbopack: Execution tests in node.js -->
* https://github.com/vercel/turbo/pull/5461 <!-- Tobias Koppers - use a
lock to ensure atomic invalidation from file changes -->
* https://github.com/vercel/turbo/pull/5398 <!-- Alex Kirszenberg -
Configure the path of the Node.js entry chunk -->
* https://github.com/vercel/turbo/pull/5469 <!-- Tobias Koppers - allow
hmr tests to correctly detect hmr event -->
2023-07-06 16:31:22 +02:00
Alex Kirszenberg
3406e13ab0
Update Turbopack (#52198)
## Turbopack updates

* https://github.com/vercel/turbo/pull/5457 
* https://github.com/vercel/turbo/pull/5458
2023-07-04 15:56:09 +00:00
Alex Kirszenberg
13cfc2bf4d
Update CustomModuleType import (#52133)
https://github.com/vercel/turbo/pull/5397

## Turbopack updates

* https://github.com/vercel/turbo/pull/5419 
* https://github.com/vercel/turbo/pull/5397
2023-07-04 12:39:41 +00:00
Tobias Koppers
532f779782
update turbopack (#52186)
* https://github.com/vercel/turbo/pull/5395 
* https://github.com/vercel/turbo/pull/5452
2023-07-04 11:54:40 +00:00
Jiachi Liu
cd9372c175
Reland "ReverseTopological -> AdjacencyMap"" (#52142)
Reverts vercel/next.js#52139
2023-07-03 19:13:50 +00:00
Jiachi Liu
4b4731dfbe
Revert "ReverseTopological -> AdjacencyMap" (#52139)
Reverts vercel/next.js#52032

Will reland after the release
2023-07-03 16:33:24 +00:00
Alex Kirszenberg
f6a152287a
ReverseTopological -> AdjacencyMap (#52032)
See https://github.com/vercel/turbo/pull/5430

## Turbopack changes

* https://github.com/vercel/turbo/pull/5430 <!-- Alex Kirszenberg -
ReverseTopological -> AdjacencyMap -->
2023-07-03 14:40:41 +02:00
Alex Kirszenberg
805bfa45e0
Remove EnvironmentIntention (#51965)
See https://github.com/vercel/turbo/pull/5420

# Turbopack changes

* https://github.com/vercel/turbo/pull/5420 
* https://github.com/vercel/turbo/pull/5387
2023-07-03 09:03:37 +00:00
Tobias Koppers
d443778163
Refactor ContentSources to RouteTree (#51660)
### What?

This fixes a performance problem when many pages are involved.

fixes WEB-1067

see also https://github.com/vercel/turbo/pull/5360

### Turbopack Changes

* https://github.com/vercel/turbo/pull/5416 
* https://github.com/vercel/turbo/pull/5360
2023-06-30 16:03:24 +00:00
Leah
484bdebc24
Update turbopack and swc_core to v0.78.24 (#51943)
Reverts #51940

### What?

Update SWC crates and turbopack

### Turbopack Updates

* https://github.com/vercel/turbo/pull/5366 <!-- Justin Ridgewell - Fix
bug with `imports` field from a nested directory -->
* https://github.com/vercel/turbo/pull/5361 <!-- Tobias Koppers - update
for next.js changes to env vars -->
* https://github.com/vercel/turbo/pull/5311 <!-- OJ Kwon -
test(filetrace): skip failing tests -->
* https://github.com/vercel/turbo/pull/5402 <!-- Leah - reduce indent in
`analyze_ecmascript_module` by splitting the function up -->
* https://github.com/vercel/turbo/pull/5412 <!-- Leah - Update
`swc_core` to `v0.78.24` -->

Closes WEB-1174

Turbopack counterpart: https://github.com/vercel/turbo/pull/5412

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-06-29 15:11:57 +02:00
Leah
fd13fb5e64
Revert "Update swc_core to v0.78.24" (#51940)
Reverts vercel/next.js#51857

Because a turbopack update with the matching swc versions wasn't
included, this would increase the binary size
2023-06-28 19:35:04 +02:00
Donny/강동윤
e05c8c2d7e
Update swc_core to v0.78.24 (#51857)
### What?

Update SWC crates

### Why?

There were many fixes.

### How?

Closes WEB-1174


Turbopack counterpart: https://github.com/vercel/turbo/pull/5288
2023-06-28 16:04:35 +00:00
JJ Kasper
d457e989ff
Revert "Update swc_core to v0.78.15" (#51716)
Reverts vercel/next.js#51269

This is breaking some builds it looks like

x-ref: https://github.com/vercel/next.js/actions/runs/5357843108/jobs/9719367732
x-ref: https://github.com/vercel/next.js/actions/runs/5357843108/jobs/9719368519
2023-06-23 17:12:47 +00:00
Donny/강동윤
5f3d7c43ea
Update swc_core to v0.78.15 (#51269)
### What?

Update SWC crates to 8b765e6763

### Why?

There were many patches.

### How?

Closes WEB-1174

Turbopack counterpart: https://github.com/vercel/turbo/pull/5288
2023-06-23 11:40:11 +00:00
Tobias Koppers
5abeb99b49
add edge rendering for app dir for Turbopack (#51666)
relanding #50830 and #51631 

### Turbopack Changes

* https://github.com/vercel/turbo/pull/5254 <!-- OJ Kwon - ci(workflow):
upload daily next.js test trace -->
* https://github.com/vercel/turbo/pull/5363 <!-- Tobias Koppers -
disable default features for turbopack-ecmascript-plugins -->
2023-06-23 07:08:17 +02:00
JJ Kasper
d0e7d04dc5
Revert "add edge rendering for app dir for Turbopack" (#51659)
Reverts vercel/next.js#51631

This breaks the windows builds

x-ref:
https://github.com/vercel/next.js/actions/runs/5344032749/jobs/9687974376
x-ref:
https://github.com/vercel/next.js/actions/runs/5344032749/jobs/9687973522
2023-06-22 08:49:50 -07:00
Tobias Koppers
aa7fdc67b9
fix lockfile (#51650)
concurrent merges...
2023-06-22 13:12:14 +00:00
Tobias Koppers
99ec3057d7
add edge rendering for app dir for Turbopack (#51631)
## What

* reland #50830 
* remove Object.hasOwn
* fix CSS chunks in edge runtime

## Turbopack Changes

* https://github.com/vercel/turbo/pull/5253 <!-- OJ Kwon -
fix(turbopack): enable runtime flag -->
* https://github.com/vercel/turbo/pull/5295 <!-- Will Binns-Smith -
remove `__internal_nextjs_integration_test` compile-time feature -->
* https://github.com/vercel/turbo/pull/4362 <!-- Donny/강동윤 - Make build
faster -->
* https://github.com/vercel/turbo/pull/5352 <!-- Tobias Koppers - only
wait for JS chunks in none runtime backend -->
2023-06-22 11:43:59 +02:00
Alex Kirszenberg
c6313606c9
Next Build Turbo POC (2) (#51546)
Another attempt at getting https://github.com/vercel/next.js/pull/49942 in.

This time, the mold install step is gated to Linux.
2023-06-22 08:03:44 +00:00
JJ Kasper
41ce805de5
Revert "Next Build Turbo POC (#49942)" (#51538)
This reverts commit 7d0bdab83e.

This is failing all builds blocking releases so this reverts it for now
to allow further investigation async.
2023-06-19 21:54:04 -07:00
Alex Kirszenberg
7d0bdab83e
Next Build Turbo POC (#49942)
This contains the original POC for `next build --turbo`. The implementation is _just enough_ to get pages building, and doesn't support the app router yet.

I'll write more details here on the implementation and what the next steps are next week.

Necessary changes on the Turbo side: https://github.com/vercel/turbo/pull/4998
2023-06-19 14:36:05 +00:00
Tobias Koppers
a806f1ad84
Update turbopack (#51336)
### What?

update Turbopack and sync dependencies with turbo

### Turbopack changes

* https://github.com/vercel/turbo/pull/5303
2023-06-15 09:39:17 +00:00
Tobias Koppers
6b0a6f0c25
add turbopack integration tests to CI (#50904)
### What?

* enable turbopack tests in new CI
* split pre-build step into native and JS builds to allow to start
native tests faster
* update swc_core to sync with turbo
* update turbopack

### Why?

Running our test suite is still important as long we don't have the full
integration test suite enabled.

### Turbopack updates

* https://github.com/vercel/turbo/pull/5215 <!-- OJ Kwon - ci(workflow):
upload benchmark results to datadog -->
* https://github.com/vercel/turbo/pull/5239 <!-- OJ Kwon -
fix(swc_plugin): use shared runtime -->
* https://github.com/vercel/turbo/pull/3090 <!-- CHEN Yuan - Docs: prior
to run testcases, add guides to install dependencies for testcases. -->
* https://github.com/vercel/turbo/pull/5264 <!-- Tobias Koppers - update
test runner -->

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-12 07:47:43 -07:00
JJ Kasper
22ea7d9909
Revert "Revert "update turbopack"" (#50947)
Fixed in https://github.com/vercel/next.js/pull/50946

Reverts vercel/next.js#50942
2023-06-08 04:02:03 +00:00
JJ Kasper
2a62513ecd
Revert "update turbopack" (#50942)
The builds are failing 

x-ref:
https://github.com/vercel/next.js/actions/runs/5206362546/jobs/9392872573
x-ref:
https://github.com/vercel/next.js/actions/runs/5206362546/jobs/9392873009
x-ref:
https://github.com/vercel/next.js/actions/runs/5206362546/jobs/9392873120

Reverts vercel/next.js#50819
2023-06-07 19:02:29 -07:00
Leah
0d46361f8e
update turbopack (#50819)
### Turbopack Updates
* https://github.com/vercel/turbo/pull/5156 
* https://github.com/vercel/turbo/pull/5159 
* https://github.com/vercel/turbo/pull/5162 
* https://github.com/vercel/turbo/pull/5161 

* https://github.com/vercel/turbo/pull/5174 
* https://github.com/vercel/turbo/pull/5178 
* https://github.com/vercel/turbo/pull/5121 
* https://github.com/vercel/turbo/pull/5200 
* https://github.com/vercel/turbo/pull/5207 
* https://github.com/vercel/turbo/pull/5211 
* https://github.com/vercel/turbo/pull/5210 
* https://github.com/vercel/turbo/pull/5221 
* https://github.com/vercel/turbo/pull/5218 
* https://github.com/vercel/turbo/pull/5226 
* https://github.com/vercel/turbo/pull/5139 
* https://github.com/vercel/turbo/pull/5227 
* https://github.com/vercel/turbo/pull/5189
2023-06-08 01:23:14 +00:00
Justin Ridgewell
1a2fac2b5a
[turbopack]: Use tip-of-branch for benchmarks (#50615)
With vercel/turbo#5156, we'll be able to install our the locally built `next` package. Before, we'd test the tip-of-branch `next-dev` binary against the last cut `next` canary, which causes headaches when we make breaking changes.

With this PR, we'll now test tip-of-branch `next-dev` binary against a tip-of-branch `next` package, and breaking changes can be properly benched.

Fixes WEB-1133
2023-06-06 20:36:11 +00:00
Leah
eb85e79941
fix @vercel/turbopack-node types (and more turbopack updates) (#50605)
for #50557 

## Turbopack Updates

* https://github.com/vercel/turbo/pull/5131 <!-- Tobias Koppers - sync
dependencies with next.js -->
* https://github.com/vercel/turbo/pull/5138 <!-- Justin Ridgewell - Fix
`vdbg!` depth and JSON error messages -->
* https://github.com/vercel/turbo/pull/5141 <!-- Leah - fix
`@vercel/turbopack-node` types by adding reference to compiled package
-->
2023-06-01 15:27:13 +00:00
Tobias Koppers
0539b9c96e
update swc_core and turbopack (#50519)
## What

* updates swc_core
* updates turbopack

# Turbopack Changes

* https://github.com/vercel/turbo/pull/5050 
* https://github.com/vercel/turbo/pull/5107 
* https://github.com/vercel/turbo/pull/5094
2023-05-30 15:46:46 +00:00
Donny/강동윤
8dba9a7084
chore: Update swc_core to v0.76.37 (#50311)
### What?

This PR updates `swc_core` from
ed9d316833
to
ad8e6a006c

### Why?

The main goal is to reduce build time. I expect
https://github.com/swc-project/swc/pull/7442 to have a huge effect on
the build time.

### How?

Closes WEB-1107

---

Turbopack counterpart: https://github.com/vercel/turbo/pull/5094

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-05-30 14:58:19 +02:00
Tobias Koppers
fe6bb0ace9
Refactor internal modules (#50338)
### What?

create internal modules via `context.process` with
`ReferenceType::Internal`

### Why?

We need this for future refactoring where we want to the internal
modules with transitions.

### Turbopack Changes

* https://github.com/vercel/turbo/pull/5095 <!-- Tobias Koppers - allow
to create internal modules via AssetContext -->
* https://github.com/vercel/turbo/pull/5104 <!-- Alex Kirszenberg -
Stable chunk list ident -->
* https://github.com/vercel/turbo/pull/5106 <!-- Tobias Koppers -
followup fix -->

---------

Co-authored-by: Alex Kirszenberg <alex.kirszenberg@vercel.com>
2023-05-27 08:22:15 +02:00
Alex Kirszenberg
62af2007ce
Next.js Turbo build: turbopack-ecmascript-runtime and ChunkData (#50375)
This PR is extracted from https://github.com/vercel/next.js/pull/49942
and mostly contains changes necessary after the Turbopack PR adding the
Node.js production runtime https://github.com/vercel/turbo/pull/4998,
without any of the actual Next Build stuff, in order to be able to merge
both quickly.

* ChunkData moved from tp-dev to tp-core, the ES-serializable part moved
to tp-ecmascript;
* all runtime types moved to tp-ecmascript-runtime

This also upgrades Turbopack to turbopack-230526.2:

* https://github.com/vercel/turbo/pull/5102 <!-- Donny/강동윤 - refactor:
Fix binary bloat caused by `ValueDebugFormat` impl -->
* https://github.com/vercel/turbo/pull/4998 <!-- Alex Kirszenberg -
Node.js production runtime POC -->
2023-05-26 13:38:25 +02:00
Donny/강동윤
fcfd63065b
feat(next-swc): Add CJS optimizer again (#50249)
### What?

This reverts commit 6ebc725fe6 / #50247.

### Why?

#49972 is reverted due to bugs, and I'm retrying it.

### How?

Closes WEB-1072
Closes WEB-1097
Closes NEXT-1156 (as it's reopened by the revert PR)

fix #48469

---------

Co-authored-by: Shu Ding <g@shud.in>
2023-05-24 09:38:31 +02:00
JJ Kasper
6ebc725fe6
Revert "feat(next-swc): Implement CJS optimizer" (#50247)
This seems to be failing with the WASM builds so this reverts to allow
further investigation

x-ref:
https://github.com/vercel/next.js/actions/runs/5062818601/jobs/9088828339
x-ref:
https://github.com/vercel/next.js/actions/runs/5061364458/jobs/9085596546
x-ref:
https://github.com/vercel/next.js/actions/runs/5062868910/jobs/9092170727

Reverts vercel/next.js#49972
2023-05-23 21:45:37 -07:00
Donny/강동윤
ec8bf53907
feat(next-swc): Implement CJS optimizer (#49972)
### What?


Implement a CJS optimizer for next-swc


### Why?

x-ref: https://vercel.slack.com/archives/C02HY34AKME/p1684341093462309

Assuming most CJS files are transpiled from ESM, we can mimic
tree-shaking using an AST transform.

### How?

Closes WEB-1072
Fixes #48469


fix NEXT-1156

---------

Co-authored-by: Shu Ding <g@shud.in>
2023-05-23 21:38:07 +02:00
Tobias Koppers
33b8e6157f
change static path to /_next/static/media (#50207)
### What?

align output path of turbopack and webpack

### Why?

passing test cases

### Turbopack Changes

* https://github.com/vercel/turbo/pull/5072 <!-- Tobias Koppers -
improve asset path -->
2023-05-23 18:39:27 +02:00
Tobias Koppers
3d40cb01ab
refactor webpack loaders (#49535)
### What?

* allow to apply existing pipeline
* change webpack loader key to glob for more flexibility
* add test cases
* add special error message when using the old config syntax

Old config:

```js
experimental: {
 turbo: {
  loaders: {
   ".mdx": ["mdx-loader"]
  }
 }
}
```

New config

``` js
experimental: {
 turbo: {
  rules: {
   // key is a glob now
   // normal syntax will treat the result as ecmascript code
   "*.mdx": ["mdx-loader"],
   // glob allows more advanced matching
   "./images/**/*.png": {
    loaders: ["image-optimize-loader"],
    // result of loader will be handled in other steps
    // under the same name/path (here .png)
    // This will use the existing .png pipeline (static asset)
    // It might also use other rules matching .png.
    as: "*"
   },
   "*.generate-image.js": {
    loaders: ["image-generation-loader"],
    // It also possible to pass this under a different name
    // into the pipeline. Here it will treat the result as png image
    as: "*.png"
   }
  }
 }
}
```

### Why?

More flexibility and allowing to use the builtin module handling over
non-js types.

fixes WEB-1009

### Turbopack changes

* https://github.com/vercel/turbo/pull/4955 <!-- OJ Kwon -
refactor(turbopack-ecmascript): deprecate enable_emotion, enable_styled*
-->
* https://github.com/vercel/turbo/pull/4880 <!-- Tobias Koppers -
refactor webpack loader execution -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-23 17:21:25 +02:00