@tschk/moonshine-vue 0.4.49 → 0.4.80
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 +38 -34
- package/package.json +8 -5
- package/src/app.ts +426 -13
- package/src/context.ts +222 -16
- package/src/lifecycle.ts +80 -1
- package/src/map.ts +196 -0
- package/src/reactive.ts +1017 -28
- package/src/router.ts +1562 -0
- package/src/server-renderer.ts +257 -0
- package/src/slots.ts +26 -0
- package/src/store.ts +1042 -0
package/README.md
CHANGED
|
@@ -20,20 +20,23 @@ import { fromMoonshineSignal } from "@tschk/moonshine-vue";
|
|
|
20
20
|
import { ref } from "@tschk/moonshine-vue/reactive";
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
| Subpath
|
|
24
|
-
|
|
|
25
|
-
| `.`
|
|
26
|
-
| `./vue`
|
|
27
|
-
| `./compiler-sfc`
|
|
28
|
-
| `./reactive`
|
|
29
|
-
| `./context`
|
|
30
|
-
| `./lifecycle`
|
|
31
|
-
| `./text`
|
|
32
|
-
| `./props`
|
|
33
|
-
| `./events`
|
|
34
|
-
| `./normalize`
|
|
35
|
-
| `./expose`
|
|
36
|
-
| `./app`
|
|
23
|
+
| Subpath | Provides |
|
|
24
|
+
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
25
|
+
| `.` | signal bridges, lazy native SSR compatibility renderer |
|
|
26
|
+
| `./vue` | `vue` runtime re-exports |
|
|
27
|
+
| `./compiler-sfc` | `vue/compiler-sfc` re-exports |
|
|
28
|
+
| `./reactive` | native `ref`/`shallowRef`/`customRef`/`triggerRef`/`useTemplateRef`/`useModel`/`createModel`/`useId` (`ModelRef`, `DefineModelOptions`), `toRef`/`toRefs`/`unref`/`toValue`/`isRef`, `reactive`/`shallowReactive`/`readonly`/`shallowReadonly`, `isReactive`/`isReadonly`/`isShallow`/`isProxy`/`toRaw`/`markRaw`, `computed`, `watch`/`watchEffect`/`watchPostEffect`/`watchSyncEffect`/`onWatcherCleanup` (`WatchHandle`, `WatchEffect`, `WatchEffectOptions`), `nextTick`, `mergeProps`, `defineComponent`, `defineAsyncComponent` (`AsyncComponentOptions`), `Teleport` (`TeleportProps`), `KeepAlive` (`KeepAliveProps`, `MatchPattern`), `Transition` (`TransitionProps`), `TransitionGroup` (`TransitionGroupProps`), `Suspense` (`SuspenseProps`), `createApp`, `createSSRApp`, `definePlugin`, `resolveComponent`, `resolveDirective`, `withDirectives`, `warn`, `useSSRContext`, `version`, `effectScope`/`getCurrentScope`/`onScopeDispose` |
|
|
29
|
+
| `./context` | native component `provide`, `inject`, `hasInjectionContext`, `useId`, `useAttrs`, `useSlots` (`Slots`), `useSSRContext`, `withSSRContext`, `withSSRContextAsync` (`SSRContext`, `AppConfig`, `AppContextState`) |
|
|
30
|
+
| `./lifecycle` | native component `onBeforeMount`, `onMounted`, `onBeforeUpdate`, `onUpdated`, `onBeforeUnmount`, `onUnmounted`, `onActivated`, `onDeactivated`, `onServerPrefetch`, `onErrorCaptured` (`ErrorCapturedHook`) |
|
|
31
|
+
| `./text` | native DOM and SSR interpolation conversion |
|
|
32
|
+
| `./props` | compiler-facing shallow declared props and owned parent refresh |
|
|
33
|
+
| `./events` | compiler-facing typed component callbacks, callback arrays and per-instance once delivery |
|
|
34
|
+
| `./normalize` | native class/style normalization and compiler-facing DOM/SSR policies |
|
|
35
|
+
| `./expose` | compiler-facing `exposeRefs`, `bindRef`, `bindComponentRef`, and `useTemplateRef` for `defineExpose` and template refs |
|
|
36
|
+
| `./app` | native `createApp`, `createSSRApp`, `definePlugin`, `resolveComponent`, `resolveDirective`, `withDirectives`, `warn` returning a Vue 3 `App` instance (`version`, `config`, `_context`, `use`, `provide`, `runWithContext`, `component`, `directive`, `mixin`, `onUnmount`, `mount`, `unmount`) |
|
|
37
|
+
| `./server-renderer` | host-free Vue 3 SSR runtime (`renderToString`, `renderToWebStream`, `renderToSimpleStream`, `useSSRContext`, `SSRContext`, `ssrInterpolate`, `ssrRenderAttr`, `ssrRenderAttrs`, `ssrRenderClass`, `ssrRenderStyle`, `ssrRenderTeleport`) awaiting `onServerPrefetch` hooks and recording `<Teleport>` targets into `context.teleports` |
|
|
38
|
+
| `./router` | host-free Vue Router 4 runtime (`createRouter`, `createMemoryHistory`, `createWebHistory`, `createWebHashHistory`, `useRouter`, `useRoute`, `useLink`, `onBeforeRouteLeave`, `onBeforeRouteUpdate`, `RouterLink`, `RouterView`, `parseQuery`, `stringifyQuery`, `START_LOCATION`, `NavigationFailureType`, `isNavigationFailure`, `createRouterError`, `routerKey`, `routeLocationKey`, `routerViewLocationKey`) |
|
|
39
|
+
| `./store` | host-free Pinia store runtime (`createPinia`, `setActivePinia`, `getActivePinia`, `defineStore`, `storeToRefs`, `mapStores`, `mapState`, `mapGetters`, `mapWritableState`, `mapActions`, `setMapStoreSuffix`, `MutationType`, `piniaSymbol`) |
|
|
37
40
|
|
|
38
41
|
`./framework` exports the same lazy `crepusRenderer` compatibility name as the
|
|
39
42
|
root. Its optional `@tschk/moonshine-framework` peer is needed only when rendering.
|
|
@@ -49,27 +52,27 @@ Native `watch` requires `{ flush: "sync" }` and supports `immediate`, `deep`
|
|
|
49
52
|
default for `reactive`, depth `1` by default for `shallowReactive` or
|
|
50
53
|
`{ deep: false }`), `onWatcherCleanup(fn, failSilently?)`, and `WatchHandle`
|
|
51
54
|
(`stop()`, `pause()`, `resume()`, and callable `handle()`). Component
|
|
52
|
-
pre/post render scheduling and Vue
|
|
53
|
-
not implemented by this entry. Plain objects and
|
|
54
|
-
|
|
55
|
-
identity at integer array entries.
|
|
55
|
+
pre/post render scheduling and Vue WeakMap/WeakSet collection proxies are
|
|
56
|
+
not implemented by this entry. Plain objects, arrays, `Set`, and `Map` are
|
|
57
|
+
reactive; nested refs unwrap on object properties and retain their
|
|
58
|
+
identity at integer array entries and `Set`/`Map` collection entries.
|
|
56
59
|
Each watcher run can register multiple cleanup callbacks (via the callback's
|
|
57
60
|
third parameter or `onWatcherCleanup`). Reruns and stops drain
|
|
58
61
|
them in registration order, attempt all callbacks after a failure, and preserve
|
|
59
62
|
the first error. A cleanup that stops its watcher prevents another callback run.
|
|
60
63
|
|
|
61
|
-
### Native Set tracking
|
|
64
|
+
### Native Set and Map tracking
|
|
62
65
|
|
|
63
|
-
`reactive(new Set())`, `
|
|
64
|
-
`shallowReadonly
|
|
65
|
-
use the independent native graph. Membership
|
|
66
|
-
size, iteration and `forEach` track
|
|
67
|
-
missing deletions and empty clears do not notify. Object entries retain
|
|
68
|
-
raw/proxy membership identity and wrap on iteration in deep `reactive`/`readonly`; stored native refs retain
|
|
69
|
-
their identity. `shallowRef` keeps external
|
|
70
|
-
|
|
66
|
+
`reactive(new Set())`, `reactive(new Map())`, `shallowReactive`, `readonly`,
|
|
67
|
+
`shallowReadonly`, deep refs containing `Set`/`Map` instances, and `Set`/`Map` instances nested in plain state
|
|
68
|
+
use the independent native graph. Membership (`has`) and key lookups (`get`) track individual keys;
|
|
69
|
+
size, iteration (`keys`, `values`, `entries`, `[Symbol.iterator]`) and `forEach` track collection changes. Duplicate additions,
|
|
70
|
+
equal-value `Map.set` writes (`Object.is`), missing deletions and empty clears do not notify. Object keys and entries retain
|
|
71
|
+
raw/proxy membership identity and wrap on access/iteration in deep `reactive`/`readonly`; stored native refs retain
|
|
72
|
+
their identity. `shallowRef` keeps external `Set`/`Map` instances raw and tracks replacement only.
|
|
73
|
+
`WeakMap`/`WeakSet` reactivity and `Set` algebra methods remain unsupported. Mutating an original raw `Set` or `Map` bypasses notification.
|
|
71
74
|
|
|
72
|
-
The local compiler accepts unshadowed global `Set<T>` prop values. Local `Set`
|
|
75
|
+
The local compiler accepts unshadowed global `Set<T>` and `Map<K, V>` prop values. Local `Set` or `Map`
|
|
73
76
|
bindings, including conservative checks in nested scopes, remain rejected until
|
|
74
77
|
full type-resolution metadata is available. The existing authored counter fixture grows by 730 gzip bytes with
|
|
75
78
|
this support; the default signal kernel remains unchanged. No speed claim.
|
|
@@ -115,11 +118,11 @@ and synchronous `watch`) to re-evaluate after in-place mutations. `customRef((tr
|
|
|
115
118
|
creates a native ref with explicit dependency tracking and notification control.
|
|
116
119
|
|
|
117
120
|
`shallowReactive` tracks root-level object properties, array indices/length/mutations,
|
|
118
|
-
and `Set` membership without deep wrapping or nested ref unwrapping. `readonly`
|
|
119
|
-
creates a deep read-only view over plain objects, arrays, `Set`s, reactive proxies,
|
|
121
|
+
and `Set`/`Map` membership and entries without deep wrapping or nested ref unwrapping. `readonly`
|
|
122
|
+
creates a deep read-only view over plain objects, arrays, `Set`s, `Map`s, reactive proxies,
|
|
120
123
|
and refs (forwarding reactive tracking when wrapping a reactive target while throwing
|
|
121
|
-
`TypeError` on writes, deletes, `defineProperty`, or `Set` mutations); `shallowReadonly`
|
|
122
|
-
enforces read-only access only at the root level. `markRaw` marks an object or `
|
|
124
|
+
`TypeError` on writes, deletes, `defineProperty`, or `Set`/`Map` mutations); `shallowReadonly`
|
|
125
|
+
enforces read-only access only at the root level. `markRaw` marks an object, `Set`, or `Map`
|
|
123
126
|
so `reactive`, `shallowReactive`, `readonly`, `shallowReadonly`, and `ref` return it
|
|
124
127
|
unwrapped (both at root and nested positions), and `toRaw` unwraps any native proxy
|
|
125
128
|
layer back to the underlying raw object. `isReactive`, `isReadonly`, `isShallow`,
|
|
@@ -345,10 +348,11 @@ error. This follows native error handling rather than Vue's app error handler.
|
|
|
345
348
|
This entry does not supply scheduled `watchEffect` / `watchPostEffect` or a Vue
|
|
346
349
|
component render scheduler.
|
|
347
350
|
|
|
348
|
-
`./reactive` exports `toRefs(object)` for destructuring linked properties without
|
|
349
|
-
losing live reads or writes.
|
|
351
|
+
`./reactive` exports `toRefs(object)` and `proxyRefs(objectWithRefs)` (`ShallowUnwrapRef<T>`) for destructuring and unwrapping linked properties without
|
|
352
|
+
losing live reads or writes. `toRefs` snapshots enumerable string keys (including
|
|
350
353
|
inherited keys), omits symbols and preserves array length and holes. Properties
|
|
351
354
|
added later need `toRef(object, key)`. Existing native refs retain their identity.
|
|
355
|
+
`proxyRefs` shallowly unwraps ref reads and forwards non-ref property writes into existing refs while returning `reactive` objects unchanged.
|
|
352
356
|
Getter/setter descriptors keep their source receiver; writes to getter-only
|
|
353
357
|
properties throw. This does not implement Vue readonly-proxy warnings or SFC
|
|
354
358
|
compilation.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tschk/moonshine-vue",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.80",
|
|
4
4
|
"description": "Native composition helpers and signal bridges with optional legacy Vue runtime/compiler entries",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"type": "module",
|
|
@@ -25,18 +25,21 @@
|
|
|
25
25
|
"./normalize": "./src/normalize.ts",
|
|
26
26
|
"./errors": "./src/errors.ts",
|
|
27
27
|
"./expose": "./src/expose.ts",
|
|
28
|
-
"./app": "./src/app.ts"
|
|
28
|
+
"./app": "./src/app.ts",
|
|
29
|
+
"./router": "./src/router.ts",
|
|
30
|
+
"./store": "./src/store.ts",
|
|
31
|
+
"./server-renderer": "./src/server-renderer.ts"
|
|
29
32
|
},
|
|
30
33
|
"dependencies": {
|
|
31
|
-
"@tschk/moonshine": "^0.4.
|
|
32
|
-
"@tschk/moonshine-dom": "^0.4.
|
|
34
|
+
"@tschk/moonshine": "^0.4.80",
|
|
35
|
+
"@tschk/moonshine-dom": "^0.4.80"
|
|
33
36
|
},
|
|
34
37
|
"devDependencies": {
|
|
35
38
|
"typescript": "7.0.2"
|
|
36
39
|
},
|
|
37
40
|
"peerDependencies": {
|
|
38
41
|
"vue": ">=3",
|
|
39
|
-
"@tschk/moonshine-framework": "^0.4.
|
|
42
|
+
"@tschk/moonshine-framework": "^0.4.80"
|
|
40
43
|
},
|
|
41
44
|
"peerDependenciesMeta": {
|
|
42
45
|
"vue": {
|