We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I want to rewrite the decorators device through the plugin to meet the decorators specifications, but it has been rewritten by SWC before the plugin
source code: @customElement("page-home") @adoptedStyle(style) export class PageHomeElement extends GemElement { @memo() get #content() { return 0; } }
plugin:
impl VisitMut for TransformVisitor { noop_visit_mut_type!(); fn visit_mut_private_method(&mut self, node: &mut PrivateMethod) { panic!("{:?}", node); } }
### Config ```json { "$schema": "https://swc.rs/schema.json", "env": { "targets": { "chrome": "110" } }, "jsc": { "parser": { "syntax": "typescript", "decorators": true }, "transform": { "decoratorVersion": "2022-03" }, "experimental": { "plugins": [["./swc_plugin_gem.wasm"]] } } }
https://github.com/mantou132/gem/blob/37045dbac0ea07f984db250a5dfe8628bd1b87c7/crates/swc-plugin-gem/src/visitors/memo.rs#L78
PrivateMethod { span: 157..254, key: PrivateName { span: 171..179, name: "content" }, function: Function { params: [], decorators: [], span: 157..254, ctxt: #3, body: Some(BlockStmt { span: 0..0, ctxt: #0, stmts: [Return(ReturnStmt { span: 0..0, arg: Some(Call(CallExpr { span: 0..0, ctxt: #0, callee: Expr(Ident(Ident { span: 0..0, ctxt: #15, sym: "_call_content", optional: false })), args: [ExprOrSpread { spread: None, expr: This(ThisExpr { span: 0..0 }) }], type_args: None })) })] }), is_generator: false, is_async: false, type_params: None, return_type: None }, kind: Getter, is_static: false, accessibility: None, is_abstract: false, is_optional: false, is_override: false }
function body is "return 0;"
No response
1.9.3
swc_core = "5.0.0" swc_ecma_parser = "5.0.0" swc_ecma_visit = "4.0.0" swc_ecma_ast = "4.0.0" swc_common = "4.0.0"
The text was updated successfully, but these errors were encountered:
swc/packages/types/index.ts
Lines 670 to 675 in b83c44f
Sorry, something went wrong.
No branches or pull requests
Describe the bug
I want to rewrite the decorators device through the plugin to meet the decorators specifications, but it has been rewritten by SWC before the plugin
Input code
plugin:
Playground link (or link to the minimal reproduction)
https://github.com/mantou132/gem/blob/37045dbac0ea07f984db250a5dfe8628bd1b87c7/crates/swc-plugin-gem/src/visitors/memo.rs#L78
SWC Info output
Expected behavior
function body is "return 0;"
Actual behavior
No response
Version
1.9.3
Additional context
swc_core = "5.0.0"
swc_ecma_parser = "5.0.0"
swc_ecma_visit = "4.0.0"
swc_ecma_ast = "4.0.0"
swc_common = "4.0.0"
The text was updated successfully, but these errors were encountered: