You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,33 @@ Dates are formatted as YYYY-MM-DD.
10
10
11
11
### Changed
12
12
13
-
### Improve TypeScript definition for `Map`
13
+
### [Minor BC break] Reducing file size / tree shaking
14
+
15
+
Immutable does not export a default object containing all it's API anymore.
16
+
It changes the output of your JS file if you use a bundler that supports tree-shaking (all modern bundler do).
17
+
As a drawback, you can not `immport Immutable` directly:
18
+
19
+
```diff
20
+
- import Immutable from 'immutable';
21
+
+ import { List, Map } from 'immutable';
22
+
23
+
- const l = Immutable.List([Immutable.Map({ a: 'A' })]);
24
+
+ const l = List([Map({ a: 'A' })]);
25
+
```
26
+
27
+
If you want the non-recommanded, but shorter migration path, you can do this:
28
+
29
+
```diff
30
+
- import Immutable from 'immutable';
31
+
+ import * as Immutable from 'immutable';
32
+
33
+
const l = Immutable.List([Immutable.Map({ a: 'A' })]);
34
+
```
35
+
36
+
### [TypeScript Break] Improve TypeScript definition for `Map`
37
+
38
+
> If you do use TypeScript, then this change does not impact you : no runtime change here.
39
+
> But if you use Map with TypeScript, this is a HUGE change !
14
40
15
41
Imagine the following code
16
42
@@ -121,6 +147,7 @@ For now, only `get`, `getIn`, `set`, `update`, `delete` and `remove` methods are
121
147
122
148
## [4.1.0] - 2022-05-23
123
149
150
+
-[BREAKING] The ES6 bundle no longer exposes a default export, which allows bundlers to apply tree-shaking. [#1888](https://github.com/immutable-js/immutable-js/pull/1888) by [bdurrer](https://github.com/bdurrer)
124
151
- Accept Symbol as Map key. [#1859](https://github.com/immutable-js/immutable-js/pull/1859) by [jdeniau](https://github.com/jdeniau)
125
152
- Optimize contructors without arguments [#1887](https://github.com/immutable-js/immutable-js/pull/1887) by [marianoguerra](https://github.com/marianoguerra)
126
153
- Fix Flow removeIn types [#1902](https://github.com/immutable-js/immutable-js/pull/1902) by [nifgraup](https://github.com/nifgraup)
0 commit comments