Skip to content

Commit 23e41df

Browse files
committed
Incorporate change log feedback [skip ci]
Requested a review on Slack on got some great feedback, thanks @borkdude!
1 parent 546fbc9 commit 23e41df

File tree

1 file changed

+48
-8
lines changed

1 file changed

+48
-8
lines changed

CHANGELOG.adoc

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you wish, you can read nitty gritty details on link:doc/design/01-merging-rew
2020
What follows is a summary of changes.
2121

2222
==== New
23-
* A new home under clj-commons. Thanks to @xsc, rewrite-clj will also retain its same maven coordinates on clojars making for a seamless upgrade path for rewrite-clj v0 users.
23+
* A new home under clj-commons. Thanks to @xsc, rewrite-clj will also retain its same maven coordinates on Clojars making for a seamless upgrade path for rewrite-clj v0 users.
2424
* Now supports ClojureScript, merging in rewrite-cljs specific functionality.
2525
Frustrations like not having namespace map support and differences from rewrite-clj, like whitespace parsing, should now be things of the past.
2626
Rewrite-cljs users migrating to rewrite-clj v1 are now at, and will remain at, feature parity with rewrite-clj.
@@ -120,11 +120,51 @@ Rewrite-cljs users migrating to rewrite-clj v1 are now at, and will remain at, f
120120
* Now using `ex-info` for explicitly raised exceptions
121121
* Rewrite-cljs positional support migrated to rewrite-clj's positional support
122122
* Namespaced element support reworked
123+
** v1 changes do not affect node traversal of the namespaced map, number and order of children remain the same.
123124
** Namespace map prefix, is now stored in a namespaced map qualifier node.
124-
Prior to v1, was stored as a keyword.
125-
** Namespaced element sexpr support now relies on user specifiable auto-resolve function to resolve qualifiers
126-
** Unlike rewrite-clj v0, the default auto-resolve behaviour never consults `\*ns*`
127-
** An sexpr for keyword node `::alias/foo` no longer returns `:alias/foo` (this could be considered a bug fix, but if your code is expecting this, then you'll need to make changes)
125+
*** Prior to v1, the prefix was parsed to a keyword-node.
126+
*** Let's look at what interesting node API functions will return for the prefix node in the following namespaced maps.
127+
Assume we have parsed the example and traversed down to the prefix node. +
128+
For example via: `(-> "#:prefix{:a 1}" z/of-string z/down z/node)`. +
129+
+
130+
|===
131+
| node API call | rewrite-clj | `#:prefix{:a 1}` | `#::alias{:a 1}` | `#::{:a 1}`
132+
133+
.2+| `string` +
134+
is unchanged
135+
| v1
136+
.2+| `":prefix"`
137+
.2+| `"::alias"`
138+
| `"::"`
139+
| v0
140+
a| * throws on parse
141+
142+
.2+| `tag` +
143+
is different
144+
145+
| v1
146+
3+| `:map-qualifier`
147+
148+
| v0
149+
2+| `:token`
150+
a| * throws on parse
151+
152+
.2+| `inner?` +
153+
still indicates that the node is a leaf node and has no children
154+
155+
| v1
156+
3+| `false`
157+
| v0
158+
2+| `false`
159+
a| * throws on parse
160+
161+
| `sexpr`
162+
4+| <read on below for discussion on sexpr>
163+
164+
|===
165+
** Namespaced element `sexpr` support now relies on user specifiable auto-resolve function to resolve qualifiers
166+
*** Unlike rewrite-clj v0, the default auto-resolve behaviour never consults `\*ns*`
167+
*** An sexpr for keyword node `::alias/foo` no longer returns `:alias/foo` (this could be considered a bug fix, but if your code is expecting this, then you'll need to make changes)
128168
** The following namespaced element `sexpr` examples assume:
129169
*** `\*ns*` is bound to `user` namespace (important only for rewrite-clj v0):
130170
*** We are using the default auto-resolve function for rewrite-clj v1
@@ -248,10 +288,10 @@ a| ns-alias qualified
248288

249289
|===
250290
* Potentially breaking
251-
** Switched to `clojure.tools.reader.edn`
252-
** Some rewrite-cljs optimizations were dropped in favor of a single code base
291+
** Some http://rundis.github.io/blog/2015/clojurescript_performance_tuning.html[rewrite-cljs optimizations] were dropped in favor of a single code base.
292+
If performance for rewrite-clj v1 for ClojureScript users is poor with today's ClojureScript, we shall adapt.
253293
** Deleted unused `rewrite-clj.node.indent` https://github.com/clj-commons/rewrite-clj/issues/116[#116]
254-
** Deleted redundent `rewrite-clj.parser.util` as part of https://github.com/clj-commons/rewrite-clj/issues/93[#93].
294+
** Deleted redundant `rewrite-clj.parser.util` as part of https://github.com/clj-commons/rewrite-clj/issues/93[#93].
255295
If you were using this internal namespace you can opt to switch to, the also internal, `rewrite-clj.reader` namespace.
256296

257297
== rewrite-clj v0

0 commit comments

Comments
 (0)