Skip to content
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

Updates to language-javascript #1

Closed
i-am-the-slime opened this issue Dec 26, 2021 · 2 comments
Closed

Updates to language-javascript #1

i-am-the-slime opened this issue Dec 26, 2021 · 2 comments

Comments

@i-am-the-slime
Copy link
Member

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) 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.

@i-am-the-slime
Copy link
Member Author

I forked the project under this organization.

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.

@thomashoneyman
Copy link

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.

Repository owner moved this from Todo to Done in ES module support in PureScript Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants