Fork me on GitHub
#shadow-cljs
<
2021-09-28
>
zhuxun202:09:08

Is setting :compiler-options {:output-feature-set :es5} the only way to use MUI 5+? I need to use @mui/x-data-grid which when compiled to ES5, gives this error:

[:main] Build failure:
Closure compilation failed with 1 errors
--- node_modules/@mui/x-data-grid/index-cjs.js:3
Cannot convert ECMASCRIPT_2018 feature "RegExp unicode property escape" to targeted output language.

zhuxun202:09:54

However, setting :compiler-options {:output-feature-set :es2018} gives another error as @gingerwizard was talking about:

shadow-cljs - failed to load – "module$node_modules$$mui$material$node$ButtonBase$TouchRipple"

zhuxun202:09:25

A few others seem to have run into the same problem @p-himik @luciano etc. Their only solution seem to be setting :output-feature-set :es5.

zhuxun202:09:48

Has anyone figured out the root cause for it? Why does setting :output-feature-set fix it?

xlfe03:09:11

What's going on is mui-5 is now using esm modules I think - see https://github.com/MrEbbinghaus/mui5-shadow-cljs-issue-repro/issues/1

👍 1
xlfe03:09:08

the fix is to add the :js-options flag as suggested https://shadow-cljs.github.io/docs/UsersGuide.html#js-entry-keys

metal 1
FiVo11:09:35

Is there a way to load dependencies without restarting the repl? I am using deps.edn.

arohner13:09:59

shadow.build.test-util/find-test-namespaces calls cp/find-cljs-namespaces-in-files. I’m trying to use shadow with bazel, which strongly prefers JVM code to be distributed as jars rather than files, so I would like that to search through the proper classpath, rather than directories. Would you accept a PR that switches that to use tools.namespace to search through files and jars?