eddev 2.0.0-beta.28 → 2.0.0-beta.29

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.
@@ -3,7 +3,7 @@ import { Suspense } from "react";
3
3
  import { QueryClientProvider } from "@tanstack/react-query";
4
4
  import { getQueryClient } from "../utils/query-client.js";
5
5
  import { SSRRouter } from "../lib/routing/components/SSRRouter.js";
6
- import { normalizeRoute } from "../lib/routing/utils.js";
6
+ import { getRouteMeta, normalizeRoute } from "../lib/routing/utils.js";
7
7
  import { MetaTags } from "./MetaTags.js";
8
8
  export function SSRRoot(props) {
9
9
  const loader = props.loader;
@@ -19,6 +19,6 @@ export function SSRRoot(props) {
19
19
  pathname: props.pathname,
20
20
  query: {},
21
21
  hash: "",
22
- meta: {},
22
+ meta: getRouteMeta(props.initialData),
23
23
  }) }) }) }) })] }));
24
24
  }
@@ -24,9 +24,7 @@ if (env.client && !env.admin) {
24
24
  search: "",
25
25
  query: {},
26
26
  view: initialData.view,
27
- meta: {
28
- tags: initialData.meta?.head,
29
- },
27
+ meta: getRouteMeta(initialData),
30
28
  });
31
29
  history.replaceState(historyStateForRoute(initialRoute), "", document.location.href);
32
30
  $routeMetaStore.data = getRouteMeta(initialData);
@@ -207,9 +205,7 @@ export function BrowserRouter(props) {
207
205
  props: data.viewData?.data ?? {},
208
206
  component: lazyComponent,
209
207
  returnState: args.restoreState ?? {},
210
- meta: {
211
- tags: data.meta?.head,
212
- },
208
+ meta: getRouteMeta(data),
213
209
  });
214
210
  setState({
215
211
  pendingRoute: route,
@@ -141,6 +141,7 @@ export type TypedRouteState<T, TProps> = {
141
141
  meta: RouteMeta;
142
142
  };
143
143
  export type RouteMeta = {
144
+ title?: string;
144
145
  tags?: RouteMetaTag[];
145
146
  };
146
147
  export type RouteState = {
@@ -94,6 +94,7 @@ export function stringifyQuery(query) {
94
94
  }
95
95
  export function getRouteMeta(data) {
96
96
  return {
97
+ title: data.meta?.head.find((tag) => tag.tagName === "title")?.inner,
97
98
  tags: data.meta?.head ?? [],
98
99
  };
99
100
  }
@@ -1 +1 @@
1
- export declare const VERSION = "2.0.0-beta.28";
1
+ export declare const VERSION = "2.0.0-beta.29";
@@ -1 +1 @@
1
- export const VERSION = "2.0.0-beta.28";
1
+ export const VERSION = "2.0.0-beta.29";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "2.0.0-beta.28",
3
+ "version": "2.0.0-beta.29",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",