Files
next.js/crates/wasm/Cargo.toml
T
Luke SandbergandGitHub f93a867d77 Update wasm and next-custom-transforms crates to Rust edition 2024 (#90350)
The `wasm` and `next-custom-transforms` crates were still on Rust edition 2018 while the rest of the crates in this repo use edition 2024. This caused a pre-commit hook conflict:

- `cargo fmt` passes the crate's own edition (2018) to `rustfmt`, which uses **case-insensitive** import sorting
- The lint-staged pre-commit hook runs `rustfmt --edition 2024 --`, which uses **ASCII order** import sorting (uppercase before lowercase)

These two sort orders disagree on items like `{custom_before_pass, TransformOptions}` vs `{TransformOptions, custom_before_pass}`, causing an infinite flip-flop: every commit would reorder imports, and the next `cargo fmt` would reorder them back.

## Changes

- Bump `crates/wasm` and `crates/next-custom-transforms` from edition 2018 to 2024
- Add `+ use<C>` precise capturing to `server_actions()` return type to satisfy edition 2024's stricter `impl Trait` lifetime capture rules
- Add `style_edition = "2024"` to `.rustfmt.toml` as a safety net so `cargo fmt` uses 2024-style formatting regardless of individual crate editions
- Reformat all affected files with `cargo fmt`
- Apply new clippy rules
2026-02-23 01:48:12 -08:00

62 lines
1.4 KiB
TOML

[package]
edition = "2024"
name = "wasm"
publish = false
version = "0.0.0"
[lib]
crate-type = ["cdylib"]
[features]
default = ["swc_v1"]
swc_v1 = []
plugin = ["swc_core/plugin_transform_host_js"]
[lints]
workspace = true
[dependencies]
anyhow = { workspace = true }
console_error_panic_hook = "0.1.6"
getrandom2 = { package="getrandom", version = "0.2", default-features = false, features = ["js"] }
getrandom3 = { package="getrandom", version = "0.3", default-features = false, features = ["wasm_js"] }
js-sys = "0.3.59"
next-custom-transforms = { workspace = true }
next-taskless = { workspace = true }
rustc-hash = { workspace = true }
serde-wasm-bindgen = "0.4.3"
serde_json = "1"
wasm-bindgen = { version = "0.2", features = ["enable-interning"] }
wasm-bindgen-futures = "0.4.8"
swc_core = { workspace = true, features = [
"common",
"common_concurrent",
"binding_macro_wasm",
"ecma_ast_serde",
"ecma_codegen",
"ecma_minifier",
"ecma_transforms",
"ecma_transforms_typescript",
"ecma_transforms_optimization",
"ecma_transforms_react",
"ecma_parser",
"ecma_parser_typescript",
"ecma_utils",
"ecma_visit",
] }
mdxjs = { workspace = true, features = ["serializable"] }
# Workaround a bug
[package.metadata.wasm-pack.profile.release]
wasm-opt = false
# Workaround a bug
[package.metadata.wasm-pack.profile.dev]
wasm-opt = false
[package.metadata.cargo-shear]
# Needed to declare the `wasm_js` feature
ignored = ["getrandom2", "getrandom3"]