-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not all expected modern JavaScript syntax supported #1183
Comments
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). 🤔 |
static
property initializations break during bundling
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 const ast = this.parse(await response.text(), { ecmaVersion: 'latest' }); ➜ greenwood-starter-presentation git:(enhancement/issue-25-remove-lit-dependency) ✗ yarn why rollup
yarn why v1.22.19
[1/4] 🤔 Why do we have the module "rollup"...?
[2/4] 🚚 Initialising dependency graph...
[3/4] 🔍 Finding dependency...
[4/4] 🚡 Calculating file sizes...
=> Found "[email protected]"
info Reasons this module exists
- "@greenwood#cli" depends on it
- Hoisted from "@greenwood#cli#rollup"
info Disk size without dependencies: "6.46MB"
info Disk size with unique dependencies: "6.46MB"
info Disk size with transitive dependencies: "6.46MB"
info Number of shared dependencies: 0
✨ Done in 0.11s. I'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 Components, just the getter version static get observedAttributes() {
return ['slide'];
} 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 So not sure if we just need to add that for now? |
Summary
Noticed that some basic JavaScript syntax features seems to be breaking though they should already be supported, like private class fields and static blocks.
The result of running the build will throw an error from Rollup
Details
At the time of this writing these should all be Stage 4 in ECMA and supported in all browsers, so not sure what gives? 🤷♂️
I notice we are inconsistently configuring Acorn with different flags, one still stuck in 2020!
We should probably make this a lib that can export that configuration everywhere. Additionally, we should make sure that in places we are walking a JS AST, there's no chance we could be processing TS and thus breaking Acorn.
The text was updated successfully, but these errors were encountered: