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

Support :es-next-in output feature set #851

Closed
wavejumper opened this issue Mar 11, 2021 · 9 comments
Closed

Support :es-next-in output feature set #851

wavejumper opened this issue Mar 11, 2021 · 9 comments

Comments

@wavejumper
Copy link

wavejumper commented Mar 11, 2021

Some of the NPM packages we depend on now require Closure's ES_NEXT_IN feature set.

This is something shadow-cljs does not currently support as it depends on an older version of the Closure compiler.

It looks like this is currently blocked by ClojureScript itself (as per this comment) which has a hard dependency on an older version of the compiler.

@thheller
Copy link
Owner

What is the error you get? Can you provide an example of such a package? :es-next is the default input feature set and should be fine? You just also might need to set :compiler-options {:output-feature-set :es-next} if you are using features that cannot be transpiled?

@wavejumper
Copy link
Author

wavejumper commented Mar 11, 2021

Example package: {"@codemirror/state": "0.18.1"}

Error thrown with {:output-feature-set :es-next} and [thheller/shadow-cljs "2.11.22"]:

Closure compilation failed with 2 errors
--- node_modules/@codemirror/state/dist/index.cjs:1053
This language feature is only supported for ES_NEXT_IN mode or better: Optional chaining.
--- node_modules/@codemirror/state/dist/index.cjs:1612
This language feature is only supported for ES_NEXT_IN mode or better: Optional chaining.

After these errors are thrown, the build hangs indefinitely.

@thheller
Copy link
Owner

Try 2.11.23. I added :es-next-in and made it the default.

@wavejumper
Copy link
Author

@thheller thanks for adding the additional feature set so quickly!

Unfortunately I still cannot install @codemirror/state

Closure compilation failed with 1 errors
--- null:-1
Attempted to run pass "removeWeakSources" on input with features it does not support. Running pass anyway.
Unsupported features: [Optional chaining]

It looks like optional chaining is an ES2020 feature that the Closure compiler now supports (see here and here). I am guessing once ClojureScript bumps their dep of the Closure compiler, this package will be supported by shadow-cljs.

@thheller
Copy link
Owner

thheller commented Mar 11, 2021 via email

@kommen
Copy link

kommen commented Mar 18, 2021

FYIW :output-feature-set :es8 works for @codemirror/state, as one can see here: https://github.com/nextjournal/clojure-mode/blob/11a48c90bd1e17916c9aa9afcb2b25477ecfeb83/shadow-cljs.edn#L5

@wavejumper
Copy link
Author

wavejumper commented Mar 18, 2021

@kommen we also use Code Mirror next in our product, and have had it in production for the last two months, that's not the problem - that has been working great :)

clojure-mode looks to depend on @codemirror/state 0.18.0 -- the latest minor version (0.18.1) does not work due to the lack of support for optional chaining in the closure compiler ClojureScript depends on.

@kommen
Copy link

kommen commented Mar 19, 2021

@wavejumper thanks for the clarification. Makes sense, we're still on @codemirror/state 0.18.0. Without trying it, it looks like this has been addressed with @codemirror/state 0.18.2? codemirror/state@2698a2b

@wavejumper
Copy link
Author

@kommen oh perfect, thanks for the heads up! Will try 0.18.2 next week :)

nh2 added a commit to nh2/nix-env-selector that referenced this issue Sep 14, 2023
…olation.

Requires shadow-cljs ugprade to fix `ES_NEXT_IN` build error
created by `vscode-variables` dependency:

* thheller/shadow-cljs#851
* thheller/shadow-cljs@6270072
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants