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: docs/Release-Readiness.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Status
4
4
5
-
Seven public alpha releases have been published: `0.1.0-alpha.0` through `0.1.0-alpha.7`.
5
+
Eight public alpha releases have been published: `0.1.0-alpha.0` through `0.1.0-alpha.8`.
6
6
7
7
Five packages are under the `@intent-framework/*` scope, four of which are published to npm. The server package `@intent-framework/server` remains private and unpublished.
8
8
@@ -29,7 +29,7 @@ Packages under `examples/` (e.g., `web-basic`) are private and must not be publi
29
29
30
30
| Field | Value | Status |
31
31
|---|---|---|
32
-
| Current version |`0.1.0-alpha.7`| Acceptable for alpha |
32
+
| Current version |`0.1.0-alpha.8`| Acceptable for alpha |
33
33
|`main`|`./dist/index.js`| Exists after build |
34
34
|`module`|`./dist/index.js`| Exists after build |
35
35
|`types`|`./dist/index.d.ts`| Exists after build |
@@ -47,7 +47,7 @@ Packages under `examples/` (e.g., `web-basic`) are private and must not be publi
47
47
48
48
| Field | Value | Status |
49
49
|---|---|---|
50
-
| Current version |`0.1.0-alpha.7`| Acceptable for alpha |
50
+
| Current version |`0.1.0-alpha.8`| Acceptable for alpha |
51
51
|`main`|`./dist/index.js`| Exists after build |
52
52
|`module`|`./dist/index.js`| Exists after build |
53
53
|`types`|`./dist/index.d.ts`| Exists after build |
@@ -63,7 +63,7 @@ Packages under `examples/` (e.g., `web-basic`) are private and must not be publi
63
63
64
64
| Field | Value | Status |
65
65
|---|---|---|
66
-
| Current version |`0.1.0-alpha.7`| Acceptable for alpha |
66
+
| Current version |`0.1.0-alpha.8`| Acceptable for alpha |
67
67
|`main`|`./dist/index.js`| Exists after build |
68
68
|`module`|`./dist/index.js`| Exists after build |
69
69
|`types`|`./dist/index.d.ts`| Exists after build |
@@ -79,7 +79,7 @@ Packages under `examples/` (e.g., `web-basic`) are private and must not be publi
79
79
80
80
| Field | Value | Status |
81
81
|---|---|---|
82
-
| Current version |`0.1.0-alpha.7`| Acceptable for alpha |
82
+
| Current version |`0.1.0-alpha.8`| Acceptable for alpha |
83
83
|`main`|`./dist/index.js`| Exists after build |
84
84
|`module`|`./dist/index.js`| Exists after build |
85
85
|`types`|`./dist/index.d.ts`| Exists after build |
@@ -214,7 +214,7 @@ All post-publish steps use the `NPM_TOKEN` / `NODE_AUTH_TOKEN` from the `npm` en
214
214
215
215
### Publish cadence
216
216
217
-
- Currently publishing **alpha releases** (`0.1.0-alpha.0` through `0.1.0-alpha.7` so far)
217
+
- Currently publishing **alpha releases** (`0.1.0-alpha.0` through `0.1.0-alpha.8` so far)
218
218
- Use `Changesets` pre-release mode for alpha/beta
219
219
- Graduate to stable after API surface is settled and real-world usage begins
220
220
@@ -273,20 +273,20 @@ Do not manually create GitHub Releases.
Copy file name to clipboardExpand all lines: examples/resource-lifecycle/README.md
+25-2Lines changed: 25 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Resource Lifecycle Example
2
2
3
-
A focused demonstration of the full resource lifecycle in Intent — autoLoad, manual load, reload, invalidation, stale detection, failed state, and action-driven invalidation.
3
+
A focused demonstration of the full resource lifecycle in Intent — autoLoad, manual load, reload, invalidation, stale detection, failed state, action-driven invalidation, and the cache options introduced in alpha.8.
4
4
5
5
## What it demonstrates
6
6
@@ -12,6 +12,8 @@ A focused demonstration of the full resource lifecycle in Intent — autoLoad, m
12
12
-`.invalidates(resource)` on an action — marks resources stale on success
13
13
- Resource "failed" status when a loader throws
14
14
- Route-driven resource load context
15
+
-`cache.staleTime` — resource transitions to stale automatically after a timeout (alpha.8)
16
+
-`cache.deduplicate` — concurrent loads share the same in-flight promise (alpha.8)
15
17
16
18
## Run
17
19
@@ -28,11 +30,32 @@ Open the local URL printed by Vite. Use the browser console to inspect resource
28
30
pnpm test
29
31
```
30
32
31
-
Tests cover every resource status transition: autoLoad, idle, pending, ready, stale, failed, and action-driven invalidation.
33
+
Tests cover every resource status transition: autoLoad, idle, pending, ready, stale, failed, action-driven invalidation, and the alpha.8 cache options.
32
34
33
35
## Inspect
34
36
35
37
- Watch the console log for resource load events and load counts
36
38
- Each reload increments the team version counter
37
39
- The "Broken save" action demonstrates a failed invalidation
40
+
-`cache.staleTime` on the `cachedTeam` resource auto-transitions to stale after 50ms
41
+
-`cache.deduplicate` on the `dedupeReport` resource shares concurrent load promises
38
42
- Test file (`src/ResourceDemo.test.ts`) shows the full resource API surface via `@intent-framework/testing`
43
+
44
+
## Cache options (alpha.8)
45
+
46
+
```ts
47
+
// staleTime — auto-stale after a timeout (ms)
48
+
const cachedTeam =$.resource("cachedTeam", {
49
+
load: async () =>loadTeam(),
50
+
cache: { staleTime: 50 },
51
+
})
52
+
53
+
// deduplicate — share in-flight promise between concurrent calls
54
+
const dedupeReport =$.resource("dedupeReport", {
55
+
load: async () =>loadReport(),
56
+
autoLoad: false,
57
+
cache: { deduplicate: true },
58
+
})
59
+
```
60
+
61
+
When no `cache` object is set, existing behavior is preserved (no deduplication, no time-based staleness).
0 commit comments