Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support language-in/language-out ClojureScript compiler options #197

@ajoberstar

Description

@ajoberstar

Discussed in #196

Originally posted by ec-c November 14, 2022
Hello

I'm using clojurephant.clojurescript with shadow-cljs and the @mui/material node module. When compiling clojurescript code, I get an error: ERROR: JSC_LANGUAGE_FEATURE. This language feature is only supported for ECMASCRIPT_2016 mode or better: exponent operator (**). at .../node_modules/@mui/material/esm/styles/createTransitions.js line 44 : 30. It seems that the compiler just accepts es5 code.

https://clojurescript.org/reference/compiler-options#language-in-and-language-out confirms my suspicion:

:language-in defaults to :ecmascript5 :language-out defaults to :no-transpile

How can I configure :language-in to es6?

I tried to configure foreignLibs in my kotlin-based gradle setup, however without success:

clojurescript {
    builds {
        all {
            compiler {
                foreignLibs.create("mui") {
                    file.set("nodes_modules/@mui/material")
                    provides.set(listOf("@mui/material"))
                    moduleType.set("es6")
                }
            }
        }
    }
}

This throws an exception when compiling clojurescript code: Caused by: us.bpsm.edn.EdnException: Don't know how to write '[dev.clojurephant.plugin.clojurescript.tasks.ForeignLib_Decorated@5ad501e9]' of type 'class java.util.TreeMap$Values'

Thanks for helping me.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions