Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

When using code splitting together with advanced optimizations (and :optimize-constants on by default), precompiled keywords always end up being compiled into cljs-base, even when they are used by one module only.

How to reproduce:

  1. Untar attached minimal case (basically a slightly edited example from https://clojurescript.org/guides/code-splitting)
  2. java -cp /path/to/cljs.jar:src clojure.main release.clj
  3. Inspect generated files

Actual behavior:

Even though :this-is-a-very-long-keyword is only used in bar.cljs, it gets compiled into cljs_base.js. On line 286 (redacted):

var ...,Rg=new L(null,"this-is-a-very-long-keyword","this-is-a-very-long-keyword",-1251510263),...;

Expected behavior:

The definition of Rg should be present in bar.js instead.

1 Answer

0 votes
Reference: https://clojure.atlassian.net/browse/CLJS-3063 (reported by alex+import)