25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CHANGELOG.md 5.8 KiB

3 년 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. # Change log
  2. All notable changes to this project will be documented in this file.
  3. This project adheres to [Semantic Versioning](http://semver.org/).
  4. ## [v2.5.4](https://github.com/reactjs/reselect/releases/tag/v2.5.4) - 2016/09/17
  5. ### Bug Fixes
  6. Improve performance of `defaultMemoize` when using custom equality check. (#170)
  7. ## [v2.5.3](https://github.com/reactjs/reselect/releases/tag/v2.5.3) - 2016/07/04
  8. ### Bug Fixes
  9. Reverts a Typescript change that was a breaking change. It will be reinstated in a major release. (#145)
  10. ## [v2.5.2](https://github.com/reactjs/reselect/releases/tag/v2.5.2) - 2016/07/03
  11. ### Bug Fixes
  12. When a selector uses defaultMemoize, if an exception is thrown for a set of arguments then the selector should also throw when called again with those arguments. (#144)
  13. ## [v2.5.1](https://github.com/reactjs/reselect/releases/tag/v2.5.1) - 2016/04/21
  14. ### Bug Fixes
  15. Include es directory in package.json (#117)
  16. ## [v2.5.0](https://github.com/reactjs/reselect/releases/tag/v2.5.0) - 2016/04/21
  17. ### New features
  18. Add jsnext build (#116)
  19. ## [v2.4.0](https://github.com/reactjs/reselect/releases/tag/v2.4.0) - 2016/04/16
  20. ### New features
  21. Add umd build (#112)
  22. ## [v2.3.0](https://github.com/reactjs/reselect/releases/tag/v2.3.0) - 2016/04/07
  23. ### New features
  24. Add `resultFunc` property to selectors (#92)
  25. ## [v2.2.0](https://github.com/reactjs/reselect/releases/tag/v2.2.0) - 2016/03/15
  26. ### New features
  27. Add Typescript typings to package.json (#94)
  28. ## [v2.1.0](https://github.com/reactjs/reselect/releases/tag/v2.1.0) - 2016/03/03
  29. ### New features
  30. Add `resetRecomputations` method to selectors (#90)
  31. ## [v2.0.3](https://github.com/reactjs/reselect/releases/tag/v2.0.3) - 2016/02/01
  32. ### New features
  33. Fix bug (#78) in `defaultMemoize` which could cause the memoized value to be mistakenly returned for variadic functions.
  34. ## [v2.0.2](https://github.com/reactjs/reselect/releases/tag/v2.0.2) - 2016/01/14
  35. ### New features
  36. Fix IE8 support by compiling in 'loose' mode
  37. ## [v2.0.1](https://github.com/reactjs/reselect/releases/tag/v2.0.1) - 2015/11/08
  38. ### Chore
  39. Update README and github links since move to reactjs.
  40. ## [v2.0.0](https://github.com/reactjs/reselect/releases/tag/v2.0.0) - 2015/10/02
  41. ### Breaking Changes
  42. #### `createSelector`, `createStructuredSelector`, and custom selector creators check arguments
  43. Input selectors are now verified to be functions during selector creation. If verification fails an error is thrown, allowing for a useful stack trace
  44. There is a small chance that this could cause a breaking change in code that contains a faulty selector that is never called.
  45. ## [v1.1.0](https://github.com/reactjs/reselect/releases/tag/v1.1.0) - 2015/09/16
  46. ### New features
  47. #### `createStructuredSelector`
  48. `createStructuredSelector` is a convenience function that helps with a common pattern when using Reselect. The selector passed to a connect decorator often just takes other selectors and maps them to keys in an object:
  49. ```js
  50. const mySelectorA = state => state.a;
  51. const mySelectorB = state => state.b;
  52. const structuredSelector = createSelector(
  53. mySelectorA,
  54. mySelectorB,
  55. mySelectorC,
  56. (a, b, c) => ({
  57. a,
  58. b,
  59. c
  60. })
  61. );
  62. ```
  63. `createStructuredSelector` takes an object whose properties are input-selectors and returns a structured selector. The structured selector returns an object with the same keys as the `inputSelectors` argument, but with the selectors replaced with their values.
  64. ```js
  65. const mySelectorA = state => state.a;
  66. const mySelectorB = state => state.b;
  67. const structuredSelector = createStructuredSelector({
  68. x: mySelectorA,
  69. y: mySelectorB
  70. });
  71. const result = structuredSelector({a: 1, b: 2}); // will produce {x: 1, y: 2}
  72. ```
  73. ## [v1.0.0](https://github.com/reactjs/reselect/releases/tag/v1.0.0) - 2015/09/09
  74. ### Breaking Changes
  75. If upgrading from 0.0.2, see the release notes for v1.0.0-alpha
  76. ## [v1.0.0-alpha2](https://github.com/reactjs/reselect/releases/tag/v1.0.0-alpha2) - 2015/09/01
  77. ### New features
  78. src directory included in npm package
  79. js:next field added to package.json
  80. ## [v1.0.0-alpha](https://github.com/reactjs/reselect/releases/tag/v1.0.0-alpha) - 2015/09/01
  81. ### Breaking Changes
  82. `createSelectorCreator` takes a user specified memoize function instead of a custom `valueEqualsFunc`.
  83. #### Before
  84. ```js
  85. import { isEqual } from 'lodash';
  86. import { createSelectorCreator } from 'reselect';
  87. const deepEqualsSelectorCreator = createSelectorCreator(isEqual);
  88. ```
  89. #### After
  90. ```js
  91. import { isEqual } from 'lodash';
  92. import { createSelectorCreator, defaultMemoize } from 'reselect';
  93. const deepEqualsSelectorCreator = createSelectorCreator(
  94. defaultMemoize,
  95. isEqual
  96. );
  97. ```
  98. ### New features
  99. #### Variadic Dependencies
  100. Selector creators can receive a variadic number of dependencies as well as an array of dependencies.
  101. #### Before
  102. ```js
  103. const selector = createSelector(
  104. [state => state.a, state => state.b],
  105. (a, b) => a * b
  106. );
  107. ```
  108. #### After
  109. ```js
  110. const selector = createSelector(
  111. state => state.a,
  112. state => state.b,
  113. (a, b) => a * b
  114. );
  115. ```
  116. #### Access `ownProps` in Selector
  117. Selector dependencies can receive a variadic number of parameters allowing a selector to receive `ownProps` passed from `mapToProps` in `connect`.
  118. ```js
  119. const selector = createSelector(
  120. (state) => state.a,
  121. (state, props) => state.b * props.c,
  122. (_, props) => props.d,
  123. (a, bc, d) => a + bc + d
  124. );
  125. ```
  126. #### Configurable Memoize Function
  127. ```js
  128. import { createSelectorCreator } from 'reselect';
  129. import memoize from 'lodash.memoize';
  130. let called = 0;
  131. const customSelectorCreator = createSelectorCreator(memoize, JSON.stringify);
  132. const selector = customSelectorCreator(
  133. state => state.a,
  134. state => state.b,
  135. (a, b) => {
  136. called++;
  137. return a + b;
  138. }
  139. );
  140. assert.equal(selector({a: 1, b: 2}), 3);
  141. assert.equal(selector({a: 1, b: 2}), 3);
  142. assert.equal(called, 1);
  143. assert.equal(selector({a: 2, b: 3}), 5);
  144. assert.equal(called, 2);
  145. ```