2021-11-17 20:01:02 +01:00
|
|
|
[workspace]
|
2023-08-12 00:16:41 +02:00
|
|
|
resolver = "2"
|
2021-07-27 17:07:28 +02:00
|
|
|
|
2023-03-10 21:59:54 +01:00
|
|
|
members = [
|
2023-05-12 12:28:41 +02:00
|
|
|
"scripts/send-trace-to-jaeger",
|
2023-04-19 18:38:36 +02:00
|
|
|
"packages/next-swc/crates/napi",
|
|
|
|
"packages/next-swc/crates/wasm",
|
2023-07-13 19:17:38 +02:00
|
|
|
"packages/next-swc/crates/next-api",
|
2024-06-15 12:04:29 +02:00
|
|
|
"packages/next-swc/crates/next-build-test",
|
2023-04-19 18:38:36 +02:00
|
|
|
"packages/next-swc/crates/next-build",
|
|
|
|
"packages/next-swc/crates/next-core",
|
2024-01-23 12:00:36 +01:00
|
|
|
"packages/next-swc/crates/next-custom-transforms",
|
2023-03-10 21:59:54 +01:00
|
|
|
]
|
2021-08-03 18:54:57 +02:00
|
|
|
|
2023-11-18 01:29:50 +01:00
|
|
|
[workspace.lints.clippy]
|
|
|
|
too_many_arguments = "allow"
|
|
|
|
|
2022-09-29 16:09:20 +02:00
|
|
|
# This is a workaround for wasm timeout issue
|
|
|
|
[profile.dev.package."*"]
|
|
|
|
debug-assertions = false
|
|
|
|
|
2023-08-12 00:16:41 +02:00
|
|
|
# Set the settings for build scripts and proc-macros.
|
|
|
|
[profile.dev.build-override]
|
|
|
|
opt-level = 3
|
2023-03-10 21:59:54 +01:00
|
|
|
|
|
|
|
[workspace.dependencies]
|
|
|
|
# Workspace crates
|
2024-01-11 09:07:56 +01:00
|
|
|
next-api = { path = "packages/next-swc/crates/next-api" }
|
|
|
|
next-build = { path = "packages/next-swc/crates/next-build" }
|
|
|
|
next-core = { path = "packages/next-swc/crates/next-core" }
|
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
https://github.com/vercel/next.js/pull/60400/commits/2cedd06ea55f71478206d60f832acc3cd5763362
:
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 21:23:47 +01:00
|
|
|
next-custom-transforms = { path = "packages/next-swc/crates/next-custom-transforms" }
|
2023-03-10 21:59:54 +01:00
|
|
|
|
|
|
|
# SWC crates
|
2024-06-21 18:58:11 +02:00
|
|
|
swc_core = { version = "0.95.4", features = [
|
2023-09-15 17:41:05 +02:00
|
|
|
"ecma_loader_lru",
|
|
|
|
"ecma_loader_parking_lot",
|
|
|
|
] }
|
2024-06-21 04:53:09 +02:00
|
|
|
testing = { version = "0.36.0" }
|
2023-03-10 21:59:54 +01:00
|
|
|
|
|
|
|
# Turbo crates
|
2024-07-03 06:45:54 +02:00
|
|
|
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240703.1" }
|
2023-03-30 05:25:11 +02:00
|
|
|
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
|
2024-07-03 06:45:54 +02:00
|
|
|
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240703.1" }
|
2023-03-30 05:25:11 +02:00
|
|
|
# [TODO]: need to refactor embed_directory! macro usage in next-core
|
2024-07-03 06:45:54 +02:00
|
|
|
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240703.1" }
|
2023-03-10 21:59:54 +01:00
|
|
|
|
|
|
|
# General Deps
|
|
|
|
|
|
|
|
# Be careful when selecting tls backend, including change default tls backend.
|
|
|
|
# If you changed, must verify with ALL build targets with next-swc to ensure
|
|
|
|
# it works. next-swc have various platforms, some doesn't support native (using openssl-sys)
|
|
|
|
# and some aren't buildable with rustls.
|
2024-01-24 11:22:58 +01:00
|
|
|
reqwest = { version = "=0.11.17", default-features = false }
|
2023-03-10 21:59:54 +01:00
|
|
|
|
2023-06-12 16:47:43 +02:00
|
|
|
chromiumoxide = { version = "0.5.0", features = [
|
2023-03-10 21:59:54 +01:00
|
|
|
"tokio-runtime",
|
|
|
|
], default-features = false }
|
|
|
|
# For matching on errors from chromiumoxide. Keep in
|
|
|
|
# sync with chromiumoxide's tungstenite requirement.
|
2023-06-12 16:47:43 +02:00
|
|
|
tungstenite = "0.18.0"
|
2023-03-10 21:59:54 +01:00
|
|
|
|
2023-03-28 03:22:48 +02:00
|
|
|
# flate2_zlib requires zlib, use flate2_rust
|
2024-06-01 05:37:04 +02:00
|
|
|
allsorts = { version = "0.14.0", default-features = false, features = [
|
2023-03-31 20:58:04 +02:00
|
|
|
"outline",
|
|
|
|
"flate2_rust",
|
|
|
|
] }
|
2023-03-10 21:59:54 +01:00
|
|
|
anyhow = "1.0.69"
|
|
|
|
assert_cmd = "2.0.8"
|
|
|
|
async-compression = { version = "0.3.13", default-features = false, features = [
|
|
|
|
"gzip",
|
|
|
|
"tokio",
|
|
|
|
] }
|
Turbopack: App Router build POC (#52036)
This PR adds proof-of-concept support for the App Router to `next build
--experimental-turbo`.
It introduces a new way to generate Next.js manifests in Turbopack.
Currently, in dev, we pass proxy objects in lieu of manifests, and rely
on the entries to know which chunks they need loaded on the client.
However, this can't work for builds because it requires control over
Next.js rendering, which is not compatible with a Next->Turbo approach.
We would need to modify Next.js to support these "lazy" entries. So for
now, we add well-known assets (`NextDynamicAsset`,
`NextServerComponentAsset`, `NextClientReferenceAsset`, etc.) to the
graph, which will get picked up when walking it during asset processing.
This lets us collect all possible entries before chunking.
This two-step process (collecting all entries, then chunking them) is
also a good first step towards production chunking.
## Turbopack updates
* https://github.com/vercel/turbo/pull/5494 <!-- Tobias Koppers - add
reporting of console messages -->
* https://github.com/vercel/turbo/pull/5448 <!-- Alex Kirszenberg -
Misc. changes to support App Router build -->
2023-07-12 11:26:48 +02:00
|
|
|
async-recursion = "1.0.2"
|
2023-03-10 21:59:54 +01:00
|
|
|
async-trait = "0.1.64"
|
|
|
|
atty = "0.2.14"
|
|
|
|
chrono = "0.4.23"
|
|
|
|
concurrent-queue = "2.1.0"
|
|
|
|
console = "0.15.5"
|
|
|
|
console-subscriber = "0.1.8"
|
|
|
|
criterion = "0.4.0"
|
2023-05-23 07:25:56 +02:00
|
|
|
crossbeam-channel = "0.5.8"
|
2023-03-10 21:59:54 +01:00
|
|
|
dashmap = "5.4.0"
|
|
|
|
dialoguer = "0.10.3"
|
|
|
|
dunce = "1.0.3"
|
|
|
|
futures = "0.3.26"
|
|
|
|
futures-retry = "0.6.0"
|
2023-09-18 11:48:36 +02:00
|
|
|
httpmock = { version = "0.6.8", default-features = false }
|
2023-03-10 21:59:54 +01:00
|
|
|
indexmap = "1.9.2"
|
|
|
|
indicatif = "0.17.3"
|
|
|
|
indoc = "2.0.0"
|
|
|
|
itertools = "0.10.5"
|
|
|
|
lazy_static = "1.4.0"
|
|
|
|
log = "0.4.17"
|
2024-05-28 22:49:01 +02:00
|
|
|
lightningcss = { version = "1.0.0-alpha.57", features = [
|
2024-01-24 09:05:05 +01:00
|
|
|
"serde",
|
|
|
|
"visitor",
|
|
|
|
"into_owned",
|
|
|
|
] }
|
2024-05-21 20:28:59 +02:00
|
|
|
lightningcss-napi = { version = "0.2.0", default-features = false, features = [
|
2024-02-28 22:45:02 +01:00
|
|
|
"visitor"
|
|
|
|
]}
|
2023-03-10 21:59:54 +01:00
|
|
|
mime = "0.3.16"
|
|
|
|
nohash-hasher = "0.2.0"
|
|
|
|
once_cell = "1.17.1"
|
|
|
|
owo-colors = "3.5.0"
|
2024-01-24 09:05:05 +01:00
|
|
|
parcel_selectors = "0.26.0"
|
2023-03-10 21:59:54 +01:00
|
|
|
parking_lot = "0.12.1"
|
|
|
|
pathdiff = "0.2.1"
|
2024-04-05 01:28:02 +02:00
|
|
|
# Temporary: Reference the latest git minor version of pathfinder_simd until it's published.
|
|
|
|
pathfinder_simd = "0.5.3"
|
2023-03-10 21:59:54 +01:00
|
|
|
pin-project-lite = "0.2.9"
|
2023-05-23 07:25:56 +02:00
|
|
|
postcard = "1.0.4"
|
2023-03-10 21:59:54 +01:00
|
|
|
predicates = "2.1.5"
|
|
|
|
pretty_assertions = "1.3.0"
|
2024-03-12 21:50:10 +01:00
|
|
|
proc-macro2 = "1.0.79"
|
2023-03-10 21:59:54 +01:00
|
|
|
qstring = "0.7.2"
|
|
|
|
quote = "1.0.23"
|
|
|
|
rand = "0.8.5"
|
|
|
|
regex = "1.7.0"
|
|
|
|
rstest = "0.16.0"
|
|
|
|
rustc-hash = "1.1.0"
|
|
|
|
semver = "1.0.16"
|
|
|
|
serde = { version = "1.0.152", features = ["derive"] }
|
|
|
|
serde_json = "1.0.93"
|
|
|
|
serde_qs = "0.11.0"
|
|
|
|
serde_yaml = "0.9.17"
|
2023-08-17 19:29:30 +02:00
|
|
|
shadow-rs = { version = "0.23.0", default-features = false, features = [
|
|
|
|
"tzdb",
|
|
|
|
] }
|
2023-03-10 21:59:54 +01:00
|
|
|
syn = "1.0.107"
|
|
|
|
tempfile = "3.3.0"
|
2023-09-28 09:40:21 +02:00
|
|
|
thiserror = "1.0.48"
|
2023-03-10 21:59:54 +01:00
|
|
|
tiny-gradient = "0.1.0"
|
|
|
|
tokio = "1.25.0"
|
|
|
|
tokio-util = { version = "0.7.7", features = ["io"] }
|
|
|
|
tracing = "0.1.37"
|
2023-05-23 07:25:56 +02:00
|
|
|
tracing-subscriber = "0.3.16"
|
2023-03-10 21:59:54 +01:00
|
|
|
url = "2.2.2"
|
|
|
|
urlencoding = "2.1.2"
|
|
|
|
webbrowser = "0.8.7"
|
2023-03-31 10:37:17 +02:00
|
|
|
dhat = { version = "0.3.2" }
|
2023-11-20 18:09:36 +01:00
|
|
|
|
2024-04-05 01:28:02 +02:00
|
|
|
# Sync with the entries in turbo's Cargo.toml
|
|
|
|
[patch.crates-io]
|
2024-06-01 05:37:04 +02:00
|
|
|
# TODO: Use upstream when https://github.com/servo/pathfinder/pull/566 lands
|
|
|
|
pathfinder_simd = { git = "https://github.com/vercel/pathfinder", branch = "rm-stdarch_arm_crc32"}
|