Commit graph

56 commits

Author SHA1 Message Date
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
Tobias Koppers
df85ad1ec0
add tracing for turbopack (#49920)
### What?

adds `NEXT_TURBOPACK_TRACING` env var to enable tracing. Writes into `.next/trace.log`

There are 4 presets:

* `NEXT_TURBOPACK_TRACING=overview` gives a overview of requests and modules processed.
* `NEXT_TURBOPACK_TRACING=next` above plus details for next.js
* `NEXT_TURBOPACK_TRACING=turbopack` above plus details for turbopack
* `NEXT_TURBOPACK_TRACING=turbo-tasks` above plus details for turbo-tasks

Published release builds will only allow `overview` to work, since all detailed instrumentation is statically disabled.

see https://github.com/vercel/turbo/pull/4966 for more details

### Why?

get more insight into build times

### Turbopack changes

* https://github.com/vercel/turbo/pull/4995 
* https://github.com/vercel/turbo/pull/5049 
* https://github.com/vercel/turbo/pull/5053 
* https://github.com/vercel/turbo/pull/4966
2023-05-23 05:25:56 +00:00
Donny/강동윤
a5af56eda1
Update swc_core to v0.76.18 (#50137)
### What?

This PR disables `tracing/max_level_info`.

### Why?

Requested at
https://vercel.slack.com/archives/C03EWR7LGEN/p1683789628715199?thread_ts=1683738076.476839&cid=C03EWR7LGEN


### How?

Closes WEB-1080
Fixes #49949

Turbopack counterpart: https://github.com/vercel/turbo/pull/5049
2023-05-22 11:05:17 +02:00
Justin Ridgewell
448b74291e
[turbopack]: Update renamed SubpathValue (#49636)
https://github.com/vercel/turbo/pull/4895 renamed `ExportsValue` into
`SubpathValue`

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-19 18:46:10 +02:00
OJ Kwon
eb2650ae68
build(cargo): update turbopack (#50013)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md



## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

This PR updates turbopack to the latest.
2023-05-19 02:03:18 +00:00
Alex Kirszenberg
91861210a7
Port sorted-routes.ts to Rust (#48334)
`getSortedRoutes` is used in the `BuildManifestPlugin`, which I'm in the
process of porting to Next.js Turbo as part of Next Build. As such, I
ported it to Rust using GPT-4 (with manual review over the code).

The resulting code is not particularly idiomatic nor optimized Rust
code, but it passes all tests (similarly converted) and should be more
than fast enough for now.

In the process of porting, GPT-4 made some "suggestions" (read: it
automatically and silently changed parts of the code) which actually fix
some formatting issues with errors:
https://github.com/vercel/next.js/pull/48298

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-05-17 17:00:21 +02:00
Alex Kirszenberg
051c90d43c
Introduce NextMode (#49852)
This introduces a `NextMode` enum that controls which mode Next.js Turbo
is currently running in:
* `NextMode::Development`: `next dev`
* `NextMode::Build`: `next build`

Requires https://github.com/vercel/turbo/pull/4972

This also update Turbopack to `turbopack-230517.2` with the following
changes:

* https://github.com/vercel/turbo/pull/4972 <!-- Alex Kirszenberg -
Configure React development flag, inherit NODE_ENV from execution
context -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-17 16:22:50 +02:00
Donny/강동윤
e5ad96edd5
chore(turbopack): Update swc_core to v0.76.6 (#49792)
### What?

Updates `swc_core` to `v0.76.x`, which adds support for `Explicit Resource Management` (stage 3)

### Why?

It's stage 3

### How?

Closes WEB-1040


---

turbopack counterpart: https://github.com/vercel/turbo/pull/4937

Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
2023-05-16 05:08:17 +00:00
Leah
aeed1c770a
add support for globally providing mdx components to turbopack (#49818)
### What?

Adds support for `mdx-components` at the root/src directory.
This is a feature `next-mdx` already has:
https://github.com/vercel/next.js/tree/canary/packages/next-mdx#usage-1

Fixes WEB-1012

Depends on https://github.com/vercel/turbo/pull/4944

### Turbopack updates

* https://github.com/vercel/turbo/pull/4949 <!-- OJ Kwon -
refactor(turbopack): deprecate single react_refresh options -->
* https://github.com/vercel/turbo/pull/4944 <!-- Leah - add mdx
`providerImportSource` option -->
2023-05-16 00:45:08 +00:00
OJ Kwon
a7601213ab
refactor(next-core): consolidate react_refresh options (#49822)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md



## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change



### Why?

### How?

Closes NEXT-
Fixes #

-->

### What?

WEB-1049. Removes separate enable_refresh options.
2023-05-15 19:31:42 +00:00
OJ Kwon
cad6d3aa22
refactor(next-core): deprecate custom_ecmascript_transforms (#49629)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md



## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change



### Why?

### How?

Closes NEXT-
Fixes #

-->



### What?

WEB-1031.

Deprecate old custom_ecmascript_transforms, consolidate to use
ecmatransforms_plugin instead.
Requires https://github.com/vercel/turbo/pull/4886 .

---------

Co-authored-by: Alex Kirszenberg <alex.kirszenberg@vercel.com>
Co-authored-by: Leah <github.leah@hrmny.sh>
2023-05-12 19:43:25 +00:00
Tim Neutkens
684abdc5ce
Add trace-to-jaeger to workspace (#49692)
## What?

I wasn't able to `cargo run` in trace-to-jaeger because it wasn't in the
workspace.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md



## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2023-05-12 12:28:41 +02:00
Alex Kirszenberg
34f551d9b7
Rename Turbopack/tasks crates to common prefixes (#49446)
See https://github.com/vercel/turbo/pull/4866

This also updates Turbopack to turbopack-230511.2 with the following
changes:

* https://github.com/vercel/turbo/pull/4636 <!-- Alex Kirszenberg - Add
support for logging events and intervals in the macOS profiler -->
* https://github.com/vercel/turbo/pull/4793 <!-- OJ Kwon - ci(workflow):
enable more test -->
* https://github.com/vercel/turbo/pull/4886 <!-- OJ Kwon -
refactor(ecmascript-plugins): update serverdirective signature -->
* https://github.com/vercel/turbo/pull/4866 <!-- Alex Kirszenberg -
Rename Turbopack/tasks crates to common prefixes -->
2023-05-11 11:34:36 +00:00
OJ Kwon
1ed7544696
refactor(next-core): remove ast cloning in custom transform (#49560)
### What?

- closes WEB-1024.

Minor refactoring to avoid explicit AST cloning. Still visitors are
using fold though.

### Turbopack changes

* https://github.com/vercel/turbo/pull/4869
* https://github.com/vercel/turbo/pull/4879
* https://github.com/vercel/turbo/pull/4881
2023-05-10 11:07:40 +02:00
OJ Kwon
71d8064b3d
feat(next-core): relay transform plugin (#48899)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md



## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### Why?

### How?

Closes NEXT-
Fixes #

-->

#### What
Part 1 for WEB-848. 

This PR implements initial path to enable relay compiler option in
Turbopack. PR is based on approach WEB-955, that passing custom plugin
transform itself instead of trying to pass down configuration into
turbopack. In result, this PR requires counterpart turbopack PR at
https://github.com/vercel/turbo/pull/4721.

PR also refactors next-shared's transform bit, as we have grown number
of custom transforms.

Unfortunately there are some runtime errors with this transforms, so it
is not possible to use relay actually yet. WEB-956 tracks this.
(https://github.com/swc-project/plugins/pull/179)

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-05-09 11:09:34 -07:00
Tobias Koppers
e96fce41c4
render app pages with original url (#49198)
### What?

Use pre-rewrite URL for rendering

### Why?

Rendering app pages needs the original user facing URL.

### Turbopack changes

* https://github.com/vercel/turbo/pull/4818 <!-- Tobias Koppers - pass
original url with content source data -->
* https://github.com/vercel/turbo/pull/4817 <!-- Tobias Koppers - avoid
errors in computing issue details -->
2023-05-04 15:46:36 +02:00
Tobias Koppers
d908bd89bf
update turbopack (#49196)
* https://github.com/vercel/turbo/pull/4815 <!-- Tobias Koppers - fix
CSS HMR -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-04 14:24:36 +02:00
Alex Kirszenberg
7092266076
Add support for app global and segment 404 pages (#49085)
See https://github.com/vercel/turbo/pull/4776

This adds support for:

* Default and custom global app 404 pages (`app/not-found`).
* Segment-level 404 pages (`app/segment/not-found`).

This also updates Turbopack:

* https://github.com/vercel/turbo/pull/4787 <!-- Tobias Koppers -
Bugfixes for free var and binding replacement -->
* https://github.com/vercel/turbo/pull/4789 <!-- Alex Kirszenberg -
Print a warning when importing Sass files -->
* https://github.com/vercel/turbo/pull/4776 <!-- Alex Kirszenberg -
Leave pathname formatting up to the caller -->
* https://github.com/vercel/turbo/pull/4790 <!-- Tobias Koppers - remove
inital compilation message by default -->

## TODO:

- [ ] ~~The dev overlay shows up when `notFound()` is called, it should
be hidden~~ (moved to WEB-980)
- [ ] ~~Navigating to the global 404 page doesn't work~~ (this is a bug
in Next.js, see NEXT-963)
- [x] Tests.

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-05-03 18:10:17 +00:00
Tobias Koppers
194da0b3e3
add test case for non-enumerable exports (#49106)
### What?

test case for https://github.com/vercel/turbo/pull/4783
2023-05-03 04:23:41 +00:00
Tobias Koppers
fe38369618
add test cases for error handling (#49093)
### What?

test cases for https://github.com/vercel/turbo/pull/4779
2023-05-02 22:09:55 +02:00
Tobias Koppers
90153ffd8d
update turbopack (#49071)
* https://github.com/vercel/turbo/pull/4691 
* https://github.com/vercel/turbo/pull/4765 
* https://github.com/vercel/turbo/pull/4772
2023-05-02 08:19:30 +00:00
Tobias Koppers
dbccc794e3
fix GlobalError interop and add test case (#49033)
### What?

fixes handling of GlobalError interop
adds a test case for client component bug

### Why?

app dir client component interop is broken

### Turbopack changes

* https://github.com/vercel/turbo/pull/4597 <!-- Tobias Koppers - add
rspack to our benchmark suite -->
* https://github.com/vercel/turbo/pull/4761 <!-- Tobias Koppers - Do not
use interop logic on proxy modules -->
2023-05-01 14:51:37 +02:00
Alex Kirszenberg
3362851b92
More fluent GraphTraversal API (#49028)
See https://github.com/vercel/turbo/pull/4598

### Turbopack changes

* https://github.com/vercel/turbo/pull/4754 <!-- Justin Ridgewell -
Match TS's extends resolution algorithm -->
* https://github.com/vercel/turbo/pull/4598 <!-- Alex Kirszenberg - More
fluent GraphTraversal API -->

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-05-01 14:08:25 +02:00
Donny/강동윤
7e0a6f83f6
chore: Update swc_core to v0.75.41 (#48982)
### What?

Update swc_core and `@swc/core`.

### Why?

https://github.com/vercel/turbo/issues/4747 seems like a critical issue.

### How?

 - Fix WEB-969

### Turbopack changes

* https://github.com/vercel/turbo/pull/4688 <!-- OJ Kwon - ci(workflow):
add appdir underscore test to subset -->
* https://github.com/vercel/turbo/pull/4751 <!-- Justin Ridgewell -
Cleanup "started server on" message -->
* https://github.com/vercel/turbo/pull/4756 <!-- Donny/강동윤 - chore:
Update `swc_core` to `v0.75.41` -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-05-01 13:15:24 +02:00
Alex Kirszenberg
7b348fa0f2
Use ProxiedAsset instead of css_chunk_root_path to expose RSC CSS chunks (#48946)
See https://github.com/vercel/turbo/pull/4740

This enables RSC CSS HMR. The `css_chunk_root_path` way somehow broke
the propagation of invalidation for CSS chunks.

This also updates Turbopack with the following changes:

* https://github.com/vercel/turbo/pull/4738 <!-- Tobias Koppers -
improve commonjs esm interop and node ESM -->
* https://github.com/vercel/turbo/pull/4740 <!-- Alex Kirszenberg -
Replace css_chunk_root_path with ProxiedAsset -->
* https://github.com/vercel/turbo/pull/4741 <!-- Tobias Koppers - add
svg size extraction -->

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-04-28 20:37:34 +02:00
Justin Ridgewell
a2a3f5e378
turbopack: parse and propagate output: 'export' (#48046)
Depends on https://github.com/vercel/turbo/pull/4491

This adds support for the new `output: 'export'` configuration, and
propagates the value through to our Node.js rendering code to render.
Unfortunately, we don't support page-level configs at the moment, so we
can't set a `export const config = { dynamic: 'force-dynamic' }` and
test that the export value is being received (I've manually verified it,
though).

Fixes WEB-842
2023-04-28 06:36:32 +00:00
Alex Kirszenberg
3ed412a308
Selectively load runtime CSS modules to avoid rule duplication (#48866)
See https://github.com/vercel/turbo/pull/4695

### Turbopack changes

* https://github.com/vercel/turbo/pull/4683 <!-- Alex Kirszenberg -
Update benchmark data -->
* https://github.com/vercel/turbo/pull/4695 <!-- Alex Kirszenberg -
Selectively load runtime CSS modules to avoid rule duplication -->

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-27 13:47:36 +02:00
Tobias Koppers
219d1d49c7
update turbopack (#48893)
### What?

* https://github.com/vercel/turbo/pull/4700 <!-- Tobias Koppers - update
deps -->
* https://github.com/vercel/turbo/pull/4706 <!-- Tobias Koppers - make
library code less verbose in stack traces -->
* https://github.com/vercel/turbo/pull/4705 <!-- Tobias Koppers -
improve error handling in update stream -->
* https://github.com/vercel/turbo/pull/4667 <!-- Caleb Webber - remove
box_syntax -->
* https://github.com/vercel/turbo/pull/4714 <!-- Tobias Koppers - chunk
hash need to include availability root -->
* https://github.com/vercel/turbo/pull/4709 <!-- Alex Kirszenberg -
Allow the dev server socket to be reused immediately -->
* https://github.com/vercel/turbo/pull/4716 <!-- Tobias Koppers - errors
lead to consistent exit code in issue detail -->
2023-04-27 00:46:04 +02:00
OJ Kwon
ea472e8058
refactor(next-core): emit unsupported package warning (#48837)
### What?

WEB-953. 

This PR moves, bubbles up unsupported package warning from turbopack to next-core using resolve plugin. Featurewise it behaves same, however removes turbopack aware specific next.js package (`@vercel/og`) internally.
2023-04-26 21:11:07 +00:00