Replies: 6 comments 7 replies
-
I think the second option is better, as I want to do much more cleanup (of config) for the next major version release |
Beta Was this translation helpful? Give feedback.
-
Well tsc people hasn't started working on decorator yet... |
Beta Was this translation helpful? Give feedback.
-
Looks like they have finished: |
Beta Was this translation helpful? Give feedback.
-
So, TypeScript take different approach - new decorators is available until you specify |
Beta Was this translation helpful? Give feedback.
-
I started working at #6950 |
Beta Was this translation helpful? Give feedback.
-
Hello! Saw that #6950 was included in 1.3.45: thanks for your hard work! However, I am having trouble using the stage 3 spec decorators feature. When I copy the simple example from the TS 5 beta announcement and configure
See this playground. Running the output code in Google Chrome (Version 111.0.5563.146 (Official Build) (arm64)) does not yield the expected logging: I also tried try removing the types and configuring
See this playground: running the output code in Google Chrome (Version 111.0.5563.146 (Official Build) (arm64)) yields an error: Are these examples expected to work? Am I missing some configuration needed to use spec decorators with swc? Am I (and the TS 5 beta announcement) mistaken about the spec decorator API or another detail of how this is supposed to work? Is this the right forum to discuss this? |
Beta Was this translation helpful? Give feedback.
-
Some history
There are historically three versions of decorator
2021-12
and would be default in version 8. TS and esbuild people have already been working on it. It shares many similarities with 1.Current status of swc
There're currently two options related with decorator in swc, which is
jsc.parsre.decorators
andjsc.transform.legacyDecoratos
. Enable former would enable decorator in parser, and static decorator in transform. Enable later would enable legacy decorator.This poses a problem in how to expose API for spec decorator.
Possible solution
specDecorators
, and if both this andlegacyDecoratos
is set to true, throw an error. It has no other downside than ugly.Beta Was this translation helpful? Give feedback.
All reactions