Commit graph

132 commits

Author SHA1 Message Date
Donny/강동윤
4b3dfdaa95
build: Update swc_core to v0.86.1 (#56770)
### What?

Update SWC crates, to apply bugfixes.

### Why?

We adjusted the mangling option to make it identical with `swcMinify:
false` with https://github.com/vercel/next.js/pull/56281, and it
revealed some bugs of the name mangler of the SWC minifier.

### How?


 - Fixes #56550
 - Fixes #56614

 - Turbopack counterpart: https://github.com/vercel/turbo/pull/6171

### Other Turbopack Changes

* https://github.com/vercel/turbo/pull/6177 <!-- Tim Neutkens - Add
support for FreeVarReference::Error -->
* https://github.com/vercel/turbo/pull/6180 <!-- Tobias Koppers - fix
chunk loading in build runtime -->
* https://github.com/vercel/turbo/pull/6191 <!-- Justin Ridgewell -
Deduplicate referenced_output_assets -->
* https://github.com/vercel/turbo/pull/6171 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.86.1` -->

Closes WEB-1775

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-10-17 15:19:28 +02:00
Tobias Koppers
a40a350155
Chunking Refactoring followup fixes (#56789)
### What?

fix some minor bugs
Make the page-loader reuse the client chunks

Closes WEB-1777
2023-10-13 12:38:59 +00:00
Tobias Koppers
04bad16bf4
Turbopack: Chunking Refactoring (#56756)
### What?

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

### Turbopack Changes

* https://github.com/vercel/turbo/pull/6116 
* https://github.com/vercel/turbo/pull/6140 
* https://github.com/vercel/turbo/pull/6118 
* https://github.com/vercel/turbo/pull/6128 
* https://github.com/vercel/turbo/pull/6129 
* https://github.com/vercel/turbo/pull/6160 


Closes WEB-1772

Co-authored-by: Justin Ridgewell <112982+jridgewell@users.noreply.github.com>
2023-10-13 11:44:44 +00:00
Justin Ridgewell
c6f5089ef2
turbopack: Extract as_chunk into shared ChunkType trait (#56506)
### What?

Step 3 in our chunking refactors extracts ChunkItem::as_chunk into a new ChunkType trait. This new trait isn't useful yet, but will eventually allow us to collect ChunkItems of a similar type into a lists, and perform chunking over all similar items at once.

### Why?

In the end we want to avoid creating chunks from modules directly, but enforce everything going through the ChunkingContext to be chunked. This allows us to replace the existing chunking algorithm with a much more efficient one that avoid duplication between chunks in first place and doesn't require a post-chunking optimization.

### How?

https://github.com/vercel/turbo/pull/6123

Re: https://github.com/vercel/next.js/pull/56504

Closes WEB-1724

Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
2023-10-06 15:28:57 +00:00
Tobias Koppers
c95e4b7841
update turbopack, fix sass peer dependency (#56508)
* https://github.com/vercel/turbo/pull/6076 <!-- Tobias Koppers -
Performance Improvements (5) !-->

Closes WEB-1725
2023-10-06 10:59:43 +02:00
Justin Ridgewell
2af1e784c2
turbopack: Chunking Refactor Step 2 (#56504)
### What?

The second step in our chunking refactoring, this removes our use of Module::as_chunk and Module::as_root_chunk. Instead, the only way to generate a chunk is directly from a root ChunkItem.

### Why?

In the end we want to avoid creating chunks from modules directly, but enforce everything going through the ChunkingContext to be chunked. This allows us to replace the existing chunking algorithm with a much more efficient one that avoid duplication between chunks in first place and doesn't require a post-chunking optimization.

### How?

https://github.com/vercel/turbo/pull/6120

Re: https://github.com/vercel/next.js/pull/56467
Closes WEB-1721

Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
2023-10-06 06:29:14 +00:00
Tobias Koppers
666ce7bd8b
Chunking Refactor Step 1 (#56467)
### What?

This change moves a few methods around.

Module::as_chunk is moved to ChunkItem::as_chunk as temporary intermediate state.
EcmascriptPlaceable::as_chunk_item is moved to ChunkableModule::as_chunk_item. This generalizes the concept of converting a Module into a ChunkItem


### Why?

This is the first step of refactoring the chunking. In the end we want to avoid creating chunks from modules directly, but enforce everything going through the ChunkingContext to be chunked. This allows us to replace the existing chunking algorithm with a much more efficient one that avoid duplication between chunks in first place and doesn't require a post-chunking optimization.

### How?

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

Closes WEB-1715

Co-authored-by: Justin Ridgewell <112982+jridgewell@users.noreply.github.com>
2023-10-05 20:05:05 +00:00
Justin Ridgewell
feca3ce21c
Turbopack: Implement Server Actions (#53890)
### What?

This implements Server Actions inside the new Turbopack next-api bundles.

### How?

Server Actions requires:
1. A `.next/server/server-reference-manifest.json` manifest describing what loader module to import to invoke a server action
2. A "loader" entry point that then imports server actions from our internal chunk items
3. Importing the bundled `react-experimental` module instead of regular `react`
4. A little 🪄 pixie dust
5. A small change in the magic comment generated in modules that export server actions

I had to change the magic `__next_internal_action_entry_do_not_use__` comment generated by the server actions transformer. When I traverse the module graph to find all exported actions _after chunking_ has been performed, we no longer have access to the original file name needed to generate the server action's id hash. Adding the filename to comment allows me to recover this without overcomplicating our output pipeline.

Closes WEB-1279
Depends on https://github.com/vercel/turbo/pull/5705

Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2023-10-04 23:33:21 +00:00
Tobias Koppers
e043e1f1c6
update turbopack (#56285)
* https://github.com/vercel/turbo/pull/6062 
* https://github.com/vercel/turbo/pull/6061 
* https://github.com/vercel/turbo/pull/6045 

Closes WEB-1695
2023-10-02 07:38:44 +00:00
Donny/강동윤
bf35b47bb4
Update swc_core to v0.83.28 (#56134)
### What?

 - Use better implementation for `react-remove-properties` and `remove-conosle`.

### Why?


I concluded `react-remove-properties` and `remove-conosle` deserve official plugins, so I promoted them.

 - https://github.com/swc-project/plugins/pull/213
 - https://github.com/swc-project/plugins/pull/215


### How?



 - Closes WEB-1638
 - Closes WEB-1633
 - Closes NEXT-1657
 - Closes #55679

---

# Turbopack changes


* https://github.com/vercel/turbo/pull/6003
2023-09-29 13:08:26 +00:00
Tobias Koppers
d75110529b
update turbopack (#56197)
* https://github.com/vercel/turbo/pull/6051 <!-- Tobias Koppers -
Performance Improvements (1) -->
* https://github.com/vercel/turbo/pull/6053 <!-- Tobias Koppers -
Performance Improvements (2) -->
* https://github.com/vercel/turbo/pull/6055 <!-- Tobias Koppers -
Performance Improvements (4) -->

Closes WEB-1684
2023-09-29 10:59:01 +02:00
Will Binns-Smith
741114adea
Turbopack: add support for an assetPrefix and basePath (#56058)
Depends on vercel/turbo#6036

This constructs a general asset prefix (depending on if basePath and/or assetPrefix is defined), and sets it on Next's and Turbopack's chunking context.

Test Plan: Use a `create-next-app` with corresponding Next.js PR and basePath and assetPrefix specified.

Tested:
- Browser (async) chunk loading
- Static asset loading on server and browser

Closes WEB-1666
2023-09-29 01:43:29 +00:00
Tobias Koppers
cd70065bad
Fixes performance problems due to TaskScopes (#55721)
### What?

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

### Turobopack changes

* https://github.com/vercel/turbo/pull/6009 <!-- OJ Kwon - ci(workflow):
update test filter -->
* https://github.com/vercel/turbo/pull/6026 <!-- Will Binns-Smith -
Remove next-dev references and benchmarks -->
* https://github.com/vercel/turbo/pull/6038 <!-- Tim Neutkens - Remove
test-prod action -->
* https://github.com/vercel/turbo/pull/6039 <!-- Tim Neutkens - Fix
action dependency -->
* ~https://github.com/vercel/turbo/pull/6036~ <!-- Will Binns-Smith -
Turbopack: add support for an asset prefix (and basePath in Next.js) -->
* https://github.com/vercel/turbo/pull/5992 <!-- Tobias Koppers -
refactor TaskScopes to use an aggregation tree -->


Closes WEB-1622
2023-09-28 09:40:21 +02:00
Tobias Koppers
a751bbf642
Revert "Update swc_core to v0.83.26" (#56077)
Reverts vercel/next.js#55780

This should not merge this a Cargo.toml pointing to a branch

@kdy1 

Closes WEB-1669
2023-09-27 11:55:00 +02:00
Donny/강동윤
81d2926e19
Update swc_core to v0.83.26 (#55780)
### What?

 - Use better implementation for `react-remove-properties` and `remove-conosle`.

### Why?


I concluded `react-remove-properties` and `remove-conosle` deserve official plugins, so I promoted them.

 - https://github.com/swc-project/plugins/pull/213
 - https://github.com/swc-project/plugins/pull/215


### How?



 - Closes WEB-1638
 - Closes WEB-1633
 - Closes NEXT-1657
 - Closes #55679
2023-09-27 09:47:57 +00:00
Will Binns-Smith
9ac463b218
Remove next-dev and its test suite and benchmarks (#55983)
We've rearchitected Next.js+Turbopack so Turbopack does not run
reimplement pieces of Next.js in its devserver. This:

- Removes the `next-dev` binary, which is no longer reachable through
`next --turbo`.
- Removes its test suite, as much of it is tested (and often more
thoroughly) by the Next.js test suite
- Removes its benchmark suite, which should be covered by
`Turbopack-bench` by
https://github.com/vercel/turbo/tree/main/crates/turbopack-bench

Test Plan: CI


Closes WEB-1652
2023-09-26 05:22:39 +02:00
Will Binns-Smith
816033a679
Update rust toolchain to nightly-2023-09-21 (#55774)
This:

- Updates to the latest api change for `StdError` in `error_generic_member_access` rust-lang/rust#99301
- Updates `pathfinder_simd` for compatiblity


Closes WEB-1636
2023-09-22 19:12:25 +00:00
Leah
7fa1618ef7
chore: update turbopack to turbopack-230922.2 (#55828) 2023-09-22 18:52:18 +02:00
OJ Kwon
a429e04fec
test(turbopack) migrate api tests, few image tests (#55552)
### What?

PR migrates next-dev's api tests to use next.js integration tests, as well as enabling few more image tests.

Closes WEB-1599
2023-09-19 20:14:53 +00:00
Tobias Koppers
eaa4d02ac9
update turbopack (#55515)
And sync deps so they don't conflict

* https://github.com/vercel/turbo/pull/5959 <!-- Tobias Koppers - reduce
number of task in async_module -->
* https://github.com/vercel/turbo/pull/5960 <!-- Tobias Koppers - reduce
unneccessary fs tasks -->
* https://github.com/vercel/turbo/pull/5955 <!-- Tobias Koppers -
bumping minor or major should reset patch/minor -->

Closes WEB-1592

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-09-18 11:48:36 +02:00
Donny/강동윤
ad79325a9f
Update swc_core to v0.83.12 (#55216)
### What?

I made `styled-jsx` configurable. It uses `swc_css` by default, and with
`useLigntningcss: true`, it uses it.

https://github.com/swc-project/plugins/pull/207

### Why?

### How?

Closes NEXT-
Fixes #



Closes WEB-1532
2023-09-15 17:41:05 +02:00
Justin Ridgewell
d2641bd072
Update turbopack (#55402)
* https://github.com/vercel/turbo/pull/5952 
* https://github.com/vercel/turbo/pull/5938 

Closes WEB-1566
2023-09-14 22:11:12 +00:00
Tobias Koppers
129f56d3e7
more turbopack HMR fixes and test case (#55368)
### What?

improve test case to check HMR
reenable deduplication for server side hmr events
add aggregation of client side HMR events

### Turbopack Changes

* https://github.com/vercel/turbo/pull/5936 <!-- Will Binns-Smith -
Update http mock and clap -->
* https://github.com/vercel/turbo/pull/5948 <!-- Tobias Koppers - CSS
HMR fixes -->



Closes WEB-1557

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-09-14 15:50:59 +02:00
Will Binns-Smith
8f30255922
Revert swc versions to one that doesn't use lightningcss (#55148)
Using lightningcss results in a breaking change to Next.js, so let's revert swc for now.


Closes WEB-1526
2023-09-08 20:02:51 +00:00
Leah
b5d752667a
feat(turbopack): add dynamic metadata support (#54995)
Closes NEXT-1435
Closes WEB-1435
2023-09-08 18:25:13 +00:00
Justin Ridgewell
2b9ffb009c
Update turbopack (#54909)
Minor update that includes changes necessary to get HMR errors working.

Closes WEB-1494
2023-09-02 10:45:49 +00:00
Donny/강동윤
a5c180388a
Update swc_core to v0.82.11 (#54653)
### What?

Update swc crates to
44de87f481

### Why?

To use `import with` and etc...

### How?

Closes WEB-1460
Fixes #

---

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

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-09-01 15:35:04 +02:00
Tobias Koppers
523d376ae3
update turbopack (#54768)
* https://github.com/vercel/turbo/pull/5793 <!-- Alex Kirszenberg -
Automatically derive ValueDefault for primitive value types -->
* https://github.com/vercel/turbo/pull/5784 <!-- Tobias Koppers - make
swc comments immutable -->
* https://github.com/vercel/turbo/pull/5627 <!-- Tobias Koppers - avoid
unnessecary indirection in async modules -->
* https://github.com/vercel/turbo/pull/5822 <!-- Tobias Koppers -
continue on failing test steps -->
* https://github.com/vercel/turbo/pull/5814 <!-- Justin Ridgewell -
Update HMR for next-api -->
* https://github.com/vercel/turbo/pull/5821 <!-- Tobias Koppers - avoid
cloning a large list of task ids -->

Closes WEB-1473
2023-08-30 13:55:51 +02:00
Tobias Koppers
08d3258762
update turbopack (#54558)
* https://github.com/vercel/turbo/pull/5723 <!-- Alex Kirszenberg - Misc
comments in turbo_tasks -->
* https://github.com/vercel/turbo/pull/5714 <!-- OJ Kwon - test(ci):
update datadog-ci -->
* https://github.com/vercel/turbo/pull/5705 <!-- Justin Ridgewell -
Transformation code necessary to support Server Actions -->
* https://github.com/vercel/turbo/pull/5739 <!-- Justin Ridgewell -
Update rust toolchain -->
* https://github.com/vercel/turbo/pull/5785 <!-- Tobias Koppers - add
evaluatables to chunk list ident -->
* https://github.com/vercel/turbo/pull/5783 <!-- Tobias Koppers -
Tracing improvements -->
* https://github.com/vercel/turbo/pull/5738 <!-- Alex Kirszenberg -
Generic types over Vcs -->
* https://github.com/vercel/turbo/pull/5795 <!-- Leah - fix: snapshot
test path canonicalization -->
* https://github.com/vercel/turbo/pull/5794 <!-- Tobias Koppers - fix
"any" context condition implementation -->
* https://github.com/vercel/turbo/pull/5800 <!-- Tobias Koppers - add
middleware entry type -->
* https://github.com/vercel/turbo/pull/5786 <!-- Tobias Koppers -
perform invalidation directly on writes -->

Closes WEB-1446
2023-08-25 16:22:35 +02:00
Donny/강동윤
c792baa7ce
Update swc_core to v0.79.70 (#54368)
### What?

Update swc_core to `v0.79.70`

### Why?

To apply https://github.com/swc-project/swc/pull/7839

### How?

Closes WEB-1420
Fixes #54192
2023-08-22 20:46:00 +00:00
Donny/강동윤
d2a8d4fa2d
Update swc_core to v0.79.69 (#54190)
### What?

Update swc crates to becea47a2d

### Why?

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

### How?

Closes WEB-1410
2023-08-20 10:55:41 +00:00
Justin Ridgewell
11dfdf8d7a
Turbopack: Strip relative path prefix when generating PageLoaderAsset (#54040)
### What?

Strip the relative path prefix (`_next/`) when generating the `PageLoaderAsset`. This is necessary because the page loader will internally use `__turbopack_load__`, which prepends the prefix back onto the path.

### Why?

Without this, we'd try loading `_next/_next/path/to/file.js`, because we'd prepend the prefix onto a path that already contains it.

### How?

When generating the page loader asset, we "proxy" the `OutputAsset` onto a path which has the prefix removed.

~~Depends on https://github.com/vercel/turbo/pull/5717~~

Closes WEB-1377
2023-08-17 17:29:30 +00:00
Donny/강동윤
bc76784bcb
Update swc_core to v0.79.59 (#54082)
### What?

Update swc crates to 023042dfb9

### Why?

To apply https://github.com/swc-project/swc/pull/7813

### How?

Closes WEB-1396
Fixes #54054
2023-08-16 13:07:57 +00:00
Will Binns-Smith
bd8ab094e5
Turbopack: fix hiding node_modules warnings in error overlay. (#54022)
This regressed in vercel/turbo#5661 when `context` was renamed `file_path`.
2023-08-14 21:38:52 +00:00
Donny/강동윤
c802075827
Update swc_core to v0.79.55 (#53831)
### What?

Update swc crates to 54f38cb47e

### Why?

To apply minifier bugfixes.

### How?

Closes WEB-1358
Fixes #53723

---

turbopack counterpart: https://github.com/vercel/turbo/pull/5699
2023-08-11 22:38:44 +00:00
Leah
ddc8f50d24
enable @vercel/og support for turbopack (#53917)
### What?

Now that we have wasm support (and support for `?module`) `@vercel/og` should be supported

### Turbopack updates

* https://github.com/vercel/turbo/pull/5677 
* https://github.com/vercel/turbo/pull/5660 

Closes WEB-138
2023-08-11 22:16:41 +00:00
Tobias Koppers
45576ae752
Turbopack: more tests and bugfixes for next.rs api (#53809)
### What?

* adds more HMR test cases
* fixes bugs found

### Why?

### Turbopack changes

* https://github.com/vercel/turbo/pull/5668 <!-- OJ Kwon - ci(test):
temporarily increase test timeout -->
* https://github.com/vercel/turbo/pull/5696 <!-- Tobias Koppers -
Cleanup minify -->
2023-08-11 10:29:36 +02:00
Tobias Koppers
9d1b3f43a1
Turbopack: add hmr test case and fix bugs (#53719)
### What?

test case for HMR

### Turbopack Changes

* https://github.com/vercel/turbo/pull/5686 <!-- Tobias Koppers - remove
error in update -->
2023-08-08 17:07:24 +02:00
Alex Kirszenberg
589150184e
Turbopack: Hide Turbo Engine internals (#53007)
See https://github.com/vercel/turbo/pull/5584
2023-08-07 14:55:13 +00:00
Will Binns-Smith
1d8a633595
Update to turbopack-230804.2 (#53588)
- vercel/turbo#5671
- vercel/turbo#5675
- vercel/turbo#5676
- vercel/turbo#5662
- vercel/turbo#5663
2023-08-04 21:51:35 +00:00
Tobias Koppers
94709ef1b9
update turbopack and update code for API changes (#53576)
* https://github.com/vercel/turbo/pull/5640
* https://github.com/vercel/turbo/pull/5661
2023-08-04 21:14:41 +02:00
Tobias Koppers
4ea1d8a45d
update turbopack (#53545)
* https://github.com/vercel/turbo/pull/5582 
* https://github.com/vercel/turbo/pull/5633 
* https://github.com/vercel/turbo/pull/5637 
* https://github.com/vercel/turbo/pull/5648 <!-- OJ Kwon - test(turbopack): run daily with --experimental  -->
* https://github.com/vercel/turbo/pull/5618 
* https://github.com/vercel/turbo/pull/5624 
* https://github.com/vercel/turbo/pull/5597 
* https://github.com/vercel/turbo/pull/5632 
* https://github.com/vercel/turbo/pull/5636 
* https://github.com/vercel/turbo/pull/5666
2023-08-04 07:19:20 +00:00
Tobias Koppers
60cee33fd6
update swc_core and sync deps (#53538)
### What?

sync deps with turbo

### Why?

`wat` and `swc_core` requires syncing deps

### How?
2023-08-03 17:55:45 +00:00
Donny/강동윤
c02dcd540c
Update swc_core to v0.79.38 (#53508)
### What?

Update `swc_core`

### Why?

To apply one more fix for the SWC minifier

 - https://github.com/swc-project/swc/pull/7743

### How?

Closes WEB-1340
2023-08-03 06:55:33 +00:00
Donny/강동윤
c017765ef2
Update swc_core to v0.79.36 (#53416)
### What?

Update `swc_core` to 383509fd9d

### Why?

To fix minifier regression.

### How?

 - Closes WEB-1326
 - Fixes #53151
 - Fixes #53286
 - Fixes #53273
2023-08-02 21:59:19 +00:00
JJ Kasper
e1a10c60f8
Revert "Update swc_core to v0.79.33 (#53308)" (#53381)
This reverts commit da043b5535.

x-ref: https://github.com/vercel/next.js/pull/53380
2023-07-31 06:35:38 -07:00
Donny/강동윤
da043b5535
Update swc_core to v0.79.33 (#53308)
### What?

Update `swc_core` to 00a0575408

### Why?

To fix minifier regression.

### How?

 - Closes WEB-1326
 - Fixes #53151
 - Fixes #53286
 - Fixes #53273
2023-07-29 07:58:03 +00:00
Tobias Koppers
3abaa85977
update turbopack (#53291)
* https://github.com/vercel/turbo/pull/5626 <!-- Tobias Koppers - remove
require.cache clear from chunk loading -->
2023-07-28 22:57:36 -07:00
Alex Kirszenberg
f8107f0abb
Turbopack: Update Turbopack (#53266)
* https://github.com/vercel/turbo/pull/5621 <!-- Tobias Koppers - fix
esm export in build runtime -->
* https://github.com/vercel/turbo/pull/5620 <!-- Tobias Koppers - Revert
"export namespace object instead commonjs interop object" -->
2023-07-27 12:00:13 -07:00
Tobias Koppers
a1adaf89ef
update turbopack (#53221)
* https://github.com/vercel/turbo/pull/5619 <!-- Tobias Koppers - export
namespace object instead commonjs interop object -->
2023-07-26 11:56:08 -07:00