You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The magic CommonJS constants __filename and __dirname are not available in ES modules.
They’re supposed to be replaced by import.meta.url (see https://nodejs.org/dist/latest-v16.x/docs/api/esm.html#esm_import_meta_url) but language-javascript does not support parsing this meta property. Dynamic imports also are not supported, and @kl0tl mentioned they'd like them to be supported for ease of bundle splitting.
There are also a few bugs and some unsupported ES6 features in language-javascript. Supporting all of ES2021 would be nice, but it may be too much work for too little gain so at the very least we'd like support for import.meta and dynamic imports, then eventually proper support for ES6.
A few issues have already been opened around this:
If we have trouble getting things moved forward on that repository then we may need to fork it in order to complete support for the PureScript compiler with respect to ES6.
The text was updated successfully, but these errors were encountered:
I think it makes sense to integrate the open PRs (and potentially a bit more, I'd like to see support for trailing commas for example).
Given how the stale the project has been and that most contributions in the past were from PureScript compiler engineers I think going with a fork or actually integrating the parser into the compiler repo right away make sense.
I think it also makes sense to revisit this issue and narrow down what specifically we need to support for the sake of ES modules. For example, if a feature would make the PureScript bundler better (but it isn't strictly necessary) then perhaps we can make it a stretch goal. After all, I suspect few if any people are using the PureScript bundler for their applications rather than things like webpack, parcel, and esbuild.
Originally written by @thomashoneyman
The magic CommonJS constants
__filename
and__dirname
are not available in ES modules.They’re supposed to be replaced by
import.meta.url
(see https://nodejs.org/dist/latest-v16.x/docs/api/esm.html#esm_import_meta_url) butlanguage-javascript
does not support parsing this meta property. Dynamic imports also are not supported, and @kl0tl mentioned they'd like them to be supported for ease of bundle splitting.There are also a few bugs and some unsupported ES6 features in
language-javascript
. Supporting all of ES2021 would be nice, but it may be too much work for too little gain so at the very least we'd like support forimport.meta
and dynamic imports, then eventually proper support for ES6.A few issues have already been opened around this:
import.meta.url
erikd/language-javascript#127import.meta
andnew.target
) erikd/language-javascript#129If we have trouble getting things moved forward on that repository then we may need to fork it in order to complete support for the PureScript compiler with respect to ES6.
The text was updated successfully, but these errors were encountered: