Skip to content

Commit aa2cf6d

Browse files
committed
Prep release of deep-diff2
1 parent fa7d006 commit aa2cf6d

File tree

3 files changed

+77
-12
lines changed

3 files changed

+77
-12
lines changed

.VERSION_PREFIX

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.0.0

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
## Added
44

5-
## Fixed
5+
- Added support for ClojureScript (ported to CLJC)
66

77
## Changed
88

9+
- Changed namespace and artifact (jar) names to include a "2" suffix, because of breaking changes.
10+
911
# 0.0-47 (2019-04-11 / 27cf55c)
1012

1113
## Added

README.md

Lines changed: 73 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
1-
# lambdaisland/deep-diff
1+
# lambdaisland/deep-diff2
22

33
<!-- badges -->
4-
[![CircleCI](https://circleci.com/gh/lambdaisland/deep-diff.svg?style=svg)](https://circleci.com/gh/lambdaisland/deep-diff) [![cljdoc badge](https://cljdoc.org/badge/lambdaisland/deep-diff)](https://cljdoc.org/d/lambdaisland/deep-diff) [![Clojars Project](https://img.shields.io/clojars/v/lambdaisland/deep-diff.svg)](https://clojars.org/lambdaisland/deep-diff) [![codecov](https://codecov.io/gh/lambdaisland/deep-diff/branch/master/graph/badge.svg)](https://codecov.io/gh/lambdaisland/deep-diff)
4+
[![CircleCI](https://circleci.com/gh/lambdaisland/deep-diff2.svg?style=svg)](https://circleci.com/gh/lambdaisland/deep-diff2) [![cljdoc badge](https://cljdoc.org/badge/lambdaisland/deep-diff2)](https://cljdoc.org/d/lambdaisland/deep-diff2) [![Clojars Project](https://img.shields.io/clojars/v/lambdaisland/deep-diff2.svg)](https://clojars.org/lambdaisland/deep-diff2) [![codecov](https://codecov.io/gh/lambdaisland/deep-diff2/branch/master/graph/badge.svg)](https://codecov.io/gh/lambdaisland/deep-diff2)
55
<!-- /badges -->
66

7-
Recursively compare Clojure data structures, and produce a colorized diff of the result.
7+
Recursively compare Clojure or ClojureScript data structures, and produce a colorized diff of the result.
88

99
![screenshot showing REPL example](screenshot.png)
1010

11+
<!-- opencollective -->
12+
### Support Lambda Island Open Source
13+
14+
If you find value in our work please consider [becoming a backer on Open Collective](http://opencollective.com/lambda-island#section-contribute)
15+
<!-- /opencollective -->
16+
1117
## Install
1218

13-
[![Clojars Project](https://img.shields.io/clojars/v/lambdaisland/deep-diff.svg)](https://clojars.org/lambdaisland/deep-diff)
19+
[![Clojars Project](https://img.shields.io/clojars/v/lambdaisland/deep-diff2.svg)](https://clojars.org/lambdaisland/deep-diff2)
1420

1521
## Use
1622

17-
- [API docs](https://cljdoc.org/d/lambdaisland/deep-diff/CURRENT)
23+
- [API docs](https://cljdoc.org/d/lambdaisland/deep-diff2/CURRENT)
1824

1925
``` clojure
20-
(require '[lambdaisland.deep-diff :as ddiff])
26+
(require '[lambdaisland.deep-diff2 :as ddiff])
2127

2228
(ddiff/pretty-print (ddiff/diff {:a 1 :b 2} {:a 1 :c 3}))
2329
```
2430

2531
### Diffing
2632

27-
`lambdaisland.deep-diff/diff` takes two arguments and returns a "diff", a data
33+
`lambdaisland.deep-diff2/diff` takes two arguments and returns a "diff", a data
2834
structure that contains markers for insertions, deletions, or mismatches. These
2935
are records with `-` and `+` fields.
3036

@@ -35,7 +41,7 @@ are records with `-` and `+` fields.
3541

3642
### Printing
3743

38-
You can pass this diff to `lambdaisland.deep-diff/pretty-print`. This function
44+
You can pass this diff to `lambdaisland.deep-diff2/pretty-print`. This function
3945
uses [Puget](https://github.com/greglook/puget) and
4046
[Fipp](https://github.com/brandonbloom/fipp) to format the diff and print the
4147
result to standard out.
@@ -49,12 +55,68 @@ For fine grained control you can create a custom Puget printer, and supply it to
4955
(ddiff/pretty-print (ddiff/diff {:a 1 :b 2} {:a 1 :b 3}) narrow-printer)
5056
```
5157

52-
For more advanced uses like incorporating diffs into your own Fipp documents, see `lambdaisland.deep-diff.printer/format-doc`, `lambdaisland.deep-diff.printer/print-doc`.
58+
For more advanced uses like incorporating diffs into your own Fipp documents, see `lambdaisland.deep-diff2.printer/format-doc`, `lambdaisland.deep-diff2.printer/print-doc`.
5359

5460
You can register print handlers for new types using
55-
`lambdaisland.deep-diff.printer/register-print-handler!`, or by passing and
61+
`lambdaisland.deep-diff2.printer/register-print-handler!`, or by passing and
5662
`:extra-handlers` map to `printer`.
5763

64+
### Deep-diff 1 vs 2
65+
66+
The original deep-diff only worked on Clojure, not ClojureScript. In porting the
67+
code to CLJC we were forced to make some breaking changes. To not break existing
68+
consumers we decided to move both the namespaces and the released artifact to
69+
new names, so the old and new deep-diff can exist side by side.
70+
71+
When starting new projects you should use `lambdaisland/deep-diff2`. However if
72+
you have existing code that uses `lambdaisland/deep-diff` and you don't need the
73+
ClojureScript support then it is not necessary to upgrade. The old version still
74+
works fine (on Clojure).
75+
76+
You can upgrade of course, simply by replacing all namespace names from
77+
`lambdaisland.deep-diff` to `lambdaisland.deep-diff2`. If you are only using the
78+
top-level API (`diff`, `printer`, `pretty-print`) and you aren't using custom
79+
print handlers, then things should work exactly the same. If you find that
80+
deep-diff 2 behaves differently then please file an issue, you may have found a
81+
regression.
82+
83+
The old code still lives on the `deep-diff-1` branch, and we do accept bugfix
84+
patches there, so we may put out bugfix releases of the original deep-diff in
85+
the future. When in doubt check the CHANGELOG.
86+
87+
<!-- contributing -->
88+
### Contributing
89+
90+
Everyone has a right to submit patches to this projects, and thus become a contributor.
91+
92+
Contributors MUST
93+
94+
- adhere to the [LambdaIsland Clojure Style Guide](https://nextjournal.com/lambdaisland/clojure-style-guide)
95+
- write patches that solve a problem. Start by stating the problem, then supply a minimal solution. `*`
96+
- agree to license their contributions as MPLv2.
97+
- not break the contract with downstream consumers. `**`
98+
- not break the tests.
99+
100+
Contributors SHOULD
101+
102+
- update the CHANGELOG and README.
103+
- add tests for new functionality.
104+
105+
If you submit a pull request that adheres to these rules, then it will almost
106+
certainly be merged immediately. However some things may require more
107+
consideration. If you add new dependencies, or significantly increase the API
108+
surface, then we need to decide if these changes are in line with the project's
109+
goals. In this case you can start by [writing a
110+
pitch](https://nextjournal.com/lambdaisland/pitch-template), and collecting
111+
feedback on it.
112+
113+
`*` This goes for features too, a feature needs to solve a problem. State the problem it solves, then supply a minimal solution.
114+
115+
`**` As long as this project has not seen a public release (i.e. is not on Clojars)
116+
we may still consider making breaking changes, if there is consensus that the
117+
changes are justified.
118+
<!-- /contributing -->
119+
58120
## Credits
59121

60122
This library builds upon
@@ -74,6 +136,6 @@ Another library that implements a form of data structure diffing is [editscript]
74136

75137
## License
76138

77-
Copyright &copy; 2018 Arne Brasseur
139+
Copyright &copy; 2018-2020 Arne Brasseur and Contributors
78140

79141
Available under the terms of the Eclipse Public License 1.0, see LICENSE.txt

0 commit comments

Comments
 (0)