mikuru 1.0.20 → 1.0.22

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/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.22 - 2026-05-13
4
+
5
+ - Generalized component slot hydration to pass default, named, dynamic, and scoped slots through `props.children` and `props.slots`.
6
+ - Improved SSR component slots so dynamic slot names support scoped props and explicit default slot templates are exposed through `props.children`.
7
+ - Added async component hydration delegation so SSR-rendered async children inside `<AsyncBoundary>` can be reused after streaming SSR.
8
+ - Improved async component hydration fallback handling for loader errors, timeouts, and retry recovery.
9
+ - Added Teleport + AsyncBoundary hydration coverage for SSR target reuse, async child hydration, and sibling stability.
10
+ - Added route SSR Teleport collection and RouterView + Teleport hydration coverage.
11
+ - Added Teleport + ErrorBoundary hydration coverage for target-side DOM reuse and cleanup.
12
+ - Added Transition and TransitionGroup async-child hydration coverage for DOM reuse, keyed order, and cleanup.
13
+ - Added nested AsyncBoundary streaming SSR hydration coverage for parent/child async DOM reuse and cleanup.
14
+ - Added nested lazy RouterView SSR hydration coverage with route-level Teleport reuse.
15
+ - Expanded SSR/hydration examples and E2E coverage for lazy route Teleport and nested AsyncBoundary Teleport patterns.
16
+ - Added nested AsyncBoundary error and timeout hydration coverage for inner fallback retry, sibling stability, and cleanup.
17
+ - Added SSR `v-model` form-control state rendering for input, textarea, checkbox, radio, select, and multiple select hydration parity.
18
+ - Improved hydration diagnostics with phase/component/file context and `hydration:warning` devtools events.
19
+ - Updated README and docs to reflect current SSR/hydration, router, diagnostics, examples, and release checklist coverage.
20
+
21
+ ## 1.0.21 - 2026-05-13
22
+
23
+ - Added SSR and hydration support for initial `<ErrorBoundary>` children.
24
+ - Added SSR and hydration support for initial `<Transition>` children and v-if chains.
25
+ - Added SSR and hydration support for initial `<TransitionGroup>` keyed lists.
26
+ - Added hydration structural mismatch recovery with a remount fallback.
27
+ - Added `renderToStream()` for async iterable SSR output.
28
+ - Added SSR loader resolution and error fallback rendering for `defineAsyncComponent()`.
29
+ - Added Vite `.mikuru?ssr` and `.mikuru?hydrate` imports plus an SSR/hydration example and recovery E2E coverage.
30
+ - Added recovery-disabled E2E coverage plus nested built-in wrapper SSR/hydration tests.
31
+ - Added a router SSR/hydration example and browser E2E coverage for route rendering, hydration, redirects, guards, nested routes, and lazy route components.
32
+ - Added SSR and hydration support for generated `<RouterView>` and `<RouterLink>` usage in route components.
33
+ - Added hydration slot forwarding for component children so SSR-rendered `<RouterLink>` child content is preserved during hydration.
34
+ - Expanded RouterLink SSR/hydration E2E coverage for custom active classes, replace links, and child content.
35
+ - Stabilized the dogfood Debug Panel event clearing flow in browser E2E runs.
36
+
3
37
  ## 1.0.20 - 2026-05-13
4
38
 
5
39
  - Added SSR phase 1 with `compileSsr()` and `mikuru/server` helpers for escaped HTML, attributes, `v-if` chains, and `v-for` output.
package/README.md CHANGED
@@ -142,12 +142,13 @@ declare const Greeting: MikuruComponent<GreetingProps>;
142
142
  - Built-in `<Teleport to="#target">` for rendering content outside the current DOM position
143
143
  - Built-in `<AsyncBoundary :loading :fallback :delay :timeout>` for grouped async loading, delayed loading UI, boundary timeouts, and retryable async failures with aggregated fallback errors
144
144
  - Built-in `<ErrorBoundary :fallback>` for local component mount, descendant event handler, lifecycle, and cleanup fallbacks, with `errorInfo`, `retry`, `reset`, and `:reset-key` recovery
145
- - Runtime helpers including `ref`, `isRef`, `unref`, `toRef`, `toRefs`, `reactive`, `readonly`, lazy cached read-only and writable `computed`, `effect` with optional scheduling, `queueJob`/`flushJobs`, `watch`, `watchEffect` with cleanup callbacks, `nextTick`, lifecycle callbacks including KeepAlive activation hooks, `provide`, `inject`, and `defineAsyncComponent` with ErrorBoundary handoff
146
- - Routing through `mikuru/router` with route matching, history/hash/memory histories, guards, router context helpers, `RouterView`, and `RouterLink`
147
- - SSR through `compileSsr()` and `mikuru/server`, covering escaped text, static and bound attributes, content directives, `v-pre`, `v-cloak`, `v-if` chains, `v-for`, async child components, props, named/default slots, scoped slot props, component tree context, Teleport collection, and router route rendering with context propagation
148
- - Hydration through `compileHydration()` and `hydrateRoute()`, reusing existing SSR DOM while attaching events, syncing text/attributes, hydrating component context/lifecycle hooks, `v-show`, DOM and component `v-model`, `v-pre`, `v-cloak`, initial `v-if` / `v-for` DOM, Teleport target and disabled inline content, delegating child and route components to `hydrate()` when available, and optionally starting router history listening after route hydration
145
+ - Runtime helpers including `ref`, `isRef`, `unref`, `toRef`, `toRefs`, `reactive`, `readonly`, lazy cached read-only and writable `computed`, `effect` with optional scheduling, `queueJob`/`flushJobs`, `watch`, `watchEffect` with cleanup callbacks, `nextTick`, lifecycle callbacks including KeepAlive activation hooks, `provide`, `inject`, and `defineAsyncComponent` with ErrorBoundary handoff and SSR loader resolution
146
+ - Routing through `mikuru/router` with route matching, history/hash/memory histories, guards, router context helpers, and `RouterView` / `RouterLink` across mount, SSR, and hydration
147
+ - SSR through `compileSsr()` and `mikuru/server`, covering escaped text, static and bound attributes, content directives, `v-pre`, `v-cloak`, `v-if` chains, `v-for`, async child components, props, named/default slots, scoped slot props, component tree context, Teleport collection, string and async iterable stream rendering, and router route rendering with context propagation
148
+ - Hydration through `compileHydration()` and `hydrateRoute()`, reusing existing SSR DOM while attaching events, syncing text/attributes, recovering structural mismatches with an opt-out remount fallback, hydrating component context/lifecycle hooks, `v-show`, DOM and component `v-model`, `v-pre`, `v-cloak`, initial `v-if` / `v-for` DOM, Teleport target and disabled inline content, delegating child and route components to `hydrate()` when available, and optionally starting router history listening after route hydration
149
149
  - Style injection and basic `<style scoped>` selector rewriting
150
150
  - Compile errors with filenames, line/column information, code frames, and typo suggestions for built-in attributes, directives, and modifiers
151
+ - Debug diagnostics with optional generated `sourceURL`, unstable devtools metadata/events, and hydration warnings that include phase, component, and filename context
151
152
 
152
153
  ## Package Exports
153
154
 
@@ -180,7 +181,7 @@ Compiler, runtime, and server entries are public for lower-level integrations:
180
181
  ```ts
181
182
  import { compile, compileHydration, compileSsr } from "mikuru/compiler";
182
183
  import { effect, isRef, nextTick, reactive, readonly, ref, toRef, toRefs, unref, unwrap, watch } from "mikuru/runtime";
183
- import { hydrateRoute, renderComponentToString, renderRouteToString, renderToString } from "mikuru/server";
184
+ import { hydrateRoute, renderComponentToString, renderRouteToString, renderToStream, renderToString } from "mikuru/server";
184
185
  import type { MikuruAsyncBoundaryFallbackProps, MikuruErrorBoundaryFallbackProps, MikuruErrorInfo, MikuruErrorPhase } from "mikuru/runtime";
185
186
  ```
186
187
 
@@ -246,6 +247,8 @@ npm run test:create
246
247
  npm run test:package
247
248
  npm run test:pack
248
249
  npm run test:e2e
250
+ npm run test:e2e:router-ssr-hydration
251
+ npm run test:e2e:ssr-hydration
249
252
  ```
250
253
 
251
254
  Examples can be run from the repository root:
@@ -254,6 +257,8 @@ Examples can be run from the repository root:
254
257
  npm run dev:basic
255
258
  npm run dev:realworld
256
259
  npm run dev:dogfood
260
+ npm run dev:router-ssr-hydration
261
+ npm run dev:ssr-hydration
257
262
  npm run dev:mikuru-sample
258
263
  npm run dev:mikuru-vue-like
259
264
  ```
@@ -264,4 +269,5 @@ npm run dev:mikuru-vue-like
264
269
  - `docs/npm-usage.md` shows a manual Vite setup for package consumers.
265
270
  - `docs/app-architecture.md` describes how to keep larger Mikuru apps split across components, API modules, stores, forms, auth, and tests.
266
271
  - `docs/router.md` documents the runtime router.
272
+ - `docs/production-readiness.md` summarizes debugging, parser, package, SSR, and hydration caveats.
267
273
  - `docs/v1-api-contract.md` describes the v1 compatibility boundary used by this repository.
@@ -13,8 +13,8 @@ export function compileHydration(source, options = {}) {
13
13
  });
14
14
  const bindings = analyzeTemplate(ast, { source, filename: options.filename });
15
15
  const mountCode = generate(descriptor, ast, { debug: options.debug === true, batchedUpdates: options.batchedUpdates === true });
16
- const hydrationCode = generateHydration(descriptor, ast);
17
- const code = mountCode.replace("export default __mikuru_component;", `${hydrationCode}\nexport { hydrate };\nconst __mikuru_hydrationComponent = { ...__mikuru_component, hydrate };\nexport default __mikuru_hydrationComponent;`);
16
+ const hydrationCode = generateHydration(descriptor, ast, { includeImports: false });
17
+ const code = mountCode.replace("export default __mikuru_component;", `${hydrationCode}\nconst __mikuru_hydrationComponent = { ...__mikuru_component, hydrate };\nexport default __mikuru_hydrationComponent;`);
18
18
  const map = createSourceMap(code, descriptor, ast);
19
19
  return {
20
20
  code,
@@ -1 +1 @@
1
- {"version":3,"file":"compileHydration.js","sourceRoot":"","sources":["../../src/compiler/compileHydration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjD,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,UAA0B,EAAE;IAC3E,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtD,MAAM,GAAG,GAAG,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE;QAC7C,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,MAAM;QACN,MAAM,EAAE,UAAU,CAAC,cAAc;KAClC,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9E,MAAM,SAAS,GAAG,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,KAAK,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,KAAK,IAAI,EAAE,CA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,OAAO,CAAC,KAAK,KAAK,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,KAAK,IAAI,EAAE,CAAC,CAAC;IAChI,MAAM,aAAa,GAAG,iBAAiB,CAAC,UAAU,EAAE,GAAG,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC;IACpF,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,oCAAoC,EAAE,GAAG,aAAa,wHAAwH,CAAC,CAAC;IAC/M,MAAM,GAAG,GAAG,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;IAEnD,OAAO;QACL,IAAI;QACJ,GAAG;QACH,UAAU;QACV,GAAG;QACH,QAAQ;KACT,CAAC;AACJ,CAAC"}
@@ -1,2 +1,6 @@
1
1
  import type { ElementNode, SfcDescriptor } from "./types.js";
2
- export declare function generateHydration(descriptor: SfcDescriptor, root: ElementNode): string;
2
+ type GenerateHydrationOptions = {
3
+ includeImports?: boolean;
4
+ };
5
+ export declare function generateHydration(descriptor: SfcDescriptor, root: ElementNode, options?: GenerateHydrationOptions): string;
6
+ export {};