kdy1
kdy1
SDSWC Developers
Created by Shahryar on 1/12/2025 in #questions
Emitter in SWC does not add expected space after '=>' in Arrow Functions
Yeap
6 replies
SDSWC Developers
Created by Shahryar on 1/12/2025 in #questions
Emitter in SWC does not add expected space after '=>' in Arrow Functions
You should fork swc_ecma_codegen
6 replies
SDSWC Developers
Created by Shahryar on 1/10/2025 in #questions
Does SWC remove comments in the code when transforming a JS file's AST and converting it back to a c
The parser test suite also deserializes the json to ensure that serde implementation is correct.
6 replies
SDSWC Developers
Created by Shahryar on 1/10/2025 in #questions
Does SWC remove comments in the code when transforming a JS file's AST and converting it back to a c
Enable serde-impl of swc_ecma_ast and just use serde_json. Actually it's how the ES parser is tested. https://github.com/swc-project/swc/blob/6c2bb13f9d9ec522a938d8aba535a8a93758e43d/crates/swc_ecma_parser/tests/js.rs#L29-L71
6 replies
SDSWC Developers
Created by Shahryar on 1/10/2025 in #questions
Does SWC remove comments in the code when transforming a JS file's AST and converting it back to a c
Yeap, but you should use Rust API, and you should modify AST instead of the string if you want to preserve comments
6 replies
SDSWC Developers
Created by Octal! on 11/30/2024 in #questions
1:1 line number mapping
See https://rustdoc.swc.rs/swc_fast_ts_strip/fn.operate.html and related examples in the main repository
2 replies
SDSWC Developers
Created by w00t on 11/28/2024 in #questions
how to migrate from visit_mut_with to Pass?
For module, you can still use ‘visit_mut’. Alternatively you can construct Program by doing Program::Module(m) and doing expect_module
4 replies
SDSWC Developers
Created by w00t on 11/28/2024 in #questions
how to migrate from visit_mut_with to Pass?
You can use program.mutate
4 replies
SDSWC Developers
Created by Retsam19 on 11/18/2024 in #questions
Plugin panics when trying to read line number from SourceMapper
No I forgot adding 5.x, but at least 4.x cannot work due to the issue
9 replies
SDSWC Developers
Created by Retsam19 on 11/18/2024 in #questions
Plugin panics when trying to read line number from SourceMapper
You are using wrong version of swc_core
9 replies
SDSWC Developers
Created by Retsam19 on 11/18/2024 in #questions
Plugin panics when trying to read line number from SourceMapper
9 replies