r/Clojure • • Apr 24 '20

ClojureScript - Embracing JavaScript Tools

https://clojurescript.org/news/2020-04-24-bundle-target
88 Upvotes

20 comments sorted by

View all comments

1

u/[deleted] Apr 24 '20

"externs inference" is not reliable. The correct path is to really fully embrace JS modern features/tooling and not depend on closure advanced compilation.

24

u/swannodette Apr 24 '20

If you've found a bug please report it. All the known externs inference bugs prior to this release were moved into the blocker category and resolved. Note we've also been using this feature for some time in a fairly sizable React Native codebase and hadn't run into anything I would consider a showstopper. But I agree that there were annoyances previously.

Not using advanced compilation would just lead to bigger payloads. I don't see many users asking for that ;)

0

u/[deleted] Apr 24 '20

There are other ways to do "advanced compilation" without closure, but that requires leveraging ES6 modules.

10

u/swannodette Apr 24 '20 edited Apr 24 '20

The only comprehensive thing that I'm aware of is Rollup.js but so far no-one has provided evidence that it would best Closure advanced compilation for ClojureScript. Given that Closure works at property and method level, I'm somewhat skeptical. Do you have some other tool in mind?

3

u/jiyinyiyong Apr 25 '20

I was totally convinced that dead code elimination of Google Closure Compiler is a lot smarter than tree shaking from Webpack. However I'm still very curious how bad is the result if ClojureScript makes full use of ES6. Or would ES6 cljs be acceptable for a small part of users. Probably a bad example but some people who are using Webpack just accepted the large bundles... https://twitter.com/boriscoder/status/1251823596747571200 .