eddev 2.0.0-beta.93 → 2.0.0-beta.95

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.
@@ -1,25 +1,20 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Suspense, useEffect, useState } from "react";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Suspense, useEffect } from "react";
3
3
  import { useSnapshot } from "valtio";
4
4
  import { BrowserRouter } from "../lib/routing/components/BrowserRouter.js";
5
5
  import { clientMetaTags } from "../lib/routing/context.js";
6
6
  import { APIProvider } from "../utils/APIProvider.js";
7
- import { MetaTags } from "./MetaTags.js";
8
7
  export function SSRClientRoot(props) {
9
- return (_jsx(APIProvider, { children: _jsx(Suspense, { children: _jsx(BrowserRouter, {}) }) }));
8
+ return (_jsxs(APIProvider, { children: [_jsx(DynamicMetaTags, {}), _jsx(Suspense, { children: _jsx(BrowserRouter, {}) })] }));
10
9
  }
11
- function DynamicMetaTags(props) {
10
+ function DynamicMetaTags() {
12
11
  const dynamicTags = useSnapshot(clientMetaTags).tags;
13
- return _jsx(MetaTags, { tags: dynamicTags ?? props.tags ?? [] });
14
- }
15
- function Trackers(props) {
16
- const [render, setRender] = useState(false);
17
- // @ts-ignore
18
- const trackers = window._TRACKERS;
19
12
  useEffect(() => {
20
- setRender(true);
21
- }, []);
22
- if (!render || !trackers || typeof trackers !== "object")
23
- return null;
24
- return (_jsx(_Fragment, { children: _jsx(MetaTags, { tags: trackers[props.position] ?? [] }) }));
13
+ dynamicTags?.forEach((tag) => {
14
+ if (tag.tagName === "title") {
15
+ document.title = tag.inner ?? "";
16
+ }
17
+ });
18
+ });
19
+ return null;
25
20
  }
@@ -1,10 +1,8 @@
1
- import { type ReactNode } from "react";
2
1
  import type { RouteLoader } from "../lib/routing/loader.js";
3
2
  import type { RouteData, RouteMetaTag } from "../lib/routing/types.js";
4
3
  export declare function SSRRoot(props: {
5
4
  pathname: string;
6
5
  initialData: RouteData;
7
- assets: ReactNode;
8
6
  loader: RouteLoader;
9
7
  metaTags: RouteMetaTag[];
10
8
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { renderAsset } from "@vinxi/react";
3
- import { Suspense } from "react";
4
3
  import { renderToPipeableStream, renderToString } from "react-dom/server";
5
4
  import { Writable } from "stream";
6
5
  import { MetaTags } from "../entry/MetaTags.js";
@@ -20,7 +19,7 @@ export async function getSsrStream(args) {
20
19
  // console.log(k)
21
20
  // }
22
21
  const dynamicAssets = new Set([]);
23
- const jsx = (_jsx(AssetCaptureContext.Provider, { value: dynamicAssets, children: _jsx(SSRRoot, { assets: _jsx(Suspense, { children: assets.map((m) => renderAsset(m)) }), metaTags: args.initialData?.meta?.head || [], pathname: args.pathname, initialData: args.initialData, loader: new RouteLoader() }) }));
22
+ const jsx = (_jsx(AssetCaptureContext.Provider, { value: dynamicAssets, children: _jsx(SSRRoot, { metaTags: args.initialData?.meta?.head || [], pathname: args.pathname, initialData: args.initialData, loader: new RouteLoader() }) }));
24
23
  const stream = await new Promise(async (resolve, reject) => {
25
24
  // console.log("Rendering to pipable")
26
25
  const stream = renderToPipeableStream(jsx, {
@@ -1 +1 @@
1
- export declare const VERSION = "2.0.0-beta.92";
1
+ export declare const VERSION = "2.0.0-beta.95";
@@ -1 +1 @@
1
- export const VERSION = "2.0.0-beta.92";
1
+ export const VERSION = "2.0.0-beta.95";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "2.0.0-beta.93",
3
+ "version": "2.0.0-beta.95",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",