@legendapp/state 0.15.0-next.1 → 0.15.0-next.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/LICENSE +21 -0
  3. package/babel.js +309 -299
  4. package/babel.js.map +1 -1
  5. package/index.d.ts +17 -7
  6. package/index.js +253 -183
  7. package/index.js.map +1 -1
  8. package/index.mjs +240 -181
  9. package/index.mjs.map +1 -1
  10. package/internal.d.ts +1 -1
  11. package/internal.js +4 -0
  12. package/internal.js.map +1 -1
  13. package/internal.mjs +1 -1
  14. package/package.json +13 -5
  15. package/persist.js +2 -2
  16. package/persist.js.map +1 -1
  17. package/persist.mjs +3 -3
  18. package/persist.mjs.map +1 -1
  19. package/react-components.d.ts +1 -0
  20. package/react-components.js +41 -0
  21. package/react-components.js.map +1 -0
  22. package/react-components.mjs +39 -0
  23. package/react-components.mjs.map +1 -0
  24. package/react-native-components.d.ts +1 -0
  25. package/react-native-components.js +37 -0
  26. package/react-native-components.js.map +1 -0
  27. package/react-native-components.mjs +35 -0
  28. package/react-native-components.mjs.map +1 -0
  29. package/react-native-types.d.ts +8 -7
  30. package/react-types.d.ts +3 -1
  31. package/react.d.ts +1 -2
  32. package/react.js +133 -150
  33. package/react.js.map +1 -1
  34. package/react.mjs +134 -151
  35. package/react.mjs.map +1 -1
  36. package/src/{observableBatcher.d.ts → batching.d.ts} +4 -6
  37. package/src/computed.d.ts +2 -0
  38. package/src/{observableEvent.d.ts → event.d.ts} +1 -1
  39. package/src/globals.d.ts +6 -4
  40. package/src/helpers.d.ts +3 -1
  41. package/src/is.d.ts +1 -0
  42. package/src/observable.d.ts +7 -7
  43. package/src/observableInterfaces.d.ts +19 -19
  44. package/src/observe.d.ts +3 -0
  45. package/src/onChange.d.ts +2 -0
  46. package/src/react/flow.d.ts +31 -0
  47. package/src/react/useComputed.d.ts +6 -1
  48. package/src/react/useObserve.d.ts +1 -0
  49. package/src/{react/components.d.ts → react-components/react-components.d.ts} +1 -7
  50. package/src/{react-native/components.d.ts → react-native-components/rn-components.d.ts} +2 -6
  51. package/src/when.d.ts +2 -0
  52. package/state-types.d.ts +15 -0
  53. package/trace.js +5 -3
  54. package/trace.js.map +1 -1
  55. package/trace.mjs +6 -4
  56. package/trace.mjs.map +1 -1
  57. package/react-native.d.ts +0 -1
  58. package/react-native.js +0 -132
  59. package/react-native.js.map +0 -1
  60. package/react-native.mjs +0 -128
  61. package/react-native.mjs.map +0 -1
  62. package/src/observableComputed.d.ts +0 -2
  63. package/src/on.d.ts +0 -6
  64. package/src/react/controlFlow.d.ts +0 -28
  65. package/src/react/useObserver.d.ts +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,62 @@
1
+ ## 0.14.5
2
+ - Feat: Allow passing observables directly to Show
3
+ - Fix: Usage of old observe() when if prop is an observable
4
+
5
+ ## 0.14.4
6
+ - Fix: Some issues in remote persistence plugins (not yet released)
7
+
8
+ ## 0.14.3
9
+ - Fix: Some issues in remote persistence plugins (not yet released)
10
+
11
+ ## 0.14.2
12
+ - Fix: Old versions of React Native were crashing because of using `React.` without importing it
13
+
14
+ ## 0.14.1
15
+ - Fix: `For` component with children re-renders with the latest children correctly
16
+
17
+ ## 0.14.0
18
+ - Feature: A `For` component for easy rendering with array optimizations
19
+ - Fix: Improve performance of observer
20
+ - Fix: Support `_id` or `__id` field names for array optimizations
21
+ - Fix: Mixing shallow and non-shallow listeners in a component could have not mixed correctly
22
+
23
+ ## 0.13.2
24
+ - Types: Renamed exported types for improved clarity
25
+
26
+ ## 0.13.1
27
+ - Fix: Exported components were losing className/style when not using bind prop
28
+
29
+ ## 0.13.0
30
+ - Breaking Change: Removed observe() and prop(), favoring get() and ref(). get() tracks by default and ref() does not.
31
+ - Feat: Support ref to a path on an undefined value
32
+ - Fix: A crash when calling get() on an observable with undefined parents
33
+ - Types: Enforce bind prop to not be a primitive
34
+
35
+ ## 0.12.1
36
+ - Types: Improved types of exported components
37
+
38
+ ## 0.12.0
39
+ - Feat: Allow direct assignment, with warnings to catch accidental errors, and an optional "safe" mode
40
+ - Feat: input components with `bind` prop that automatically binds an observable to value and onChange
41
+ - Feat: Support keyed ref: `obs.ref('key')`
42
+ - Feat: `onChange` has a `runImmediately` option
43
+ - Fix: `.ref()` and `.get()` inside an `observer` do reference counting so they don't untrack too aggressively
44
+ - Fix: `delete()` was notifying listeners with the value undefined, but the key not yet deleted
45
+ - Fix: `observer` was sometimes missing updates occurring between render and mount
46
+
47
+ ## 0.11.0-beta.7
48
+ - Fix: New set option with function parameter was breaking persistence
49
+ - Fix: Component useEffect was getting called before observer could listen for changes
50
+
51
+ ## 0.11.0-beta.6
52
+ - Fix: Babel plugin adds imports only once, only if not already imported
53
+
54
+ ## 0.11.0-beta.5
55
+ - Feat: `set()` can take a function to easily compute it relative to the previous value
56
+
57
+ ## 0.11.0-beta.4
58
+ - Feat: Added `traceListeners` and `traceUpdates` functions (exported from @legendapp/state/trace). Call them within an observer. `traceListeners` logs the path of all tracked observables, while `traceUpdates` logs details of each observable change that causes a render.
59
+
60
+ ## 0.11.0-beta.3
61
+ - Fix: observer was not working the first time in StrictMode
62
+ - Fix: observer was not cleaning up old listeners when the the tracked observables changed
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Moo.do LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.