Commit graph

227 commits

Author SHA1 Message Date
Donny/강동윤
2d8462eaf4
Update turbopack (#62263)
### What?


* https://github.com/vercel/turbo/pull/7416 <!-- Donny/강동윤 - Update
`swc_core` to `v0.90.10` -->


### Why?

To keep in sync

### How?



Closes PACK-2540
2024-02-20 08:26:39 +01:00
Donny/강동윤
a78ed66726
Update swc_core to v0.90.10 (#62222)
### What?

Update SWC crates.

### Why?

There was an important bug fix in SWC.

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

### How?



Closes PACK-2529
2024-02-20 03:20:56 +00:00
Donny/강동윤
755e88b16b
feat: Lint invalid CSS modules (#62040)
### What?

`css-loader` seems to have a linting rule for invalid CSS Modules.
[My Turbopack PR](https://github.com/vercel/turbo/pull/7381) implements
the same rule for `swc_css` and `lightningcss`, and this PR is for
enabling related test suite and updating the jest snapshot.

### Why?

`css-loader` has a similar linting rule.

### How?

Closes PACK-2408
2024-02-19 03:10:08 +00:00
Tobias Koppers
8ee776dd17
add support for esmExternals in pages (#61983)
### What?

* add support for esmExternals in pages
* fix default of esmExternals to true
* fix serverComponentExternalPackages support
* add test case

fixes PACK-2311
fixes PACK-1916

Fixes https://github.com/vercel/turbo/issues/4544
2024-02-16 23:09:45 +00:00
Tobias Koppers
e1787bb719
Turbopack: add support for dynamic requests in require() and import() (#62092)
### What?

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

### Turbopack Changes

* https://github.com/vercel/turbo/pull/7367 <!-- Tobias Koppers - add
custom_extensions to resolve options context -->
* https://github.com/vercel/turbo/pull/7398 <!-- Tobias Koppers - add
support for dynamic requests in require() and import() -->


Closes PACK-2513
2024-02-15 15:31:28 +00:00
Tobias Koppers
9572dfd80c
update turbopack (#62080)
* https://github.com/vercel/turbo/pull/7347 <!-- Tobias Koppers - avoid
resolving recursive main field -->
* https://github.com/vercel/turbo/pull/7349 <!-- Tobias Koppers - dedupe
resolving independent on reference type -->
* https://github.com/vercel/turbo/pull/7391 <!-- OJ Kwon -
feat(tasks-fs): allow to skip subpath invalidation -->
2024-02-15 12:41:26 +01:00
Donny/강동윤
24f9812e36
build: Update swc_core to v0.90.8 (#61976)
### What?

Update swc crates one more time.

### Why?

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

### How?

Fixes #61788

Closes PACK-2446
Closes PACK-2476
2024-02-14 07:09:57 +00:00
OJ Kwon
8b4005e792
docs(turbopack): reduce documentation size (#62016)
### What

next_core unexpectedly reexports everything, makes documentation size
too large.

Closes PACK-2480
2024-02-13 14:36:11 -08:00
Tobias Koppers
310c9beead
Turbopack: remove server addr (#61932)
### What?

remove server_addr option

### Why?

We no longer need the server addr for bundling.


Closes PACK-2462
2024-02-13 13:12:30 +00:00
Donny/강동윤
42872bf423
Update swc_core to v0.90.7 and update turbopack (#61662)
# Turbopack changes

* https://github.com/vercel/turbo/pull/7342 <!-- OJ Kwon - docs(turbopack): build, deploy rustdocs -->
* https://github.com/vercel/turbo/pull/7356 <!-- OJ Kwon - ci(workflow): remove doc deploy -->
* https://github.com/vercel/turbo/pull/7272 <!-- Donny/강동윤 - build: Update `swc_core` to `v0.90.7` -->


### What?

Update swc crates

### Why?

- To apply https://github.com/swc-project/swc/pull/8532 and other bugfixes

### How?

 - Closes PACK-2389
 - Closes PACK-2446
 - Closes #61788
2024-02-13 04:20:16 +00:00
OJ Kwon
d7f1e4552a
build(cargo): update turbopack for filewatcher fix (#61955)
<!-- 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 #

-->

### What

* https://github.com/vercel/turbo/pull/7340 <!-- OJ Kwon -
feat(tasks-fs): bump up notify, fix empty file watch -->

Bump up turbopack PR to fix hmr issues.

Closes PACK-2466
2024-02-12 10:41:39 -08:00
OJ Kwon
63f160e8b3
build(cargo): bump up turbopack to latest (#61952)
### What?

Bump up turbopack to latest. This is to cut off turbopack **before**
including filewatcher changes, so we can easily bisect & revert if
watcher have regressions.
2024-02-12 10:08:40 -08:00
Tobias Koppers
5c74ed9258
update turbopack (#61187)
### What?

* https://github.com/vercel/turbo/pull/7302 <!-- Tobias Koppers -
support exporting undefined -->
* https://github.com/vercel/turbo/pull/7303 <!-- Tobias Koppers -
improve HMR performance -->
* https://github.com/vercel/turbo/pull/7306 <!-- OJ Kwon - ci(test): add
wasi target check for the supported packages -->
* https://github.com/vercel/turbo/pull/7308 <!-- OJ Kwon - build(cargo):
apply formatting -->
* https://github.com/vercel/turbo/pull/7117 <!-- Tobias Koppers - track
RequestKey during resolving and avoid duplicate keys -->



Closes PACK-2299
2024-02-09 18:57:15 +01:00
Tobias Koppers
86c46edce7
source map fixes (#61723)
### What?

* show guessed original file for generate code
* avoid internal cast
* add get_source_map method
* hide turbopack runtime stack lines
* hide unmapped stack lines


Closes PACK-2400

Before:


![image](https://github.com/vercel/next.js/assets/1365881/29f24f59-7c77-4496-92de-efcc72d28ad5)

After:


![image](https://github.com/vercel/next.js/assets/1365881/ca07e9f9-71ea-440d-97a2-c2c731ab3899)

and expanded:


![image](https://github.com/vercel/next.js/assets/1365881/1f73e632-890d-4681-8f21-ef502c676aae)

### Other Turbopack changes


* https://github.com/vercel/turbo/pull/4235 <!-- Leah -
chore(turborepo-lib): use compile error for feature validation -->
* https://github.com/vercel/turbo/pull/7285 <!-- Tobias Koppers -
resolve source maps that are attached in source code -->
* https://github.com/vercel/turbo/pull/7301 <!-- Donny/강동윤 -
fix(turbopack): Reverse order of css chunks to fix css module issues -->
* https://github.com/vercel/turbo/pull/7286 <!-- Tobias Koppers - guess
original source for generated code -->
2024-02-07 08:58:08 +01:00
OJ Kwon
9cadae5eef
feat(next-swc): support wasm32-* build target (#61586)
<!-- 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

### How?

Closes NEXT-
Fixes #

-->

### What?

This PR introduces a ground work to generate wasm bindings package from
our napi bindings. This doesn't actually replace anything yet, however
aim to establish our napi bindings package can be built against wasm32
target.

### Why?

We currently have two bindings package to generate native / wasm target
support, one for napi and one other for wasm. Recently napi-rs started
to support to generate bindings for the wasm directly - which means we
can get rid of the wasm-pack based bindings code entirely and maintain a
single bindings code only.

This'll makes our `next-swc` simpler as well, since the invocation to
the bindings now becomes identical we don't have to additional wasm
specific logics to invoke functions (i.e transform, transformsync..).
Also napi generates wasi-supported wasm bindings, provides few more
features to the current wasm bindings.

#### Good
- Async napi binding fn works transparently (`transform`, `minify`...)
- (Experimental) thread supports depends on node.js runtime
- Wasi support: i.e it can even read filesystem directly!

#### Things to consider
- node.js's wasi support is experimental yet
- napi-rs's wasm support is in beta yet, specifically `packaging`
generated wasm output.

Due to `things to consider` reasons, this PR does not replace existing
wasm target yet. We should be able to plan out things later.

**What happens to the turbopack api in napi bindings?**

Simply put, this **does not support turbopack in wasm**. Build works by
disabling turbopack (more notably, underlying dependency doesn't support
wasm) features. It is something to explore separately.


Closes PACK-2367


There is a branch at https://github.com/vercel/next.js/pull/61586 shows
quick demo for importing, running sync / async / read external files.
2024-02-06 10:15:13 -08:00
Leah
f910e2bdcd
chore: update turbopack (#61682)
### Turbopack Updates

* https://github.com/vercel/turbo/pull/7240 <!-- OJ Kwon -
refactor(turbopack): remove deprecated options -->
* https://github.com/vercel/turbo/pull/7241 <!-- Will Binns-Smith -
Turbopack: Fix Next.js in cross-bundler benchmarks -->
* https://github.com/vercel/turbo/pull/7274 <!-- Leah - fix(turbopack):
support reloading typescript tailwind config -->

Fixes #61607
2024-02-06 14:40:15 +01:00
OJ Kwon
b95e45a511
build(cargo): bump up turbopack (#61590)
* https://github.com/vercel/turbo/pull/7213 <!-- OJ Kwon -
feat(turbopack): extend ecmatransform moduleeffect -->
* https://github.com/vercel/turbo/pull/7219 <!-- Leah - fix(turbopack):
encode source map urls -->
* https://github.com/vercel/turbo/pull/7220 <!-- Leah -
style(turbopack): make idents more readable -->

Closes PACK-2369
2024-02-02 12:22:42 -08:00
Donny/강동윤
a77f8a9165
Update turbopack (#61553)
# Turbopack

* https://github.com/vercel/turbo/pull/7207 <!-- Donny/강동윤 -
feat(turbopack): Enable error recovery of lightningcss -->
* https://github.com/vercel/turbo/pull/7096 <!-- Tobias Koppers -
migrate type references to primary references -->
* https://github.com/vercel/turbo/pull/7225 <!-- Donny/강동윤 -
fix(turbopack): Fix css var issue and font issue when using
`lightningcss` -->

### What?

Update turbopack 

### Why?

To test https://github.com/vercel/turbo/pull/7225 against internal apps.


### How?



Closes PACK-2364
2024-02-02 08:27:00 +00:00
Donny/강동윤
fafcb5fbfe
Update turbopack (#61433)
# Turbopack

* https://github.com/vercel/turbo/pull/7167 <!-- Leah - fix: catch
import map lookup error properly in `ResolvingIssue` -->
* https://github.com/vercel/turbo/pull/7182 <!-- Donny/강동윤 - feat:
Re-enable `preset-env` mode of `styled-jsx` in turbopack -->
* https://github.com/vercel/turbo/pull/7161 <!-- Tobias Koppers - add
support for globs in sideEffects field in package.json -->
* https://github.com/vercel/turbo/pull/7184 <!-- Donny/강동윤 - chore:
Update `swc_core` to `v0.89.6` -->

### What?

Update turbopack

### Why?

To test https://github.com/vercel/turbo/pull/7182 against internal
webapps.

### How?

 - Closes #57718

Closes PACK-2334
2024-01-31 19:33:37 +09:00
Donny/강동윤
ead21691b6
chore: Update swc_core to v0.89.6 (#61426)
### What?

Update SWC crates

### Why?

To apply the latest bugfixes

### How?

Fixes #40385



Closes PACK-2332
2024-01-31 18:35:20 +09:00
Donny/강동윤
292cd0d377
Update turbopack (#61381)
# Turbopack changes
* https://github.com/vercel/turbo/pull/7160 <!-- Will Binns-Smith - Make
`EcmascriptDevChunkContent` public to other crates -->
* https://github.com/vercel/turbo/pull/7162 <!-- Tim Neutkens - Fix
sourcemap PR compile error -->
* https://github.com/vercel/turbo/pull/7163 <!-- Donny/강동윤 - fix: Revert
`preset-env` mode of `styled-jsx` in turbopack -->


### What?

Update turbopack

### Why?

To apply https://github.com/vercel/turbo/pull/7163

### How?



Closes PACK-2323
2024-01-30 14:29:12 +01:00
Leah
e4b3531377
fix(turbopack): don't parse .ts files as .tsx (#61219)
### What?

We currently parse JSX syntax in all typescript files which is wrong.

Closes PACK-2302

Turbo PR: https://github.com/vercel/turbo/pull/7121

### Turbopack Updates

* https://github.com/vercel/turbo/pull/7099 <!-- Donny/강동윤 -
fix(turbopack): Fix panic from `EcmascriptModuleFacadeModule::content`
-->
* https://github.com/vercel/turbo/pull/7121 <!-- Leah - fix(turbopack):
don't parse `.ts` files as `.tsx` -->
2024-01-29 21:13:32 +00:00
Donny/강동윤
2d9ea76af3
Update swc_core to v0.89.4 (#61285)
### What?

Update swc crates.

### Why?

To fix the build issues of vercel sites.

### How?



Closes PACK-2304
2024-01-29 02:09:44 +00:00
Donny/강동윤
7b9d90bcdc
Update swc_core to v0.89.x (#61086)
## Turbopack

* https://github.com/vercel/turbo/pull/7092 <!-- Donny/강동윤 - Update `swc_core` to `v0.89.x` -->


### What?

Update SWC crates

### Why?

To fix some issues

### How?

Fixes #59805
Fixes #56144


Closes PACK-2222
Closes PACK-2285
2024-01-27 09:43:57 +00:00
Tim Neutkens
edc658a5cc
Upgrade Turbopack (#61190)
* https://github.com/vercel/turbo/pull/7104 <!-- Will Binns-Smith -
Turbopack: use inline sourcemaps for HMR chunks -->

<!-- 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-2248
2024-01-26 10:45:25 +01:00
Leah
ae12b30464
chore: update turbopack (#61090)
### Turbopack Updates

* https://github.com/vercel/turbo/pull/7091 <!-- Tobias Koppers - lock
reqwest to 0.11.17 due to build issues -->
* https://github.com/vercel/turbo/pull/7080 <!-- Tobias Koppers - reduce
work and tasks during module analysis -->
* https://github.com/vercel/turbo/pull/7093 <!-- Leah - fix: don't
escape base path in ecmascript runtime to allow for URLs -->

Closes PACK-2282
Fixes #60891 via https://github.com/vercel/turbo/pull/7093
2024-01-24 20:44:42 +00:00
Tobias Koppers
30a5d96870
lock reqwest to 0.11.17 due to build issues (#61076)
### Why?

otherwise the build fails on aarch64-unknown-linux-gnu

build-and-deploy action:
https://github.com/vercel/next.js/actions/runs/7638354515/job/20809074561


Closes PACK-2287
2024-01-24 11:22:58 +01:00
Donny/강동윤
014b212388
Update swc_core to v0.87.28 (#60876)
# Turbopack

* https://github.com/vercel/turbo/pull/7027 <!-- Donny/강동윤 - Update `swc_core` to `v0.87.28` -->

---

### What?

Update swc crates

### Why?

Required for #57718.
`styled-jsx` crate now has a hook to transform CSS code using a
Rust-side API

### How?

Fixes #57718



Closes PACK-2256
2024-01-24 08:05:05 +00:00
Tim Neutkens
59e042a9a7
Implement client_root for edge in Turbopack (#61024)
## What?

Implements https://github.com/vercel/turbo/pull/7081. Ensures image
imports in the edge runtime have the correct asset url. Previously it
would be `/assets/file.hash.png` but it should be
`/_next/static/media/file.hash.png`.

Updates the image tests to correctly compare the values in Turbopack and
the values in Webpack. Currently it only checks webpack values, causing
the tests to fail in Turbopack.

<!-- 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-2194
2024-01-23 18:41:02 +01:00
Tobias Koppers
a7a403f498
update turbopack (#61015)
* https://github.com/vercel/turbo/pull/7067 <!-- Tobias Koppers - fix a
hanging issue with strongly consistent reads -->
* https://github.com/vercel/turbo/pull/7068 <!-- Tobias Koppers - add
lazy_remove_children feature flag -->
* https://github.com/vercel/turbo/pull/7073 <!-- OJ Kwon -
fix(ecmascript): collect recoverable error after parse -->

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2024-01-23 14:35:17 +01:00
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