|
55 | 55 |
|
56 | 56 | (def ^:dynamic *file-defs* nil)
|
57 | 57 |
|
| 58 | +#?(:clj |
| 59 | + (def transit |
| 60 | + (delay |
| 61 | + (try |
| 62 | + (require '[cognitect.transit]) |
| 63 | + (let [ns (find-ns 'cognitect.transit)] |
| 64 | + (when ns |
| 65 | + {:writer @(ns-resolve ns 'writer) |
| 66 | + :reader @(ns-resolve ns 'reader) |
| 67 | + :write @(ns-resolve ns 'write) |
| 68 | + :read @(ns-resolve ns 'read)})) |
| 69 | + (catch Throwable t |
| 70 | + nil))))) |
| 71 | + |
58 | 72 | ;; log compiler activities
|
59 | 73 | (def ^:dynamic *verbose* false)
|
60 | 74 |
|
|
2782 | 2796 | (if-let [core-cache
|
2783 | 2797 | (and (= mode :read)
|
2784 | 2798 | (= (:ns ns-info) 'cljs.core)
|
2785 |
| - (io/resource "cljs/core.cljs.cache.aot.edn"))] |
| 2799 | + (or (and @transit (io/resource "cljs/core.cljs.cache.aot.json")) |
| 2800 | + (io/resource "cljs/core.cljs.cache.aot.edn")))] |
2786 | 2801 | core-cache
|
2787 | 2802 | (let [target-file (util/to-target-file output-dir ns-info
|
2788 | 2803 | (util/ext (:source-file ns-info)))]
|
|
2800 | 2815 | ([src cache output-dir]
|
2801 | 2816 | (cond
|
2802 | 2817 | (and (util/url? cache)
|
2803 |
| - (.endsWith (.getPath ^URL cache) "cljs/core.cljs.cache.aot.edn")) |
| 2818 | + (or (.endsWith (.getPath ^URL cache) "cljs/core.cljs.cache.aot.edn") |
| 2819 | + (.endsWith (.getPath ^URL cache) "cljs/core.cljs.cache.aot.json"))) |
2804 | 2820 | false
|
2805 | 2821 |
|
2806 | 2822 | (and (util/file? cache)
|
|
2817 | 2833 | version (util/clojurescript-version)]
|
2818 | 2834 | (and version (not= version version'))))))))))
|
2819 | 2835 |
|
2820 |
| -#?(:clj |
2821 |
| - (def transit |
2822 |
| - (delay |
2823 |
| - (try |
2824 |
| - (require '[cognitect.transit]) |
2825 |
| - (let [ns (find-ns 'cognitect.transit)] |
2826 |
| - (when ns |
2827 |
| - {:writer @(ns-resolve ns 'writer) |
2828 |
| - :reader @(ns-resolve ns 'reader) |
2829 |
| - :write @(ns-resolve ns 'write) |
2830 |
| - :read @(ns-resolve ns 'read)})) |
2831 |
| - (catch Throwable t |
2832 |
| - nil))))) |
2833 |
| - |
2834 | 2836 | #?(:clj
|
2835 | 2837 | (defn write-analysis-cache
|
2836 | 2838 | ([ns cache-file]
|
|
0 commit comments