Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 4f1c71f

Browse files
committed
🔖 Prepare release 1.0.0
1 parent bbd92f1 commit 4f1c71f

File tree

112 files changed

+1365
-1610
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+1365
-1610
lines changed

README.md

Lines changed: 44 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -20,55 +20,10 @@ immutad●t gives you a short and meaningful syntax to apply operations on immut
2020
[![codecov](https://codecov.io/gh/Zenika/immutadot/branch/master/graph/badge.svg)](https://codecov.io/gh/Zenika/immutadot)
2121
[![Greenkeeper](https://badges.greenkeeper.io/Zenika/immutadot.svg)](https://greenkeeper.io/)
2222

23-
## [1.0 Release Candidate](https://github.com/Zenika/immutadot/releases) is out 🎉
24-
25-
We are still writing the documentation, you can already find out about the [updated API](https://zenika.github.io/immutadot/immutadot/1.0) and our new package [immutadot-lodash](https://zenika.github.io/immutadot/immutadot-lodash/1.0).
26-
27-
If you would like to try out 1.0 before its official release, install it with :
28-
29-
```shell
30-
yarn add immutadot@next
31-
```
32-
33-
or
34-
35-
36-
```shell
37-
npm install immutadot@next
38-
```
23+
## [1.0](https://github.com/Zenika/immutadot/releases) is out 🎉
3924

4025
If you were using a previous version of immutad●t, check out the [migrating guide](docs/MIGRATING_TO_1_0.md).
4126

42-
## Immutability
43-
44-
In the last few years one of our biggest challenge has been to find an efficient way to detect changes in our data to determine when to re-render our interfaces.
45-
46-
An immutable object is an object that cannot be changed once created. It brings several benefits<sup>[1](#notes)</sup>:
47-
48-
- Data changes detection made simple (Shallow comparison)
49-
- Memoization
50-
- Improve rendering performances
51-
- Explicit data changes
52-
- Avoid side effects
53-
54-
## Our approach
55-
56-
### Concise
57-
58-
[ES2015+](https://mdn.io/JavaScript/Reference) new features are great to deal with arrays and objects. As data structures expand, the code you write to make data immutable gets bigger and less readable. immutad●t uses the dot notation to address this issue.
59-
60-
### Interoperability
61-
62-
immutad●t uses plain JavaScript objects so you can access your data using standard ways. Moreover, it lets you freely enjoy your favorite libraries.
63-
64-
### Exhaustive and yet extensible
65-
66-
immutad●t comes with a large set of built-in utilities, mostly based on [ES2015+](https://mdn.io/JavaScript/Reference). You can also find a package called [immutadot-lodash](https://github.com/Zenika/immutadot/tree/master/packages/immutadot-lodash) with some of [lodash](https://lodash.com/)'s utilities. You haven't found what you're looking for? Do it yourself with the [`convert`](https://zenika.github.io/immutadot/immutadot/1.0/core.html#.convert) feature.
67-
68-
### Learning curve
69-
70-
If you are already familiar with [ES2015+](https://mdn.io/JavaScript/Reference) and [lodash](https://lodash.com/) then you should be able to use immutad●t quickly.
71-
7227
## Installation
7328

7429
immutad●t is available on [npm repository](https://www.npmjs.com/package/immutadot).
@@ -103,90 +58,43 @@ const { set } = require('immutadot')
10358

10459
### Example
10560

106-
Object used in the following example:
61+
Quickly set nested properties using [set()](https://zenika.github.io/immutadot/immutadot/1.0/core.html#.set)
10762

10863
```js
64+
import { set } from 'immutadot'
65+
10966
const animals = {
110-
weasels: [
111-
{
112-
vernacularName: 'badger',
113-
scientificName: 'Meles meles'
67+
weasels: {
68+
lutraLutra: {
69+
commonNames: ['eurasian otter'],
11470
},
115-
{
116-
vernacularName: 'otter',
117-
}
118-
]
71+
},
11972
}
120-
```
121-
122-
Let's add the otter's scientific name without mutating the original object structure.
12373

124-
using ES2015+:
125-
126-
```js
127-
const newAnimals = {
128-
...animals,
129-
weasels: [...animals.weasels]
130-
}
131-
132-
newAnimals.weasels[1] = {
133-
...newAnimals.weasels[1],
134-
scientificName: 'Lutrinae'
135-
}
136-
```
137-
138-
using immutad●t:
139-
140-
```js
141-
const newAnimals = set(animals, 'weasels[1].scientificName', 'Lutrinae')
74+
const newAnimals = set(animals, 'weasels.lutraLutra.name', 'Lutrinae')
14275
```
14376

77+
Learn more about what immutad●t can do in the [Getting started](https://github.com/Zenika/immutadot/blob/master/docs/GETTING_STARTED.md).
14478

14579
Feel free to [try immutad●t on runkit](https://npm.runkit.com/immutadot).
14680

147-
## Path notation
148-
149-
immutad●t brings a few improvements to the classic dot notation:
150-
151-
### Slice notation
152-
153-
The slice notation lets you iterate over arrays to apply operations without having to map arrays at each level of imbrication.
154-
155-
We forgot to capitalize vernacular names in the [input](#Example).
156-
157-
using ES2015+:
81+
## Documentation
15882

159-
```js
160-
import { capitalize } from 'lodash'
161-
const newAnimals = {
162-
...animals,
163-
weasels: animals.weasels.map(weasel => {
164-
return {
165-
...weasel,
166-
vernacularName: capitalize(weasel.vernacularName),
167-
}
168-
}),
169-
}
170-
```
83+
### Getting started
17184

172-
using immutad●t-lodash:
85+
A fast overview of immutad●t's features is available in the [Getting started](https://github.com/Zenika/immutadot/blob/master/docs/GETTING_STARTED.md) guide.
17386

174-
```js
175-
import { capitalize } from 'immutadot-lodash'
176-
const newAnimals = capitalize(animals, 'weasels[:].vernacularName')
177-
```
87+
### API
17888

179-
### List notation
89+
The detailed API documentations of the different packages are available here:
90+
- [immutadot](https://zenika.github.io/immutadot/immutadot)
91+
- [immutadot-lodash](https://zenika.github.io/immutadot/immutadot-lodash/)
18092

181-
The list notation lets you iterate over the keys of objects used as collection or map to apply operations.
93+
Looking for older versions API documentation? Links are available [here](https://github.com/Zenika/immutadot/blob/master/docs/README.md).
18294

183-
```js
184-
toggle({ nested: { prop: { 1: { active: true }, 2: { active: false } } } }, 'nested.prop.{*}.active')
185-
// { nested: { prop: { 1: { active: false }, 2: { active: true }] } }
95+
### Migrating from 0.x versions
18696

187-
toLowerCase({ nested: { prop: { 1: { msg: 'Hello' }, 2: { msg: 'Hi' }, 3: { msg: 'Good morning' } } } }, 'nested.prop{2, 3}.msg')
188-
// { nested: { prop: { 1: { msg: 'Hello' }, 2: { msg: 'hi' }, 3: { msg: 'good morning' } } } }
189-
```
97+
If you were using a version of immutad●t previous to 1.0, check out the [migrating guide](docs/MIGRATING_TO_1_0.md).
19098

19199
## Performances
192100

@@ -218,19 +126,35 @@ Update large todos list (100000 items):
218126
immutad●t 1.0.0: ~23ops/s (44.15ms/op) on 500ops
219127
```
220128

221-
## Documentation
129+
## Immutability
222130

223-
### Getting started
131+
In the last few years one of our biggest challenge has been to find an efficient way to detect changes in our data to determine when to re-render our interfaces.
224132

225-
A fast overview of immutad●t's features is available in the [Getting started](https://github.com/Zenika/immutadot/blob/master/docs/GETTING_STARTED.md) guide.
133+
An immutable object is an object that cannot be changed once created. It brings several benefits<sup>[1](#notes)</sup>:
226134

227-
### API
135+
- Data changes detection made simple (Shallow comparison)
136+
- Memoization
137+
- Improve rendering performances
138+
- Explicit data changes
139+
- Avoid side effects
228140

229-
The detailed API documentations of the different packages are available here:
230-
- [immutadot](https://zenika.github.io/immutadot/immutadot)
231-
- [immutadot-lodash](https://zenika.github.io/immutadot/immutadot-lodash/)
141+
## Our approach
232142

233-
Looking for older versions API documentation? Links are available [here](https://github.com/Zenika/immutadot/blob/master/docs/README.md).
143+
### Concise
144+
145+
[ES2015+](https://mdn.io/JavaScript/Reference) new features are great to deal with arrays and objects. As data structures expand, the code you write to make data immutable gets bigger and less readable. immutad●t uses the dot notation to address this issue.
146+
147+
### Interoperability
148+
149+
immutad●t uses plain JavaScript objects so you can access your data using standard ways. Moreover, it lets you freely enjoy your favorite libraries.
150+
151+
### Exhaustive and yet extensible
152+
153+
immutad●t comes with a large set of built-in utilities, mostly based on [ES2015+](https://mdn.io/JavaScript/Reference). You can also find a package called [immutadot-lodash](https://github.com/Zenika/immutadot/tree/master/packages/immutadot-lodash) with some of [lodash](https://lodash.com/)'s utilities. You haven't found what you're looking for? Do it yourself with the [`convert`](https://zenika.github.io/immutadot/immutadot/1.0/core.html#.convert) feature.
154+
155+
### Learning curve
156+
157+
If you are already familiar with [ES2015+](https://mdn.io/JavaScript/Reference) and [lodash](https://lodash.com/) then you should be able to use immutad●t quickly.
234158

235159
## Contributing
236160

0 commit comments

Comments
 (0)