Commit 515e7c3
3.0.0 release readiness: cross-platform Observation, Cache pin, docs (#153)
* Cross-platform observation delivery + WebAssembly build support
#149 (WASM): switch Combine/OSLog/SwiftUI-gated #if !os(Linux) && !os(Windows)
guards to their canImport(...) checks. os(WASI) is neither Linux nor Windows, so the
old guards pulled Combine/SwiftUI into the wasm build. Keychain/iCloud stay Apple-only.
#150 (observation off Apple): delivery was bridged through Combine's
consume(object: cache) (Apple-only), so withObservationTracking never fired on
Linux/Windows/wasm. Now every mutation path (State/StoredState/FileState/SyncState/
SecureState/DependencySlice) calls notifyChange() directly on all platforms, and the
Combine cache bridge is removed so Apple still fires exactly once.
163 tests pass on macOS. Observation tests stay gated off Linux/Windows: swift-corelibs
-xctest cannot discover synchronous @mainactor test methods there (it force-casts test
thunks to () -> () and aborts) — a test-harness limitation, not a runtime one. The #150
delivery code itself is cross-platform. Full wasm build + Linux collection-typed state
also need the Cache fix (0xLeif/Cache#30).
Addresses #149, #150.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Prepare 3.0.0 release: pure Observation delivery, Cache pin, docs
- Drop the unused Combine cache bridge from Application; document that
notifyChange() must stay synchronous on the main thread
- Add CrossPlatformObservationTests (async @mainactor) so Linux/Windows CI
exercises Observation delivery; keep the fuller Apple-gated suites
- Gate ObservedDependency on canImport(SwiftUI) for WebAssembly
- Pin Cache to the 0xLeif/Cache#30 commit for WASM + Linux collection casts
- Point installation guides at 3.0.0; remove stale Examples fledge lane
Co-authored-by: Leif <leif.algo@pm.me>
* Fix CrossPlatformObservationTests: mutate via local var state
Application.state(...).value is an immutable rvalue; assign through a
mutable local like the other AppStateTests.
Co-authored-by: Leif <leif.algo@pm.me>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>1 parent 4325877 commit 515e7c3
30 files changed
Lines changed: 176 additions & 110 deletions
File tree
- Sources/AppState
- Application
- Types
- Dependency/Slice
- Helper
- State
- PropertyWrappers
- Dependency
- Slice
- State
- Slice
- Tests/AppStateTests
- documentation
- de
- en
- es
- fr
- hi
- pt
- ru
- zh-CN
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
390 | | - | |
| 390 | + | |
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | | - | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
| |||
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
17 | | - | |
| 15 | + | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
47 | 48 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | 55 | | |
63 | 56 | | |
64 | 57 | | |
| |||
77 | 70 | | |
78 | 71 | | |
79 | 72 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | 73 | | |
85 | 74 | | |
86 | 75 | | |
| |||
106 | 95 | | |
107 | 96 | | |
108 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
109 | 102 | | |
110 | 103 | | |
111 | 104 | | |
| |||
151 | 144 | | |
152 | 145 | | |
153 | 146 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | 147 | | |
185 | | - | |
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | 37 | | |
39 | | - | |
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
| |||
Lines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
30 | 45 | | |
31 | 46 | | |
32 | 47 | | |
| |||
47 | 62 | | |
48 | 63 | | |
49 | 64 | | |
50 | | - | |
| 65 | + | |
51 | 66 | | |
52 | 67 | | |
53 | 68 | | |
| |||
73 | 88 | | |
74 | 89 | | |
75 | 90 | | |
| 91 | + | |
76 | 92 | | |
77 | 93 | | |
78 | 94 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
0 commit comments