Commit graph

197 commits

Author SHA1 Message Date
Tobias Koppers
3a7fea4034
Revert "refactor(analysis): rust based page-static-info, deprecate js parse interface in next-swc" (#61021)
Reverts vercel/next.js#59300

Breaks `app/page.mdx` files

Closes PACK-2279
2024-01-23 12:00:36 +01:00
OJ Kwon
9d5f62eb4a
refactor(analysis): rust based page-static-info, deprecate js parse interface in next-swc (#59300)
### Description

This PR refactors existing `analysis/get-static-page-info`, moves over
most of parse / ast visiting logic into next-swc's rust codebase. By
having this, turbopack can reuse same logic to extract info for the
analysis. Also as a side effect, this removes JS side parse which is
known to be inefficient due to serialization / deserialization.

The entrypoint `getPageStaticInfo` is still in the existing
`get-page-static-info`, only for extracting / visiting logic is moved.
There are some JS specific context to postprocess extracted information
which would require additional effort to move into.


Closes PACK-2088
2024-01-22 14:42:28 -08:00
Will Binns-Smith
5f67de6717
Rust: update http to 0.2.11 (#60986)
This aligns the version with that in https://github.com/vercel/turbo


Closes PACK-2272
2024-01-22 19:31:45 +00:00
Leah
f5dab7ce7d
chore: update turbopack (#60980)
### Turbopack Updates

* https://github.com/vercel/turbo/pull/6923 <!-- Tobias Koppers - Bottom
up tracing and some tracing improvements -->
* https://github.com/vercel/turbo/pull/7028 <!-- Leah - fix: add missing
layer ident modifier to asset with inner assets -->

Closes PACK-2270
2024-01-22 17:03:22 +01:00
Tim Neutkens
4548fed1cf
Skip postcss config location resolving in node_modules (#60697)
## What?

Skip postcss config resolving in node_modules for Turbopack. This
matches current Next.js on webpack closer as that only resolves the
postcss config from the project root. The additional feature Turbopack
has is that it can find a postcss config relative to the css being
compiled. This is useful for e.g. reducing the amount of overhead
certain postcss plugins that only have to run against a single file take
(i.e. Tailwindcss).


Depends on github.com/vercel/turbo/pull/7012 landing first.

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

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating 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 #

-->


Closes NEXT-2109

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2024-01-17 13:54:17 +00:00
OJ Kwon
5956ff76b5
feat(next-core): port remaining next.js custom transforms (#60498)
<!-- 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

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating 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?



-->

This PR ports over all of the remaining custom transforms for next-swc
into turbopack, and apply it into client / server rules accordingly.

Closes PACK-2225
2024-01-17 10:32:58 +01:00
Tobias Koppers
4597ff35da
allow to pass available chunk items when creating a chunk group (#60554)
### What?

api changes for https://github.com/vercel/turbo/pull/6988

### Turbopack Changes

* https://github.com/vercel/turbo/pull/6886 <!-- Tobias Koppers -
improve nesting of tracing for invalidations -->
* https://github.com/vercel/turbo/pull/6866 <!-- Tobias Koppers - trace
memory allocations and show in tracing -->
* https://github.com/vercel/turbo/pull/6988 <!-- Tobias Koppers - allow
to pass available chunk items when creating a chunk group -->
* https://github.com/vercel/turbo/pull/7013 <!-- Leah - fix: make CSS
reloading work on firefox -->
* https://github.com/vercel/turbo/pull/7004 <!-- Tobias Koppers -
improve error message when no config is exported from postcss.config.js
-->




Closes PACK-2231
2024-01-17 08:58:02 +01:00
OJ Kwon
8627e7c8c0
refactor(next-swc): remove unused crashreporter (#60593)
<!-- 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

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating 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?

This code path has not been used for some time and it is clear we won't
use this as-is. Better to get rid of them and reintroduce depends on the
needs.


Closes PACK-2235
2024-01-16 11:01:47 -08:00
Leah
ee6cc6d9c2
feat(turbopack): support named client references properly (#59578)
### What?
Makes sure `import * as mod from 'client-mod'` works properly by
actually adding the exports to the emitted module.

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

### Turbopack Updates

* https://github.com/vercel/turbo/pull/6965 <!-- Tobias Koppers -
recycle trace buffers -->
* https://github.com/vercel/turbo/pull/6974 <!-- Chris Olszewski -
feat(lockfiles): support Yarn 4 patches -->
* https://github.com/vercel/turbo/pull/6787 <!-- Leah -
feat(turbopack-ecmascript): support named client references -->


Closes PACK-2110
2024-01-10 18:14:36 +00:00
Tobias Koppers
990d0a9ab8
update turbopack (#60478)
* https://github.com/vercel/turbo/pull/6978 <!-- Tobias Koppers - fix
aggregation of outdated children and collectibles -->
* https://github.com/vercel/turbo/pull/6968 <!-- Tobias Koppers - fix
glob matching of alternatives -->
* https://github.com/vercel/turbo/pull/6922 <!-- Tobias Koppers - avoid
using a write lock for root info -->
2024-01-10 17:45:29 +00:00
Tobias Koppers
45370e8ce8
update turbopack (#60208)
* https://github.com/vercel/turbo/pull/6720 <!-- Tobias Koppers - fix
weird local name, add tests -->
* https://github.com/vercel/turbo/pull/6832 <!-- Leah -
fix(turbopack-ecmascript): make sure async module wrapper is always
generated -->
* ~https://github.com/vercel/turbo/pull/6885~ <!-- Tobias Koppers - fix
aggregation of outdated children and collectibles -->
* ~https://github.com/vercel/turbo/pull/6839 <!-- Tobias Koppers - fix
glob matching of alternatives -->~
* https://github.com/vercel/turbo/pull/6884 <!-- Donny/강동윤 - Update
`swc_core` to `v0.87.16` -->
* https://github.com/vercel/turbo/pull/6964 <!-- Tobias Koppers - Reduce
calls, tasks and duplicate work -->
2024-01-10 11:14:46 +01:00
OJ Kwon
46370d816b
refactor(next/core): reorganize next.js custom transforms for next-swc/turbopack (#60400)
<!-- 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

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating 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?

This PR refactors organization for the rust side packages to build
`next-swc`.

### Why?

We had some historical legacy around package structures, have ambiguous
name for `core` / `next-core`. One contains swc transform visitor for
the next.js, and the other one is new for turbopack's core next.js
features. In addition to that, there was a package dependency chain
prevents to use `core` in the turobpack / next-swc both, so each time
porting a transformer into turbopack it requires to extract new
dependency to be imported in the both place.

PR touches its organization - while PR is large to touch various files,
the crux is summarized at
2cedd06ea5
:

1. `core` becomes `next-custom-transforms`, also this becomes an
agnostic pkg can be imported in turbopack / wasm / next-swc
2. simplify dependency chain to import next-custom-transforms, organized
as below

```mermaid
flowchart TD
    C(next-custom-transforms) --> A(napi)
    C(next-custom-transforms) --> B(wasm)
    D(next-core) --> A(napi)
    E(next-build) --> A(napi)
    F(next-api) --> A(napi)
    C(next-custom-transforms) --> D
    D(next-core) --> F(next-api)
    D(next-core) --> E(next-build)
```

`impl CustomTransformer` for the each transform still lives in
`next-core`, so turbopack specific dependency is isolated under
`next-core/build/api`.


Closes PACK-2201
Closes PACK-2202

---------

Co-authored-by: hrmny <8845940+ForsakenHarmony@users.noreply.github.com>
2024-01-09 12:23:47 -08:00
Donny/강동윤
1e7e6e1c93
Update swc_core to v0.87.16 (#60192)
### What?

Update swc crates

### Why?

To fix bugs

### How?

Closes PACK-1682
Closes PACK-2154
Fixes #56144

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2024-01-08 14:38:21 +01:00
OJ Kwon
f641d9ccfc
feat(next-core): apply rsc transform in turbopack (#59629)
### What?

Turbopack does not apply same transform for the react server components,
which makes missing lot of compilation error validation and custom
comments. PR refactors transform to be used in next-swc / turbopack
both, then apply it into turbopack.

There are still some of test cases are not passing, might need further
digging for the transform condition.


Closes PACK-2155

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2024-01-05 16:14:06 +01:00
Donny/강동윤
82cd86d66b
Update swc_core to v0.87.10 (#59834)
### What?

Update SWC crates

### Why?

It's required to fix some next.js isssues

### How?

Closes PACK-2174
Turbopack counterpart: https://github.com/vercel/turbo/pull/6843

---


# Turbopack

* https://github.com/vercel/turbo/pull/6737 <!-- Nicholas Yang - feat:
Nice errors for shim flag parsing -->
* https://github.com/vercel/turbo/pull/6494 <!-- Justin Ridgewell -
Trace output's source maps through input's source map -->
* https://github.com/vercel/turbo/pull/6778 <!-- Will Binns-Smith -
turbopack-css: fix rule duplication -->
* https://github.com/vercel/turbo/pull/6807 <!-- Mehul Kar - fix: add
missing dependency to cargo lockfile -->
* https://github.com/vercel/turbo/pull/6809 <!-- Nicholas Yang -
refactor: Remove bookkeeping abstraction from turbo config -->
* https://github.com/vercel/turbo/pull/6838 <!-- Nicholas Yang - fix:
Allow for long symlinks by using append_link -->
* https://github.com/vercel/turbo/pull/6845 <!-- Donny/강동윤 - perf: Use
`&'static str` instead of `String` if possible -->
* https://github.com/vercel/turbo/pull/6843 <!-- Donny/강동윤 - Update
`swc_core` to `v0.87.10` -->
2024-01-02 08:44:46 +00:00
Leah
e9ac616414
chore: update Turbopack (#59589)
### Changes

* https://github.com/vercel/turbo/pull/6777 <!-- Leah -
fix(turbopack-ecmascript-runtime): handle non encoded CSS paths -->
* https://github.com/vercel/turbo/pull/6785 <!-- Tim Neutkens - Ensure
turbopack-trace-server doesn't send message in a loop -->



Closes PACK-2147
2023-12-13 18:25:37 +01:00
Donny/강동윤
d5291fad49
Update swc_core to v0.86.98 and turbopack (#59393)
### What?

Update SWC crates.

### Why?

To fix OOM bug of `inputSourceMap`.

Patch: https://github.com/swc-project/swc/pull/8402

### How?

Closes PACK-2123



# Turbopack updates

* https://github.com/vercel/turbo/pull/6733 <!-- Thomas Knickman -
chore(ignore): exclude rustic-ice files -->
* https://github.com/vercel/turbo/pull/6731 <!-- Leah -
fix(turbopack-ecmascript-runtime): don't use `path.relative` for
absolute paths -->
* https://github.com/vercel/turbo/pull/6745 <!-- Donny/강동윤 - Update
`swc_core` to `v0.86.98` -->
2023-12-08 19:34:02 +09:00
Tobias Koppers
26b8caaa29
Turbopack: switch to a single client components entrypoint (#59352)
### What?

switch turbopack to use a single client components entrypoint for all
client components on a page for development. This aligns it with the
webpack behavior.

### Why?

compiling a separate entrypoint for every client component is pretty
expensive in regards of compilation, chunking, code generation, file
writing and number of requests.

### Turbopack Changes

* https://github.com/vercel/turbo/pull/6713 <!-- Tobias Koppers - use
real emojis -->
* https://github.com/vercel/turbo/pull/6728 <!-- Tobias Koppers - fix
order of reverse topologic iteration -->


Closes PACK-2115
2023-12-08 08:24:08 +01:00
Tobias Koppers
34e9d65d29
update turbopack (#59334)
* https://github.com/vercel/turbo/pull/6716 <!-- Tobias Koppers - add
support for export renaming in side effects optimization -->
* https://github.com/vercel/turbo/pull/6718 <!-- Tobias Koppers - cache
the chunking work -->
2023-12-06 17:20:52 +01:00
Tobias Koppers
0082d54893
side effects optimization (#58972)
### What?

Code update for refactoring in https://github.com/vercel/turbo/pull/6590


Closes PACK-2043
2023-12-06 08:23:46 +00:00
Tobias Koppers
2b473970ef
update turbopack (#59285)
* https://github.com/vercel/turbo/pull/6588 <!-- Leah - ci: remove daily
turbopack next.js integration test workflow -->
* https://github.com/vercel/turbo/pull/6666 <!-- Will Binns-Smith -
Turbopack css: treat `composes` and `@import` as urls when resolving -->
* https://github.com/vercel/turbo/pull/6701 <!-- Tobias Koppers - add
user level tracing -->
* https://github.com/vercel/turbo/pull/6616 <!-- Leah - feat(turbopack):
support "loading" WebAssembly injected as global varables in edge
runtime -->

Closes PACK-2086
2023-12-05 14:06:49 +01:00
Tobias Koppers
669a48cb4d
fix tsconfig alias cycle (#59232)
### What?

fixes https://github.com/vercel/next.js/issues/59195
fixes PACK-450

### Why?

### How?

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

### Turbopack Changes

* https://github.com/vercel/turbo/pull/6627 <!-- Tobias Koppers - fix
stack trace of errors -->
* https://github.com/vercel/turbo/pull/6646 <!-- OJ Kwon -
fix(turbo-tasks-fs): support unicode segment for glob -->
* https://github.com/vercel/turbo/pull/6672 <!-- OJ Kwon -
fix(ecmascript): dbg assert for the globals -->
* https://github.com/vercel/turbo/pull/6687 <!-- Tobias Koppers - fix
tsconfig alias cycle -->
2023-12-04 10:50:15 +01:00
OJ Kwon
72af59a1c1
build(cargo): bump up turbopack (#59032)
### What?

Bump up turbopack which includes url rewrite related improvements. This makes `test/integration/url` test passes.

Note there are some lacking behavior around edge runtime + url behavior, it is being tracked in PACK-2014.

Closes PACK-2051
2023-11-28 20:42:26 +00:00
OJ Kwon
048ab21f6b
fix(turbopack): treat .mdx as valid ecma asset (#58985)
### What

Pairing with https://github.com/vercel/turbo/pull/6602, enables
ecma-related transform support in mdx. notably fixes test cases in
https://github.com/vercel/next.js/pull/58968 .

With turbopack side fix, still modularize imports are not being applied
as we limite it to .js* extension only. PR expands it to include mdx if
mdx is enabled. PR is failling until turbopack side fix lands.

Closes PACK-2045

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-11-28 13:54:46 +01:00
Tobias Koppers
f1511515fd
Trace server updates (#58694)
### What?

some refactoring updates


Closes PACK-1994
2023-11-27 15:29:41 +01:00
Donny/강동윤
8e6d51f4fa
Update swc_core to v0.86.81 (#58517)
### What?

Update swc crates.

Diff:
09b3003e58...c566b73bfb

### Why?

To fix bugs, and improve minification.

### How?

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

- Closes PACK-1972

- Closes #30802

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-11-27 11:02:25 +01:00
Tobias Koppers
9f69766cfa
Turbopack: enable some node.js builtin in edge runtime (#58850)
### What?

Edge runtime allow additional node.js builtins

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


Closes PACK-2031

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-11-26 19:55:23 +01:00
Tim Neutkens
c3c006d9f0
Upgrade Turbopack (#58859)
* https://github.com/vercel/turbo/pull/6540 
* https://github.com/vercel/turbo/pull/6549 
* https://github.com/vercel/turbo/pull/6554 
* https://github.com/vercel/turbo/pull/6561 
* https://github.com/vercel/turbo/pull/6563 
* https://github.com/vercel/turbo/pull/6562 
* https://github.com/vercel/turbo/pull/6544
2023-11-24 12:33:50 +00:00
Will Binns-Smith
b3914f6175
Turbopack: update to turbopack-231122.3 (#58784)
Includes vercel/turbo#6525
2023-11-22 22:22:26 +01:00
Will Binns-Smith
154268a144
Turbopack: Use styled issue titles and details (#58743)
This uses styled issue titles and details introduced in
vercel/turbo#6535, which also moves "Module not found" messaging to the
title field for those issues.


Closes PACK-2013

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: Leah <github.leah@hrmny.sh>
Co-authored-by: Zack Tanner <zacktanner@gmail.com>
2023-11-22 13:39:24 +01:00
Tobias Koppers
3467116794
fix node externals resolving (#58129)
### What?

Various fixes in handling of externals in node.js

* add extensions to builtin externals to allow node.js ESM to work
* improve the auto-externals logic to detect more edge cases
* prepare for `esmExternals` support, but that's blocked by client
manifest missing the async flag
* currently only `esmExternals: false` is supported

### Why?

### Turbopack Changes

* https://github.com/vercel/turbo/pull/6531 <!-- Leah - fix(turbopack):
postcss should be applied to `@import`ed CSS files -->
* https://github.com/vercel/turbo/pull/6530 <!-- Tobias Koppers - fix
node.js externals -->

---------

Co-authored-by: Leah <github.leah@hrmny.sh>
Co-authored-by: Zack Tanner <zacktanner@gmail.com>
2023-11-21 23:58:14 +01:00
Donny/강동윤
94771bf3cc
refactor: Add lightningcss mode for turbopack-css (#58471)
### What?

We are experimenting with `lightningcss`. This is about replacing
`swc_css` with `lightningcss` in turbopack, and the main reason for this
is to reduce the maintenance burden.
But when I tried, it introduced several regressions, so I'm putting it
behind an experimental flag.

You can enable `lightningcss` mode for **turbopack** by adding a flag to
the next config file.

```js
/**
 * @type {import('next').NextConfig}
 */
const nextConfig = {
  experimental: {
    useLightningcss: true,
  },
}

module.exports = nextConfig

```

Note that this is only for turbopack because we were not using `swc_css`
for non-turbopack mode of next.js



x-ref:
https://vercel.slack.com/archives/C03EWR7LGEN/p1700025496732229?thread_ts=1700019629.866549&cid=C03EWR7LGEN


### Why?

We should avoid regressions.

### How?

---

turbopack PR: https://github.com/vercel/turbo/pull/6456


Closes PACK-1966

---------

Co-authored-by: Leah <github.leah@hrmny.sh>
2023-11-20 18:09:36 +01:00
Will Binns-Smith
024a0ef24d
Update rust-toolchain to 2023-11-16 (#58558)
This updates the rust toolchain to 2023-11-16 and:

- Removes now-unnecessary `#![feature(async_fn_in_trait)]`
- Applies auto-fixable lint fixes
- Uses `Cargo.toml` new `lint` section instead of command line rustc flags

Test Plan: Tested with updated turbo in a create-next-app


Closes PACK-1979

Co-authored-by: OJ Kwon <1210596+kwonoj@users.noreply.github.com>
2023-11-18 00:29:50 +00:00
Will Binns-Smith
5f8be1f0d3
Turbopack: Use structured styled text in issue descriptions (#58156)
Requires vercel/turbo#6388

This uses the structure implemented in vercel/turbo#6388 to support formatted text when reporting. Right now only the `Line` and basic `String` cases are handled.
2023-11-15 22:33:14 +00:00
Donny/강동윤
f99242baca
Update turbopack (#58408)
* https://github.com/vercel/turbo/pull/6424 
* https://github.com/vercel/turbo/pull/6433 

Closes PACK-1967
2023-11-15 11:48:31 +00:00
Tobias Koppers
bf966e370e
update turbopack (#58243)
* https://github.com/vercel/turbo/pull/6399 
* https://github.com/vercel/turbo/pull/6393 
* https://github.com/vercel/turbo/pull/6403 
* https://github.com/vercel/turbo/pull/6404 
* https://github.com/vercel/turbo/pull/6394 
* https://github.com/vercel/turbo/pull/6405 
* https://github.com/vercel/turbo/pull/6351
2023-11-09 09:52:22 +00:00
Tobias Koppers
9d3b94b449
update turbopack (#58172)
* https://github.com/vercel/turbo/pull/6376 <!-- OJ Kwon -
feat(turbopack): support url rewrite behavior options -->
* https://github.com/vercel/turbo/pull/6386 <!-- OJ Kwon -
feat(turbopack-ecmascript): support relative url asset ref -->
* https://github.com/vercel/turbo/pull/6382 <!-- Tobias Koppers -
refactor and fix CssEmbed for url() -->
2023-11-08 08:54:36 +01:00
Donny/강동윤
c370c179b5
build: Update swc_core to v0.86.40 and update turbopack (#57904)
### What?

* https://github.com/vercel/turbo/pull/6286 
* https://github.com/vercel/turbo/pull/6367 
* https://github.com/vercel/turbo/pull/6354 
* https://github.com/vercel/turbo/pull/6343 

---

 - Update `swc_core` to `v0.86.40`

 - Revert #56281 and fix `node-fetch` by disabling inlining
   - Use `inline: 2` instead of `keep_fnames: true`

### Why?

`keep_fnames` increases the bundle size too much.

### How?

 - Fixes #56612

 - Fixes #57886 

 - Fixes #55682 (by https://github.com/swc-project/swc/pull/8205)

 - Reverts #56281


 - Closes PACK-1902
2023-11-07 15:26:28 +00:00
Tobias Koppers
883ab22157
update turbopack (#58080)
* https://github.com/vercel/turbo/pull/6325 <!-- OJ Kwon - build(cargo):
skip external build script with rust-analyzer -->
* https://github.com/vercel/turbo/pull/6318 <!-- OJ Kwon -
feat(turbopack-ecmascript): calculate import.meta.url as an absolute
path -->
* https://github.com/vercel/turbo/pull/6359 <!-- Will Binns-Smith -
Turbopack: Defer calculating source positions until needed -->
* https://github.com/vercel/turbo/pull/6274 <!-- Tobias Koppers - add
backtrace for trait calls -->
* https://github.com/vercel/turbo/pull/6305 <!-- Tobias Koppers - Triple
chunk size heuristic -->
* https://github.com/vercel/turbo/pull/6304 <!-- Tobias Koppers -
improve resolving performance -->
2023-11-06 18:05:13 +01:00
Tobias Koppers
936b953eda
update turbopack (#57487)
* https://github.com/vercel/turbo/pull/6290 <!-- Tobias Koppers - fix
hmr client to be actually reliable -->

Closes WEB-1887

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-26 10:39:33 +02:00
Tobias Koppers
581b1be064
update turbopack (#57485)
* https://github.com/vercel/turbo/pull/6289 <!-- Tobias Koppers - Revert
"normalize pattern correctly to avoid slow path in matching" -->

Closes WEB-1885
2023-10-26 09:13:00 +02:00
Tobias Koppers
7c3511cd99
update turbopack (#57469)
* https://github.com/vercel/turbo/pull/6268 <!-- Maia Teegarden - Update
Turbopack Docs -->
* https://github.com/vercel/turbo/pull/6278 <!-- Anthony Shew - Clearer
Remote Cache upload spinner message. -->
* https://github.com/vercel/turbo/pull/6288 <!-- Tobias Koppers -
normalize pattern correctly to avoid slow path in matching -->

Closes WEB-1877
2023-10-26 07:41:16 +02:00
Tobias Koppers
5f0cfd41be
update turbopack (#57420)
* https://github.com/vercel/turbo/pull/6269 <!-- Tobias Koppers - Upload
data even for non-scheduled runs -->
* https://github.com/vercel/turbo/pull/6270 <!-- Tobias Koppers - Put
ESM in strict mode -->

Closes WEB-1855

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-25 21:53:31 +02:00
Tobias Koppers
a929bf7c04
update turbopack and add HMR test case (#57304)
### What?

adds a test case for HMR, which is fixed by the turbopack update

### Why?

### How?

### Turbopack Changes

* https://github.com/vercel/turbo/pull/6245 
* https://github.com/vercel/turbo/pull/6212 
* https://github.com/vercel/turbo/pull/6255 
* https://github.com/vercel/turbo/pull/6259 
* https://github.com/vercel/turbo/pull/6261 
* https://github.com/vercel/turbo/pull/6260 

Closes WEB-1836
2023-10-24 04:38:05 +00:00
Donny/강동윤
652a553a13
Update swc_core to v0.86.10 (#57121)
### What?

Update SWC crates. This PR fixes a regression of `swc_core`.
The important PR: https://github.com/swc-project/swc/pull/8153

### Why?

There was a regression in `swc_core`.

### How?

-  Fixes #56408

Closes WEB-1811

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-23 05:01:31 +02:00
Tobias Koppers
b64c0426bc
update turbopack (#57176)
* https://github.com/vercel/turbo/pull/6241 <!-- Tobias Koppers - make
the daily ci faster -->
* https://github.com/vercel/turbo/pull/6242 <!-- Justin Ridgewell - Add
caching to `chunk_content`'s graph walking -->
* https://github.com/vercel/turbo/pull/6228 <!-- Tobias Koppers - Reduce
resolve and resolving tasks -->
* https://github.com/vercel/turbo/pull/6244 <!-- Tobias Koppers - avoid
cloning list -->
* https://github.com/vercel/turbo/pull/6246 <!-- Tobias Koppers - fix
symlink handling -->

Closes WEB-1819
2023-10-23 02:42:29 +02:00
Will Binns-Smith
1ffef0f1a3
Turbopack: support more server code in tracing error stack frames (#57156)
This:
- Uses `isServer` to use the appropriate Turbopack `FileSystem` when
creating `FileSystemPath`s
- Properly uri decodes path segments originating from `file://` uris
- Correctly reads chunks starting at the project path instead of the
root path


Closes WEB-1815

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-10-20 17:09:10 -07:00
Leah
0d2edbb23f
chore: move layer from chunking context to asset context (#57149)
The asset context is a better place to store the layer, because it's
affected by transitions unlike the chunking context

This PR also removes a bunch of unused code

### Why?

See https://github.com/vercel/turbo/pull/6237 for the rationale
Also needs to wait for that PR to be merged

Closes NEXT-1814

#### Turbopack Changes
* https://github.com/vercel/turbo/pull/6237 <!-- Leah - chore: move
layer from chunking context to asset context -->

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-10-21 02:05:00 +02:00
Tobias Koppers
4a75e71d25
prefer Option<Vc<IssueSource>> over Vc<OptionIssueSource> (#57104)
### What?

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

### Why?

### How?


Closes WEB-1808
2023-10-20 18:06:23 +00:00
OJ Kwon
68edcc3e37
build(cargo): bump up turbopack (#57081)
### What?

Picks up latest turbopack to get some changes.

Closes WEB-1802
2023-10-19 22:21:27 +00:00