Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugin): Use rmp_serde instead of rkyv #7163

Closed
wants to merge 74 commits into from
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
4c116c5
Drop rkyv
kdy1 Mar 29, 2023
79cbf66
Drop rkyv
kdy1 Mar 29, 2023
014046e
Drop rkyv
kdy1 Mar 29, 2023
04c4247
More fix
kdy1 Mar 29, 2023
f7c7c2e
Remove bytecheck
kdy1 Mar 29, 2023
ba5f426
lockfile
kdy1 Mar 29, 2023
991ff77
Remove features related to rkyv
kdy1 Mar 29, 2023
7c86efd
IDE
kdy1 Mar 29, 2023
fdce2d1
lockfile
kdy1 Mar 29, 2023
6d8d515
IDE
kdy1 Mar 29, 2023
3717c85
IDE
kdy1 Mar 29, 2023
4d2619e
rmp_serde
kdy1 Mar 29, 2023
4db1e00
lockfile
kdy1 Mar 29, 2023
64dc467
Fix more
kdy1 Mar 29, 2023
0df9522
Fix swc_common
kdy1 Mar 29, 2023
e9dc908
Remove rkyv from ast_node
kdy1 Mar 29, 2023
36746c8
Remove rkyv from ast_node
kdy1 Mar 29, 2023
b7e0fd5
feature
kdy1 Mar 29, 2023
6e8a21b
Fix swc_atoms
kdy1 Mar 29, 2023
7c04f7f
Fix swc_atoms
kdy1 Mar 29, 2023
91bac6b
Fix swc_common
kdy1 Mar 29, 2023
21340f3
Fix swc_common
kdy1 Mar 29, 2023
bc764a4
Fix more
kdy1 Mar 29, 2023
fcc9325
Fix more
kdy1 Mar 29, 2023
17486e7
Fix more
kdy1 Mar 29, 2023
b677efd
Fix more
kdy1 Mar 29, 2023
a771881
Fix more
kdy1 Mar 29, 2023
e426a92
Fix more
kdy1 Mar 29, 2023
e760e1f
Fix more
kdy1 Mar 29, 2023
4cfda6f
Fix more
kdy1 Mar 29, 2023
a9e352c
Fix more
kdy1 Mar 29, 2023
be51e30
Fix more
kdy1 Mar 29, 2023
f7ab83f
Fix more
kdy1 Mar 29, 2023
83c9ee8
Enable serde of url
kdy1 Mar 29, 2023
fe70308
lockfile
kdy1 Mar 29, 2023
cb2a09f
Fix more
kdy1 Mar 29, 2023
3565321
Fix more
kdy1 Mar 29, 2023
9057e0d
Fix more
kdy1 Mar 29, 2023
6f6e040
Fix more
kdy1 Mar 29, 2023
cfc0fda
Dep on serde
kdy1 Mar 29, 2023
29bedf0
lockfile
kdy1 Mar 29, 2023
33d90ca
serde
kdy1 Mar 29, 2023
72966be
Fix more
kdy1 Mar 29, 2023
aa5ee67
Features
kdy1 Mar 29, 2023
0290a23
Feature
kdy1 Mar 29, 2023
02c8443
More fix
kdy1 Mar 29, 2023
032a1a3
Feature
kdy1 Mar 29, 2023
d8ad375
Fix rmp_serde
kdy1 Mar 30, 2023
7d8ff83
Force latest serde
kdy1 Mar 30, 2023
cb5feb0
lockfile
kdy1 Mar 30, 2023
1babe40
Profile only invocation
kdy1 Mar 30, 2023
8d895a5
Fix bench.sh
kdy1 Mar 30, 2023
6c366f2
Fix CI
kdy1 Mar 30, 2023
a23cf1a
Drop rkyv
kdy1 Mar 30, 2023
57b72a6
clippy
kdy1 Mar 30, 2023
e22f2f6
Fix test
kdy1 Mar 30, 2023
12d84fe
Print error
kdy1 Mar 30, 2023
9c414a2
Fix CSS ast
kdy1 Mar 30, 2023
4769cec
Fix CSS ast
kdy1 Mar 30, 2023
4fb420a
Fix CSS ast
kdy1 Mar 30, 2023
1539594
Fix CSS ast
kdy1 Mar 30, 2023
f839e4f
Fix CSS ast
kdy1 Mar 30, 2023
5b20c5d
Fix CSS ast
kdy1 Mar 30, 2023
a0ac150
Fix CSS ast
kdy1 Mar 30, 2023
07536c8
Ignore serde issue for now
kdy1 Mar 30, 2023
3d764eb
Fix CSS ast
kdy1 Mar 30, 2023
460d967
Fix CSS ast
kdy1 Mar 30, 2023
35fea1a
skip
kdy1 Mar 30, 2023
7d90aa1
Fix CSS ast
kdy1 Mar 30, 2023
474325a
Fix CSS ast
kdy1 Mar 30, 2023
706a00b
Fix CSS ast
kdy1 Mar 30, 2023
747783e
Fix CSS ast
kdy1 Mar 30, 2023
3c5ba8e
Fix CSS ast
kdy1 Mar 30, 2023
fe80a95
Update test refs
kdy1 Mar 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions .vscode/settings.json
Expand Up @@ -27,13 +27,11 @@
"rust-analyzer.check.features": [
// We use this to make IDE faster
"rust-analyzer",
"rkyv-impl",
"debug"
],
"rust-analyzer.cargo.features": [
// We use this to make IDE faster
"rust-analyzer",
"rkyv-impl",
"debug"
]
}
40 changes: 0 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions bindings/binding_core_node/Cargo.toml
Expand Up @@ -18,14 +18,6 @@ plugin = ["swc_core/plugin_transform_host_native"]
swc_v1 = ["swc_core/bundler_node_v1"]
swc_v2 = ["swc_core/bundler_node_v2"]

# Experiemntal bytechecked plugin serialization / deserialization.
plugin_bytecheck = [
# We know what we're doing - enable internal features for the host plugin setup.
# "swc_core/__plugin_transform_host_bytecheck",
"swc_core/__plugin_transform_host_schema_v1",
"swc_core/__plugin_transform_env_native",
]

# Internal flag for testing purpose only.
__plugin_transform_vtest = [
# We know what we're doing - enable internal features for testing fixture setup.
Expand Down
10 changes: 1 addition & 9 deletions crates/swc/Cargo.toml
Expand Up @@ -28,15 +28,7 @@ debug = ["swc_ecma_visit/debug"]
default = ["es3"]
es3 = []
node = ["napi", "napi-derive"]
plugin = [
"swc_plugin_runner/ecma",
"swc_plugin_runner/rkyv-impl",
"swc_plugin_proxy/plugin-rt",
]
plugin-bytecheck = [
"swc_plugin_runner/rkyv-bytecheck-impl",
"swc_plugin_proxy/plugin-bytecheck-rt",
]
plugin = ["swc_plugin_runner/ecma", "swc_plugin_proxy/plugin-rt"]
plugin_transform_schema_v1 = [
"swc_common/plugin_transform_schema_v1",
"swc_plugin_runner/plugin_transform_schema_v1",
Expand Down
12 changes: 1 addition & 11 deletions crates/swc_atoms/Cargo.toml
Expand Up @@ -13,19 +13,9 @@ version = "0.4.41"
bench = false

[features]
__rkyv = []
# Enably rkyv serialization with stable version of rkyv.
rkyv-impl = ["__rkyv", "rkyv"]
# Enable rkyv serialization with updated version of rkyv, along with bytecheck.
rkyv-bytecheck-impl = ["__rkyv", "rkyv-latest"]

[dependencies]
bytecheck = { version = "0.6.9", optional = true }
once_cell = "1"
rkyv = { package = "rkyv", version = "=0.7.37", optional = true }
# This is to avoid cargo version selection conflict between rkyv=0.7.37 and other versions, as it is strictly pinned
# cannot be merged.
rkyv-latest = { package = "rkyv-test", version = "=0.7.38-test.2", optional = true }
once_cell = "1"
rustc-hash = "1.1.0"
serde = "1"
string_cache = "0.8.7"
Expand Down
40 changes: 10 additions & 30 deletions crates/swc_common/Cargo.toml
Expand Up @@ -24,55 +24,35 @@ debug = []
default = []
diagnostic-serde = []
perf = ["parking_lot"]
plugin-base = ["__plugin", "anyhow", "rkyv-impl", "diagnostic-serde"]
plugin-base = ["__plugin", "anyhow", "diagnostic-serde"]
plugin-mode = ["__plugin_mode", "plugin-base"]
plugin-rt = ["__plugin_rt", "plugin-base"]

plugin-bytecheck-base = [
"__plugin",
"anyhow",
"rkyv-bytecheck-impl",
"diagnostic-serde",
]
plugin-bytecheck-mode = ["__plugin_mode", "plugin-bytecheck-base"]
plugin-bytecheck-rt = ["__plugin_rt", "plugin-bytecheck-base"]

plugin_transform_schema_v1 = []
plugin_transform_schema_vtest = []

tty-emitter = ["atty", "termcolor"]

__rkyv = []
# Enably rkyv serialization with stable version of rkyv.
rkyv-impl = ["__rkyv", "rkyv", "swc_atoms/rkyv-impl"]
# Enable rkyv serialization with updated version of rkyv, along with bytecheck.
rkyv-bytecheck-impl = ["__rkyv", "rkyv-latest", "swc_atoms/rkyv-bytecheck-impl"]

[dependencies]
ahash = "0.7.4"
anyhow = { version = "1.0.45", optional = true }
arbitrary = { version = "1", optional = true, features = ["derive"] }
atty = { version = "0.2", optional = true }
bytecheck = { version = "0.6.9", optional = true }
cfg-if = "1.0.0"
either = "1.5"
new_debug_unreachable = "1.0.4"
num-bigint = "0.4"
once_cell = "1.10.0"
parking_lot = { version = "0.12.0", optional = true }
rkyv = { version = "=0.7.37", optional = true }
# This is to avoid cargo version selection conflict between rkyv=0.7.37 and other versions, as it is strictly pinned
# cannot be merged.
rkyv-latest = { package = "rkyv-test", version = "=0.7.38-test.2", optional = true }
rustc-hash = "1.1.0"
serde = { version = "1.0.119", features = ["derive"] }
siphasher = "0.3.9"
sourcemap = { version = "6", optional = true }
string_cache = "0.8.7"
termcolor = { version = "1.0", optional = true }
tracing = "0.1.32"
unicode-width = "0.1.4"
url = "2.2.2"
rustc-hash = "1.1.0"
serde = { version = "1.0.119", features = ["derive"] }
siphasher = "0.3.9"
sourcemap = { version = "6", optional = true }
string_cache = "0.8.7"
termcolor = { version = "1.0", optional = true }
tracing = "0.1.32"
unicode-width = "0.1.4"
url = "2.2.2"

ast_node = { version = "0.9.0", path = "../ast_node" }
better_scoped_tls = { version = "0.1.0", path = "../better_scoped_tls" }
Expand Down
32 changes: 1 addition & 31 deletions crates/swc_core/Cargo.toml
Expand Up @@ -234,7 +234,6 @@ __common_plugin_transform = [
# Dependent features
"ecma_visit",
"__common",
"swc_atoms/rkyv-impl",
"swc_common/plugin-mode",
"swc_plugin_proxy/plugin-mode",
"swc_plugin_macro",
Expand All @@ -247,52 +246,23 @@ __css_plugin_transform = [
"__common_plugin_transform",
"css_visit",
"css_ast", # Enable optional packages
"swc_css_ast/rkyv-impl",
]
__ecma_plugin_transform = [
# Dependent features
"__common_plugin_transform",
"ecma_visit",
"ecma_ast", # Enable optional packages
"swc_ecma_ast/rkyv-impl",
]

__plugin_transform_bytecheck = [
# Dependent features
"ecma_visit",
"__common",
"ecma_ast",
"swc_ecma_ast/rkyv-bytecheck-impl",
"swc_atoms/rkyv-bytecheck-impl",
"swc_common/plugin-bytecheck-mode",
"swc_plugin_proxy/plugin-bytecheck-mode",
"swc_plugin_macro",
"swc_plugin",
"once_cell",
]

# Internal flags for any transform plugin host feature
__plugin_transform_host = [
# Dependent features
"__common", # Enable optional packages
"swc_ecma_ast/rkyv-impl",
"swc_atoms/rkyv-impl",
"__common", # Enable optional packages
"swc_common/plugin-rt",
"swc_plugin_runner/rkyv-impl", # TODO: we may simply flag around downlevel plugin feature
"swc_plugin_proxy/plugin-rt",
"swc/plugin",
]

# Internal flags for the transform plugin host, if it needs to enable bytecheck
__plugin_transform_host_bytecheck = [
"__common",
"swc_atoms/rkyv-bytecheck-impl",
"swc_common/plugin-bytecheck-rt",
"swc_ecma_ast/rkyv-bytecheck-impl",
"swc_plugin_proxy/plugin-bytecheck-rt",
"swc/plugin-bytecheck",
]

# Internal flags to control plugin environment
__plugin_transform_env_native = [
"swc_plugin_runner/filesystem_cache",
Expand Down
7 changes: 0 additions & 7 deletions crates/swc_core/tests/fixture/stub_napi/Cargo.toml
Expand Up @@ -15,13 +15,6 @@ plugin = ["swc_core/plugin_transform_host_native"]
swc_v1 = ["swc_core/bundler_node_v1"]
swc_v2 = ["swc_core/bundler_node_v2"]

# Experiemntal bytechecked plugin serialization / deserialization.
plugin_bytecheck = [
# "swc_core/__plugin_transform_host_bytecheck",
"swc_core/__plugin_transform_host_schema_v1",
"swc_core/__plugin_transform_env_native",
]

# Internal flag for testing purpose only.
__plugin_transform_vtest = [
"swc_core/__plugin_transform_host",
Expand Down
13 changes: 4 additions & 9 deletions crates/swc_css_ast/Cargo.toml
Expand Up @@ -12,17 +12,12 @@ version = "0.136.2"
bench = false

[features]
__rkyv = []
default = []
rkyv-bytecheck-impl = []
rkyv-impl = ["__rkyv", "rkyv", "swc_atoms/rkyv-impl", "swc_common/rkyv-impl"]
serde-impl = ["serde"]
default = []
serde-impl = ["serde"]

[dependencies]
bytecheck = { version = "0.6.9", optional = true }
is-macro = "0.2.0"
rkyv = { version = "=0.7.37", optional = true }
serde = { version = "1.0.127", features = ["derive"], optional = true }
is-macro = "0.2.0"
serde = { version = "1.0.127", features = ["derive"], optional = true }

string_enum = { version = "0.4.0", path = "../string_enum/" }
swc_atoms = { version = "0.4.41", path = "../swc_atoms" }
Expand Down
25 changes: 5 additions & 20 deletions crates/swc_ecma_ast/Cargo.toml
Expand Up @@ -16,33 +16,18 @@ version = "0.102.2"
bench = false

[features]
__rkyv = []
default = []
fuzzing = ["arbitrary", "swc_common/arbitrary"]
# Enably rkyv serialization with stable version of rkyv.
rkyv-impl = ["__rkyv", "rkyv", "swc_atoms/rkyv-impl", "swc_common/rkyv-impl"]
# Enable rkyv serialization with updated version of rkyv, along with bytecheck.
rkyv-bytecheck-impl = [
"__rkyv",
"rkyv-latest",
"swc_atoms/rkyv-bytecheck-impl",
"swc_common/rkyv-bytecheck-impl",
]
default = []
fuzzing = ["arbitrary", "swc_common/arbitrary"]
serde-impl = ["serde"]

[dependencies]
arbitrary = { version = "1", optional = true, features = ["derive"] }
bitflags = "1"
bytecheck = { version = "0.6.9", optional = true }
is-macro = "0.2.1"
num-bigint = { version = "0.4", features = ["serde"] }
rkyv = { package = "rkyv", version = "=0.7.37", optional = true }
# This is to avoid cargo version selection conflict between rkyv=0.7.37 and other versions, as it is strictly pinned
# cannot be merged.
rkyv-latest = { package = "rkyv-test", version = "=0.7.38-test.2", optional = true }
scoped-tls = "1.0.0"
serde = { version = "1.0.133", features = ["derive"], optional = true }
unicode-id = "0.3"
scoped-tls = "1.0.0"
serde = { version = "1.0.133", features = ["derive"], optional = true }
unicode-id = "0.3"

string_enum = { version = "0.4.0", path = "../string_enum" }
swc_atoms = { version = "0.4.41", path = "../swc_atoms" }
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_ecmascript/Cargo.toml
Expand Up @@ -24,7 +24,7 @@ minifier = ["swc_ecma_minifier"]
parser = ["swc_ecma_parser"]
preset_env = ["swc_ecma_preset_env"]
quote = ["swc_ecma_quote"]
rkyv-impl = ["swc_ecma_ast/rkyv-impl"]
serde-impl = ["swc_ecma_ast/serde-impl"]
transforms = ["swc_ecma_transforms"]
utils = ["swc_ecma_utils"]
visit = ["swc_ecma_visit"]
Expand Down