ui5-community / ui5-community/babel-plugin-transform-modules-ui5
[FEATURE REQUEST] Support typescript decorators
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 33
- Forks
- 20
- Avg merge
- 3h 22m
- Merged PRs (30d)
- 1
Description
In ts config
...
"experimentalDecorators": true,
...
in ts code
class BigButton extends Button {
...
@someDecorator()
fun1() {}
...
}
What to expect:
We hope the decorator will be compiled in target js file
Current:
In js file, the decorator only imported but not used
More info:
I try to write a babel plugin to handle the decorator, but when the babel visit the ClassMethod node, what I found:
- node.decorators is
null - the function name should be
fun1, but what I get is_fun1
But when I remove the transform-ui5 preset, all information is correct.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the TypeScript example with experimentalDecorators enabled and the transform-ui5 preset, then inspect the Babel ClassMethod visitor. Compare the AST with and without transform-ui5; done means the decorator is emitted and used in the target JavaScript rather than only imported, while the method remains correctly identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- babel, typescript
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100