Skip to content

Commit

Permalink
actually still against polluting cljs.reader by default
Browse files Browse the repository at this point in the history
setting

  :compiler-options {:data-readers true}

will lead to cljs.reader/*tag-table* being populated with the
readers listed in data_readers.clj(c) on the classpath during
compilation.

Not doing this by default since there is no way to tell
if those readers are actually required. Just putting an unresolved
symbol reference in the build makes closure unhappy if the
namespace is not part of the actual build otherwise.

cljs does this by default. I don't like breaking that behavior
but I really don't like this default. Adding a data reader
should be part of user code, not due to some random artifact
being on the classpath.

Does not affect how data readers are handled for compilation or
REPL purposes.
  • Loading branch information
thheller committed Jun 8, 2022
1 parent e70f179 commit 8088fac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/shadow/build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@
;; delaying loading via shadow.build.data/maybe-loading-data-readers for regular compilation
(defn maybe-prepare-data-readers
[state]
(let [cfg (get-in state [:compiler-options :data-readers])]
(let [cfg (get-in state [:compiler-options :data-readers] false)]
(if (or (false? cfg) (::data-readers-loaded state))
state
(let [data-readers (ana/get-data-readers)
Expand Down

0 comments on commit 8088fac

Please sign in to comment.