S
SolidJSโ€ข7mo ago
Joe Pea

How do we configure babel proposal decorators with Solid's vite plugin?

I've got this Stackblitz: https://stackblitz.com/edit/solidjs-templates-wyjc1i?file=index.html,src%2Findex.tsx,vite.config.ts,package.json No luck configuring decorators like so:
export default defineConfig({
plugins: [
solidPlugin({
babel: {
plugins: ['@babel/plugin-proposal-decorators', { version: '2023-05' }],
},
}),
],
export default defineConfig({
plugins: [
solidPlugin({
babel: {
plugins: ['@babel/plugin-proposal-decorators', { version: '2023-05' }],
},
}),
],
Stackblitz terminal shows this error:
[BABEL] /home/projects/solidjs-templates-wyjc1i/src/index.tsx: The decorators plugin, when .version is '2018-09' or not specified, requires a 'decoratorsBeforeExport' option, whose value must be a boolean. (While processing: "/home/projects/solidjs-templates-wyjc1i/node_modules/.pnpm/@babel+plugin-proposal-decorators@7.23.3_@babel+core@7.22.5/node_modules/@babel/plugin-proposal-decorators/lib/index.js$inherits")
[BABEL] /home/projects/solidjs-templates-wyjc1i/src/index.tsx: The decorators plugin, when .version is '2018-09' or not specified, requires a 'decoratorsBeforeExport' option, whose value must be a boolean. (While processing: "/home/projects/solidjs-templates-wyjc1i/node_modules/.pnpm/@babel+plugin-proposal-decorators@7.23.3_@babel+core@7.22.5/node_modules/@babel/plugin-proposal-decorators/lib/index.js$inherits")
Ask me why I have tooling fatigue. ๐Ÿ™ƒ Buildless for the win.
StackBlitz
Solidjs - Templates (forked) - StackBlitz
Vite + solid templates
5 Replies
Joe Pea
Joe Peaโ€ข7mo ago
Ah, I was missing brakcets, that's all. This,
plugins: ['@babel/plugin-proposal-decorators', { version: '2023-05' }],
plugins: ['@babel/plugin-proposal-decorators', { version: '2023-05' }],
needs to be
plugins: [['@babel/plugin-proposal-decorators', { version: '2023-05' }]],
plugins: [['@babel/plugin-proposal-decorators', { version: '2023-05' }]],
lxsmnsyc
lxsmnsycโ€ข7mo ago
take note that at some point we will be removing babel plugins, since we are delegating the remaining transforms to esbuild. No worries though, esbuild supports decorators
Joe Pea
Joe Peaโ€ข7mo ago
Esbuild does not support "standard decorators" yet, only old TypeScript legacy (experimental) decorators, if I read this correctly: https://github.com/evanw/esbuild/issues/104
GitHub
Feature request: Decorators support ยท Issue #104 ยท evanw/esbuild
error: Decorators are not supported yet Any plan to support decorators?
Joe Pea
Joe Peaโ€ข7mo ago
As long as we can still plug in Babel while esbuild doesn't have new decorators, then it'll be ok. But hopefully esbuild will have it soon! @lxsmnsyc ๐Ÿค– are Babel plugins being dropped in general? Or just in Vite? I currently use Babel on its own for compiling JSX
lxsmnsyc
lxsmnsycโ€ข7mo ago
Vite. We can't drop it in general. and we are not dropping Babel in Vite, we are. dropping the process of compiling TS with Babel
Want results from more Discord servers?
Add your server
More Posts
Can't build SolidStart after updating packagesAfter updating packages, I can't build project both locally and on vercel. I can't find anything relhow to trigger the fetcher in createResource if there are multiple signal values?hello, newbie here. In the document, it could be create a Memo as a group of signals as following. WNicest way of having computed properties in a store?I'm trying to model my store in a concise way, I want to have some base properties, and some computTypesafe way to render conditionally based on whether array has zero, one or many elements?Given an array with one or more elements, the idea is to display different UIs. With React, this canHow to implement JWT authentication in SolidJS, without SolidStart?I'm currently learning SolidJS for a SPA app with JWT-based auth. Right now I'm trying to implement Attempting to access a stale value from <Show>...Hi peeps, I have a rather complex application with lots of stores and recently have this issue. ``solidJS equivalent of react's cloneElementI'm trying to convert a react component that uses cloneElement to a solidJS component. I've briefly How to properly memoize children?I have a small reactivity puzzle that I'm a little stumped on. I'm not sure if I just haven't structNested RoutingHello Friends. i think this isn't something new. and probably asked before. Im coming from stuff listack overflow internal to solidjs?``` Exception has occurred: RangeError: Maximum call stack size exceeded at runUpdates (file:/c:/typ