Closed szammyboi closed 1 year ago
Hello, sorry for the late reply, I was unsubscribed to my own repo xD. What version of decorators are you using? I perhaps need to update to the latest spec that Babel supports (which is now itself outdated too I think).
After testing, it looks like this error happens with decorator mode 2018-09
.
Reproduction in Babel repl
For now just use legacy
mode. I need to add more tests to handle each mode.
The difficult thing for decorator developers currently (until the decorator spec finally lands and is implemented in JS runtimes) is that there are many permutations of compiler configurations to test in order not to fail in some cases:
useDefineForClassFields: true
useDefineForClassFields: false
We have to run tests 8 times, each time with a different build configuration, to ensure it works in all. And that didn't include other build tools. I might need to add tests for esbuild decorators for example.
Quite a mess for decorator authors currently, but when they finally arrive natively, it will be pretty awesome.
Almost done updating classy-solid to stage 3 decorators ( https://github.com/lume/classy-solid/pull/4 ). Legacy modes will no longer be supported, and their implementation removed. 🎉 Release coming soon.
I have a solid-js project setup with their basic Vite template. I enabled experimental decorators with babel and was able to successfully use the @reactive decorator. However, whenever I try to use the @component decorator I get the following error:
A class descriptor's .kind property must be "class", but a decorator created a class descriptor with .kind "undefined"
I was able to solve the problem by exporting the class and wrapping it inside the component function like such:
export default component(Home)
Home being the class name