Skip to content

Commit

Permalink
Fix #71: reduce native image size by avoiding runtime resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Mar 18, 2023
1 parent 4f21afe commit dd4bfd0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

* Solve native image size problem by removing runtime `resolve` [#71](https://github.com/clj-commons/ordered/issues/71)

## 1.15.10 - 2021-10-09

### Added
Expand Down
3 changes: 2 additions & 1 deletion src/data_readers.cljc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{ordered/set flatland.ordered.set/into-ordered-set
ordered/map flatland.ordered.map/ordered-map-reader}
ordered/map #?(:clj flatland.ordered.map/ordered-map-reader-clj
:cljs flatland.ordered.map/ordered-map-reader-cljs)}
9 changes: 5 additions & 4 deletions src/flatland/ordered/map.clj
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ assoc'ed for the first time. Supports transient."
(.write w "#ordered/map ")
(print-method (seq o) w))

(defn ordered-map-reader [coll]
(if (some-> (resolve 'cljs.env/*compiler*) deref)
`(ordered-map ~(vec coll))
(ordered-map coll)))
(defn ordered-map-reader-clj [coll]
(ordered-map coll))

(defn ordered-map-reader-cljs [coll]
`(ordered-map ~(vec coll)))

0 comments on commit dd4bfd0

Please sign in to comment.