@xmachines/play-vue 5.0.2 → 6.1.0
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.
- package/README.md +4 -6
- package/dist/ActorProvider.js +0 -7
- package/dist/PlayRenderer.js +0 -7
- package/dist/PlayUIProvider.js +0 -7
- package/dist/types.d.ts +4 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Vue 3 renderer for the XMachines Play Architecture. It observes the actor atoms and renders the UI through `@xmachines/json-render-vue`.
|
|
4
4
|
|
|
5
|
-
[](https://opensource.org/licenses/MIT) [](https://opensource.org/licenses/MIT) [](https://www.npmjs.com/package/@xmachines/play-vue)
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -27,7 +27,7 @@ pnpm add @xmachines/play-vue
|
|
|
27
27
|
**Peer dependencies.** Install them with the package:
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
pnpm add vue@^3.5.0 @xmachines/play @xmachines/play-atom @xstate/store@^4.2.3 @xmachines/json-render-vue@^0.
|
|
30
|
+
pnpm add vue@^3.5.0 @xmachines/core @xmachines/play @xmachines/play-atom @xstate/store@^4.2.3 @xmachines/json-render-vue@^0.21.0-xm.2 @xmachines/json-render-core@^0.21.0-xm.2 @xmachines/json-render-xstate@^0.21.0-xm.2
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
`@xstate/store` is the peer of [`@xmachines/play-atom`](../play-atom/README.md), and not of this
|
|
@@ -98,11 +98,11 @@ The composite provider. It wraps `<ActorProvider>` and `JSONUIProvider` in one c
|
|
|
98
98
|
|
|
99
99
|
The provider contains an error of the **render** of a descendant — the render function, the setup function, and a lifecycle hook — so that a subtree that throws cannot take the whole application down. It calls `onError`, and it renders the `fallback` slot instead of the children. The next view emission clears the error, so a view transition retries the render. A throw of a catalog component reaches the per-element boundary of `@xmachines/json-render-vue` first, and `onRenderError` reports it; this boundary is the outer net for everything else.
|
|
100
100
|
|
|
101
|
-
The boundary stops a render error, so `app.config.errorHandler`
|
|
101
|
+
The boundary stops a render error, so `app.config.errorHandler` does not see it. Without an `onError` prop the provider therefore writes the error to `console.error`.
|
|
102
102
|
|
|
103
103
|
The second parameter is the **reset**, for a retry that the host starts. It renders the view that the actor holds at the moment of the call, so a retry cannot rewind the screen to the view that failed. A reset that the host calls from inside the handler does nothing, because no input changed between the two attempts, and a reset after the provider goes away does nothing. The five renderers hold the same three rules.
|
|
104
104
|
|
|
105
|
-
**A handler that throws reaches no caller.** The provider contains that throw, and it writes the throw to `console.error`. The errored flag schedules a render, so a throw that left the handler would stop that render and skip the `return false` of `onErrorCaptured`: the subtree that threw stays on the screen and the error reaches `app.config.errorHandler` as well. Report a failure from `onError`. To escalate one, raise it from a task of your own — `
|
|
105
|
+
**A handler that throws reaches no caller.** The provider contains that throw, and it writes the throw to `console.error`. The errored flag schedules a render, so a throw that left the handler would stop that render and skip the `return false` of `onErrorCaptured`: the subtree that threw stays on the screen and the error reaches `app.config.errorHandler` as well. Report a failure from `onError`. To escalate one, raise it from a task of your own — `rethrowLater(error)` of [`@xmachines/core/utils`](../core/README.md) — which reaches the global handler of the page and leaves the containment whole. Install that package next to this one, because your code imports it and a package manager such as pnpm does not let your code import a package that it does not declare. The five renderers hold this one rule.
|
|
106
106
|
|
|
107
107
|
`onErrorCaptured` of Vue also fires for an error of an **event handler** and of a **watcher callback**, which the boundaries of React, Solid, and Svelte each see never. The provider leaves such an error alone: the view stays on the screen, `onError` stays silent, and the error continues to `app.config.errorHandler` exactly as it does without this provider. A click handler that throws therefore does not replace your view with the fallback, and it reaches your global handler one time. `onError` reports a failure of the render, in every renderer.
|
|
108
108
|
|
|
@@ -195,8 +195,6 @@ const view = usePlayView();
|
|
|
195
195
|
|
|
196
196
|
`usePlayView()` returns a **Proxy**: every property read goes to the live context of the provider.
|
|
197
197
|
|
|
198
|
-
> **Note:** `usePlayView` was named `getPlayViewContext` before. That alias is gone.
|
|
199
|
-
|
|
200
198
|
---
|
|
201
199
|
|
|
202
200
|
### Re-exported from `@xmachines/json-render-vue`
|
package/dist/ActorProvider.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import "./actor-provider-context.js";
|
|
2
2
|
import ActorProvider_vue_vue_type_script_lang_default from "./ActorProvider.vue_vue_type_script_lang.js";
|
|
3
|
-
import { useSSRContext } from "vue";
|
|
4
3
|
//#region packages/play-vue/src/ActorProvider.vue
|
|
5
|
-
var _sfc_setup = ActorProvider_vue_vue_type_script_lang_default.setup;
|
|
6
|
-
ActorProvider_vue_vue_type_script_lang_default.setup = (props, ctx) => {
|
|
7
|
-
const ssrContext = useSSRContext();
|
|
8
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("packages/play-vue/src/ActorProvider.vue");
|
|
9
|
-
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
10
|
-
};
|
|
11
4
|
var ActorProvider_default = ActorProvider_vue_vue_type_script_lang_default;
|
|
12
5
|
//#endregion
|
|
13
6
|
export { ActorProvider_default as default };
|
package/dist/PlayRenderer.js
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import PlayRenderer_vue_vue_type_script_lang_default from "./PlayRenderer.vue_vue_type_script_lang.js";
|
|
2
|
-
import { useSSRContext } from "vue";
|
|
3
2
|
//#region packages/play-vue/src/PlayRenderer.vue
|
|
4
|
-
var _sfc_setup = PlayRenderer_vue_vue_type_script_lang_default.setup;
|
|
5
|
-
PlayRenderer_vue_vue_type_script_lang_default.setup = (props, ctx) => {
|
|
6
|
-
const ssrContext = useSSRContext();
|
|
7
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("packages/play-vue/src/PlayRenderer.vue");
|
|
8
|
-
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
9
|
-
};
|
|
10
3
|
var PlayRenderer_default = PlayRenderer_vue_vue_type_script_lang_default;
|
|
11
4
|
//#endregion
|
|
12
5
|
export { PlayRenderer_default as default };
|
package/dist/PlayUIProvider.js
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import PlayUIProvider_vue_vue_type_script_lang_default from "./PlayUIProvider.vue_vue_type_script_lang.js";
|
|
2
|
-
import { useSSRContext } from "vue";
|
|
3
2
|
//#region packages/play-vue/src/PlayUIProvider.vue
|
|
4
|
-
var _sfc_setup = PlayUIProvider_vue_vue_type_script_lang_default.setup;
|
|
5
|
-
PlayUIProvider_vue_vue_type_script_lang_default.setup = (props, ctx) => {
|
|
6
|
-
const ssrContext = useSSRContext();
|
|
7
|
-
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("packages/play-vue/src/PlayUIProvider.vue");
|
|
8
|
-
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
9
|
-
};
|
|
10
3
|
var PlayUIProvider_default = PlayUIProvider_vue_vue_type_script_lang_default;
|
|
11
4
|
//#endregion
|
|
12
5
|
export { PlayUIProvider_default as default };
|
package/dist/types.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export interface ActorProviderProps extends BaseActorProviderProps<DefineRegistr
|
|
|
47
47
|
* `currentView` changes), so a view transition retries the render.
|
|
48
48
|
*
|
|
49
49
|
* The boundary stops the error. Without this prop the provider therefore writes the
|
|
50
|
-
* error to `console.error`, because `app.config.errorHandler`
|
|
50
|
+
* error to `console.error`, because `app.config.errorHandler` does not see it.
|
|
51
51
|
*
|
|
52
52
|
* Element-level catalog component throws are caught upstream by the per-element
|
|
53
53
|
* boundary of @json-render, and reported through `onRenderError`. This boundary is
|
|
@@ -68,8 +68,9 @@ export interface ActorProviderProps extends BaseActorProviderProps<DefineRegistr
|
|
|
68
68
|
* `app.config.errorHandler`.
|
|
69
69
|
*
|
|
70
70
|
* Report a failure from this handler. To ESCALATE one, raise it from a task of your
|
|
71
|
-
* own — `
|
|
72
|
-
* the page and leaves the containment whole. The
|
|
71
|
+
* own — `rethrowLater(error)` of `@xmachines/core/utils` — which reaches the global handler of
|
|
72
|
+
* the page and leaves the containment whole. The host installs `@xmachines/core` itself.
|
|
73
|
+
* The five renderers hold this one rule.
|
|
73
74
|
*/
|
|
74
75
|
onError?: (error: unknown, reset: () => void) => void;
|
|
75
76
|
}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB,CAAC,oBAAoB,CAAC;IACvF
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB,CAAC,oBAAoB,CAAC;IACvF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwDG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CACtD;AAED;;GAEG;AACH,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC9D,uGAAuG;IACvG,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,0EAA0E;IAC1E,mBAAmB,CAAC,EAAE,MAAM,CAC3B,MAAM,EACN,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAC3D,CAAC;IACF,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CACjB,MAAM,EACN,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAC5E,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmachines/play-vue",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "Vue renderer for XMachines Play architecture",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"reactive",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"test:watch": "vitest"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@xmachines/play-actor": "
|
|
50
|
-
"@xmachines/play-view": "
|
|
49
|
+
"@xmachines/play-actor": "6.1.0",
|
|
50
|
+
"@xmachines/play-view": "6.1.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@testing-library/jest-dom": "^7.0.1",
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
"@vitejs/plugin-vue": "^6.0.9",
|
|
56
56
|
"@vitest/browser-playwright": "^5.0.1",
|
|
57
57
|
"@vue/test-utils": "^2.5.0",
|
|
58
|
-
"@xmachines/json-render-core": "^0.
|
|
59
|
-
"@xmachines/json-render-vue": "^0.
|
|
60
|
-
"@xmachines/json-render-xstate": "^0.
|
|
61
|
-
"@xmachines/play": "
|
|
62
|
-
"@xmachines/play-atom": "
|
|
58
|
+
"@xmachines/json-render-core": "^0.21.0-xm.2",
|
|
59
|
+
"@xmachines/json-render-vue": "^0.21.0-xm.2",
|
|
60
|
+
"@xmachines/json-render-xstate": "^0.21.0-xm.2",
|
|
61
|
+
"@xmachines/play": "6.1.0",
|
|
62
|
+
"@xmachines/play-atom": "6.1.0",
|
|
63
63
|
"oxfmt": "^0.70.0",
|
|
64
64
|
"oxlint": "^1.85.0",
|
|
65
65
|
"typescript": "^5.9.3 || ^6.0.3",
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
"zod": "^4.6.5"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@xmachines/json-render-core": "^0.
|
|
75
|
-
"@xmachines/json-render-vue": "^0.
|
|
76
|
-
"@xmachines/json-render-xstate": "^0.
|
|
77
|
-
"@xmachines/play": "
|
|
78
|
-
"@xmachines/play-atom": "
|
|
74
|
+
"@xmachines/json-render-core": "^0.21.0-xm.2",
|
|
75
|
+
"@xmachines/json-render-vue": "^0.21.0-xm.2",
|
|
76
|
+
"@xmachines/json-render-xstate": "^0.21.0-xm.2",
|
|
77
|
+
"@xmachines/play": "6.1.0",
|
|
78
|
+
"@xmachines/play-atom": "6.1.0",
|
|
79
79
|
"vue": "^3.5.0"
|
|
80
80
|
},
|
|
81
81
|
"engines": {
|