Unverified Commit 3b346024 authored by OJ Kwon's avatar OJ Kwon Committed by GitHub

build(next/swc): consolidate swc_core dependency version (#41043)

<!--
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 that you're making:
-->

This PR utilizes cargo's new feature from latest release (1.64.0),
inheriting dependency from a workspace.

In short, top-level workspace cargo manifest can specify a version of
dependency to use, then actual packages uses it without re-declaring
version per each via workspace = true. This will help to dedupe
different versions of packages, also potentially avoid conflicts if
forgot to bump up specific versions.

In this pr only touches swc_core, which is a base dependency we use in
several place. One another benefit for this is bump up PR can be lot
more simplified, only need to update single Cargo.toml when we bump up.

Note rust-toolchain has updated to use nightly version after 1.64.0 to
enable this.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
parent cae96f27
...@@ -9,7 +9,7 @@ name: Build, test, and deploy ...@@ -9,7 +9,7 @@ name: Build, test, and deploy
env: env:
NAPI_CLI_VERSION: 2.7.0 NAPI_CLI_VERSION: 2.7.0
TURBO_VERSION: 1.3.2-canary.1 TURBO_VERSION: 1.3.2-canary.1
RUST_TOOLCHAIN: nightly-2022-09-14 RUST_TOOLCHAIN: nightly-2022-09-23
PNPM_VERSION: 7.2.1 PNPM_VERSION: 7.2.1
jobs: jobs:
......
...@@ -7,7 +7,7 @@ name: Generate Pull Request Stats ...@@ -7,7 +7,7 @@ name: Generate Pull Request Stats
env: env:
NAPI_CLI_VERSION: 2.7.0 NAPI_CLI_VERSION: 2.7.0
TURBO_VERSION: 1.3.2-canary.1 TURBO_VERSION: 1.3.2-canary.1
RUST_TOOLCHAIN: nightly-2022-02-23 RUST_TOOLCHAIN: nightly-2022-09-23
PNPM_VERSION: 7.2.1 PNPM_VERSION: 7.2.1
jobs: jobs:
...@@ -39,7 +39,7 @@ jobs: ...@@ -39,7 +39,7 @@ jobs:
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }} if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
with: with:
profile: minimal profile: minimal
toolchain: nightly-2021-11-15 toolchain: nightly-2022-09-23
- name: Cache cargo registry - name: Cache cargo registry
uses: actions/cache@v1 uses: actions/cache@v1
......
...@@ -14,4 +14,9 @@ opt-level = 2 ...@@ -14,4 +14,9 @@ opt-level = 2
debug-assertions = false debug-assertions = false
[profile.release] [profile.release]
lto = true lto = true
\ No newline at end of file
# Declare dependencies used across workspace packages requires single version bump.
# ref: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#inheriting-a-dependency-from-a-workspace
[workspace.dependencies]
swc_core = "0.28.10"
\ No newline at end of file
...@@ -28,7 +28,7 @@ styled_jsx = {path="../styled_jsx"} ...@@ -28,7 +28,7 @@ styled_jsx = {path="../styled_jsx"}
modularize_imports = {path="../modularize_imports"} modularize_imports = {path="../modularize_imports"}
tracing = { version = "0.1.32", features = ["release_max_level_info"] } tracing = { version = "0.1.32", features = ["release_max_level_info"] }
swc_core = { version = "0.28.10", features = [ swc_core = { workspace = true, features = [
"common_concurrent", "common_concurrent",
"ecma_ast", "ecma_ast",
"ecma_visit", "ecma_visit",
...@@ -48,6 +48,6 @@ swc_core = { version = "0.28.10", features = [ ...@@ -48,6 +48,6 @@ swc_core = { version = "0.28.10", features = [
] } ] }
[dev-dependencies] [dev-dependencies]
swc_core = { version = "0.28.10", features = ["testing_transform"] } swc_core = { workspace = true, features = ["testing_transform"] }
testing = "0.31.3" testing = "0.31.3"
walkdir = "2.3.2" walkdir = "2.3.2"
...@@ -19,9 +19,9 @@ regex = "1.5" ...@@ -19,9 +19,9 @@ regex = "1.5"
serde = "1" serde = "1"
sourcemap = "6.0.1" sourcemap = "6.0.1"
tracing = { version = "0.1.32", features = ["release_max_level_info"] } tracing = { version = "0.1.32", features = ["release_max_level_info"] }
swc_core = { version = "0.28.10", features = ["common", "ecma_ast","ecma_codegen", "ecma_utils", "ecma_visit", "trace_macro"] } swc_core = { workspace = true, features = ["common", "ecma_ast","ecma_codegen", "ecma_utils", "ecma_visit", "trace_macro"] }
[dev-dependencies] [dev-dependencies]
swc_core = { version = "0.28.10", features = ["testing_transform", "ecma_transforms_react"] } swc_core = { workspace = true, features = ["testing_transform", "ecma_transforms_react"] }
testing = "0.31.3" testing = "0.31.3"
serde_json = "1" serde_json = "1"
...@@ -15,8 +15,8 @@ handlebars = "4.2.1" ...@@ -15,8 +15,8 @@ handlebars = "4.2.1"
once_cell = "1.13.0" once_cell = "1.13.0"
regex = "1.5" regex = "1.5"
serde = "1" serde = "1"
swc_core = { version = "0.28.10", features = ["cached", "ecma_ast", "ecma_visit"] } swc_core = { workspace = true, features = ["cached", "ecma_ast", "ecma_visit"] }
[dev-dependencies] [dev-dependencies]
swc_core = { version = "0.28.10", features = ["testing_transform"] } swc_core = { workspace = true, features = ["testing_transform"] }
testing = "0.31.3" testing = "0.31.3"
...@@ -30,7 +30,7 @@ next-swc = {version = "0.0.0", path = "../core"} ...@@ -30,7 +30,7 @@ next-swc = {version = "0.0.0", path = "../core"}
once_cell = "1.13.0" once_cell = "1.13.0"
serde = "1" serde = "1"
serde_json = "1" serde_json = "1"
swc_core = { version = "0.28.10", features = [ swc_core = { workspace = true, features = [
"allocator_node", "allocator_node",
"base_concurrent", # concurrent? "base_concurrent", # concurrent?
"common_concurrent", "common_concurrent",
......
...@@ -16,7 +16,7 @@ once_cell = "1.13.0" ...@@ -16,7 +16,7 @@ once_cell = "1.13.0"
regex = {version = "1.5.4", features = ["std", "perf"], default-features = false} regex = {version = "1.5.4", features = ["std", "perf"], default-features = false}
serde = {version = "1.0.130", features = ["derive"]} serde = {version = "1.0.130", features = ["derive"]}
tracing = "0.1.32" tracing = "0.1.32"
swc_core = { version = "0.28.10", features = [ swc_core = { workspace = true, features = [
"common", "common",
"ecma_ast", "ecma_ast",
"ecma_utils", "ecma_utils",
...@@ -26,7 +26,7 @@ swc_core = { version = "0.28.10", features = [ ...@@ -26,7 +26,7 @@ swc_core = { version = "0.28.10", features = [
[dev-dependencies] [dev-dependencies]
serde_json = "1" serde_json = "1"
testing = "0.31.3" testing = "0.31.3"
swc_core = { version = "0.28.10", features = [ swc_core = { workspace = true, features = [
"ecma_parser", "ecma_parser",
"ecma_transforms", "ecma_transforms",
"testing_transform" "testing_transform"
......
...@@ -13,7 +13,7 @@ version = "0.20.0" ...@@ -13,7 +13,7 @@ version = "0.20.0"
easy-error = "1.0.0" easy-error = "1.0.0"
tracing = "0.1.32" tracing = "0.1.32"
swc_core = { version = "0.28.10", features = [ swc_core = { workspace = true, features = [
"common", "common",
"css_ast", "css_ast",
"css_codegen", "css_codegen",
...@@ -28,6 +28,6 @@ swc_core = { version = "0.28.10", features = [ ...@@ -28,6 +28,6 @@ swc_core = { version = "0.28.10", features = [
[dev-dependencies] [dev-dependencies]
testing = "0.31.3" testing = "0.31.3"
swc_core = { version = "0.28.10", features = [ swc_core = { workspace = true, features = [
"testing_transform" "testing_transform"
] } ] }
...@@ -32,7 +32,7 @@ getrandom = { version = "0.2.5", optional = true, default-features = false } ...@@ -32,7 +32,7 @@ getrandom = { version = "0.2.5", optional = true, default-features = false }
js-sys = "0.3.59" js-sys = "0.3.59"
serde-wasm-bindgen = "0.4.3" serde-wasm-bindgen = "0.4.3"
swc_core = { version = "0.28.10", features = [ swc_core = { workspace = true, features = [
"common_concurrent", "common_concurrent",
"binding_macro_wasm", "binding_macro_wasm",
"ecma_codegen", "ecma_codegen",
......
nightly-2022-09-14 nightly-2022-09-23
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment