@askrjs/askr 0.3.0 → 0.3.1

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
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.3.1 — 2026-09-12
6
+
7
+ - fix(boot): move the SSR style registry carrier out of the hydration root
8
+ before mounting. `@askrjs/server` prepends the collected styles to the page
9
+ body, so they arrive as the first child of the mount root; that extra element
10
+ made the root's child list disagree with the rendered tree, which both cost
11
+ the app in-place hydration (the server node was replaced rather than adopted)
12
+ and discarded the carried CSS during reconciliation. The carrier now moves to
13
+ `<head>`, where it still applies and no longer participates in reconciliation.
14
+
5
15
  ## 0.3.0 — 2026-09-11
6
16
 
7
17
  - refactor(internal): rename `src/compatibility/` to names that describe what it
@@ -13,6 +23,15 @@
13
23
  - fix(runtime): reuse a context-free default abort reason during component
14
24
  teardown so retained signals do not retain departed component generations.
15
25
 
26
+ ## 0.2.4 — 2026-08-28
27
+
28
+ - feat(router): expose entry-local history state on `RouteSnapshot` as `state`,
29
+ with `hasState` distinguishing an omitted state from an explicit `undefined`.
30
+ Both are required members, so code that constructs a `RouteSnapshot` by hand
31
+ (test fixtures, adapters) must supply them; code that only reads snapshots is
32
+ unaffected.
33
+ - chore: refresh dependencies.
34
+
16
35
  ## 0.2.3 — 2026-08-25
17
36
 
18
37
  - fix(data): make mutation invalidation and reconcile retries generation-safe
package/dist/benchmark.js CHANGED
@@ -3,7 +3,7 @@ import { t as state } from "./state-BXJfudq1.js";
3
3
  import { t as selector } from "./selector-BSPVkjKP.js";
4
4
  import { i as For } from "./control-BR_mrX__.js";
5
5
  import { r as jsxs, t as jsx } from "./jsx-runtime-CPJXAOBF.js";
6
- import { r as createIsland, s as installRendererBridge } from "./boot-BMBMWUGI.js";
6
+ import { r as createIsland, s as installRendererBridge } from "./boot-DLplW9h4.js";
7
7
  //#region src/bench/components/benchmark-row.tsx
8
8
  function BenchmarkRow({ item, isSelected, onSelect, onRemove }) {
9
9
  return /* @__PURE__ */ jsxs("tr", {
@@ -62,8 +62,8 @@ function BenchmarkTable({ rows, isSelected, onSelect, onRemove }) {
62
62
  installRendererBridge();
63
63
  const benchmarkMetadata = {
64
64
  packageName: "@askrjs/askr",
65
- packageVersion: "0.3.0",
66
- buildLabel: "0.3.0-local"
65
+ packageVersion: "0.3.1",
66
+ buildLabel: "0.3.1-local"
67
67
  };
68
68
  function getBenchmarkMetadata() {
69
69
  return { ...benchmarkMetadata };
@@ -1,2 +1,2 @@
1
- import { a as cleanupApp, i as createIslands, n as createSPA, o as hasApp, r as createIsland, t as hydrateSPA } from "../boot-BMBMWUGI.js";
1
+ import { a as cleanupApp, i as createIslands, n as createSPA, o as hasApp, r as createIsland, t as hydrateSPA } from "../boot-DLplW9h4.js";
2
2
  export { cleanupApp, createIsland, createIslands, createSPA, hasApp, hydrateSPA };
@@ -638,6 +638,7 @@ async function createSPA(config) {
638
638
  //#endregion
639
639
  //#region src/boot/hydration.ts
640
640
  const DEFERRED_PAYLOAD = "__askr_deferred__";
641
+ const SSR_STYLE_REGISTRY_ATTR = "data-askr-style-registry";
641
642
  function applyDeferredStreamPatches(rootElement) {
642
643
  const patches = Array.from(rootElement.querySelectorAll("template[data-askr-deferred-patch]"));
643
644
  for (const template of patches) {
@@ -656,6 +657,24 @@ function hydrationReviver(_key, value) {
656
657
  if (payload[DEFERRED_PAYLOAD] === "rejected") return reviveDeferredValue("rejected", void 0, payload.error);
657
658
  return value;
658
659
  }
660
+ /**
661
+ * Relocate the SSR style registry carrier out of the hydration root.
662
+ *
663
+ * `@askrjs/server` prepends the collected styles to the page body, so they land
664
+ * as a direct child of the mount root. That extra element makes the root's
665
+ * child list disagree with the rendered tree, which costs the app in-place
666
+ * adoption and discards the carried CSS during reconciliation. The carrier is
667
+ * transport rather than application markup, so move it into `<head>`, where it
668
+ * still applies and no longer participates in reconciliation.
669
+ *
670
+ * Deferred style patches resolve the carrier with a document-wide query, so
671
+ * they keep working from its new position.
672
+ */
673
+ function adoptSsrStyleCarriers(rootElement) {
674
+ const head = document.head;
675
+ if (!head) return;
676
+ for (const child of Array.from(rootElement.children)) if (child instanceof HTMLStyleElement && child.hasAttribute(SSR_STYLE_REGISTRY_ATTR)) head.append(child);
677
+ }
659
678
  function takeHydrationRenderData(rootElement) {
660
679
  for (const child of Array.from(rootElement.children)) if (child instanceof HTMLScriptElement && child.getAttribute("data-askr-render-data") === "true") {
661
680
  const raw = child.textContent ?? "";
@@ -982,6 +1001,7 @@ async function hydrateSPA(config) {
982
1001
  const interactionReplay = beginHydrationInteractionReplay(rootElement, (boundary) => activateHydrationBoundary(rootElement, boundary), config.hydrate?.skipSelectors);
983
1002
  try {
984
1003
  applyDeferredStreamPatches(rootElement);
1004
+ adoptSsrStyleCarriers(rootElement);
985
1005
  const hydrationRenderData = takeHydrationRenderData(rootElement);
986
1006
  const hydrationQueryCache = hydrationRenderData?.resources;
987
1007
  if (hydrationQueryCache) hydrateDataRuntime(config.dataRuntime ?? getDefaultDataRuntime(), hydrationQueryCache);
@@ -3,7 +3,7 @@ import { v as recordReadableRead } from "../notify-DxxuDPeY.js";
3
3
  import { l as addInvalidationListener, t as createDataRuntime } from "../data-runtime-CxoY98lX.js";
4
4
  import { a as loadingQueryState, i as freshQueryState, o as refreshingQueryState, r as errorQueryState, s as staleQueryState } from "../data-2edW0jhF.js";
5
5
  import { a as normalizeAsyncDataError, o as notifySource, t as createReadableSource } from "../shared-kU8yvryp.js";
6
- import { a as cleanupApp, n as createSPA, r as createIsland } from "../boot-BMBMWUGI.js";
6
+ import { a as cleanupApp, n as createSPA, r as createIsland } from "../boot-DLplW9h4.js";
7
7
  import { r as computeRouteActivityMatches } from "../route-matching-CUzZ31gT.js";
8
8
  //#region src/testing/render.ts
9
9
  const renderStates = /* @__PURE__ */ new WeakMap();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askrjs/askr",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Lane-scheduled deterministic UI framework",
5
5
  "keywords": [
6
6
  "askr",