RFC: Migrate Embedded JSON to Procedural Macros/Codegen in swc_ecma_preset_env #10686
magic-akari
started this conversation in
RFC
Replies: 1 comment
-
Personally, I would like to see improvements in other directions, such as getting a path to a JSON file so that the user can update the caniuse data independently of SWC. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In the
crates/swc_ecma_preset_env
directory, we extensively use theinclude_str!
macro to embed JSON files, which are then deserialized at runtime.This approach negatively impacts both runtime performance and binary size.
We could leverage procedural macros or codegen to generate Rust code directly from the JSON files at build time.
Beta Was this translation helpful? Give feedback.
All reactions