Open thescientist13 opened 11 months ago
As an aside, I wonder if this actually is something Greenwood should support, in exposing it's internals like this, instead of #550 ? I guess its a question of the lag between standards, and that standard showing up in the parsing tools, like Acorn (JS) and CSSTree (CSS). 🤔
Summary
Given a class / custom element definition like so
The result of running the build will throw an error from Rollup
Commenting that line passes the build successfully
Details
So at the time of this writing,
static
class properties should be [Stage 4 in ECMA]() and supported by all browsers, so seems that this is a Rollup issue? Or it could be acorn, which is the underlying AST library being used.Doing some research yielded these related results
Which seem to indicate that as of >= v2.79.0, Rollup should be supporting, so not sure what gives? I made sure to add a resolution to my project and confirm the latest
2.x
version of Rollup is installed in this project and also tried manually setting the ECMA version in rollup.config.jsI'm not sure if #1087 will help with this, though I think they switched to SWC in v3? Would be good to test this out there.
Putting this code into the current version of their REPL seems to work at least 👀
As a work around if someone really needed to, they could probably use our Babel plugin (or create their own using esbuild, SWC, etc) that should work as a stop gap.
Or if doing something like Web Compnents, just the getter version
I think this is actually an acorn issue, as I see there is this repo for what appears to be the features we're looking for https://github.com/acornjs/acorn-stage3
So not sure if we just need to add that for now?