🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@tanstack/solid-router

Package Overview
Dependencies
Maintainers
7
Versions
435
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/solid-router - npm Package Compare versions

Comparing version
2.0.0-beta.15
to
2.0.0-beta.16
+4
-4
dist/cjs/HeadContent.cjs

@@ -17,3 +17,3 @@ require("./_virtual/_rolldown/runtime.cjs");

const router = require_useRouter.useRouter();
const content = () => (0, _solidjs_web.createComponent)(solid_js.For, {
const content = () => [(0, _solidjs_web.createComponent)(_solidjs_web.HydrationScript, {}), (0, _solidjs_web.createComponent)(solid_js.For, {
get each() {

@@ -36,4 +36,4 @@ return tags();

}
});
return _solidjs_web.isServer ?? router.isServer ? content() : (0, _solidjs_web.createComponent)(_solidjs_web.Portal, {
})];
return _solidjs_web.isServer ?? router.isServer ? content() : [(0, _solidjs_web.createComponent)(_solidjs_web.HydrationScript, {}), (0, _solidjs_web.createComponent)(_solidjs_web.Portal, {
get mount() {

@@ -45,3 +45,3 @@ return document.head;

}
});
})];
}

@@ -48,0 +48,0 @@ //#endregion

@@ -1,1 +0,1 @@

{"version":3,"file":"HeadContent.cjs","names":["For","Portal","isServer","Asset","useRouter","useTags","AssetCrossOriginConfig","HeadContentProps","assetCrossOrigin","HeadContent","props","tags","router","content","_$createComponent","each","children","tag","t","attrs","mount","document","head"],"sources":["../../src/HeadContent.tsx"],"sourcesContent":["import { For } from 'solid-js'\nimport { Portal, isServer } from '@solidjs/web'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport { useTags } from './headContentUtils'\nimport type { AssetCrossOriginConfig } from '@tanstack/router-core'\n\nexport interface HeadContentProps {\n assetCrossOrigin?: AssetCrossOriginConfig\n}\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * When using full document hydration (hydrating from `<html>`), this component should be rendered in the `<body>`\n * to ensure it's part of the reactive tree and updates correctly during client-side navigation.\n * The component uses portals internally to render content into the `<head>` element.\n */\nexport function HeadContent(props: HeadContentProps) {\n const tags = useTags(props.assetCrossOrigin)\n const router = useRouter()\n\n const content = () => (\n <For each={tags()}>\n {(tag) => {\n const t = tag() as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>\n )\n\n return (isServer ?? router.isServer) ? (\n content()\n ) : (\n <Portal mount={document.head}>{content()}</Portal>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAiBA,SAAgBS,YAAYC,OAAyB;CACnD,MAAMC,OAAON,yBAAAA,QAAQK,MAAMF,iBAAiB;CAC5C,MAAMI,SAASR,kBAAAA,WAAW;CAE1B,MAAMS,iBAAAA,GAAAA,aAAAA,iBACHb,SAAAA,KAAG;EAAA,IAACe,OAAI;AAAA,UAAEJ,MAAM;;EAAAK,WACbC,QAAQ;GACR,MAAMC,IAAID,KAAK;AACf,WAAA,GAAA,aAAA,iBAAQd,cAAAA,OAAK;IAAA,IAACc,MAAG;AAAA,YAAEC,EAAED;;IAAG,IAAEE,QAAK;AAAA,YAAED,EAAEC;;IAAK,IAAEH,WAAQ;AAAA,YAAEE,EAAEF;;IAAQ,CAAA;;EAC/D,CAEJ;AAED,QAAQd,aAAAA,YAAYU,OAAOV,WACzBW,SAAS,IAAA,GAAA,aAAA,iBAERZ,aAAAA,QAAM;EAAA,IAACmB,QAAK;AAAA,UAAEC,SAASC;;EAAI,IAAAN,WAAA;AAAA,UAAGH,SAAS;;EAAA,CACzC"}
{"version":3,"file":"HeadContent.cjs","names":["For","HydrationScript","Portal","isServer","Asset","useRouter","useTags","AssetCrossOriginConfig","HeadContentProps","assetCrossOrigin","HeadContent","props","tags","router","content","_$createComponent","each","children","tag","t","attrs","mount","document","head"],"sources":["../../src/HeadContent.tsx"],"sourcesContent":["import { For } from 'solid-js'\nimport { HydrationScript, Portal, isServer } from '@solidjs/web'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport { useTags } from './headContentUtils'\nimport type { AssetCrossOriginConfig } from '@tanstack/router-core'\n\nexport interface HeadContentProps {\n assetCrossOrigin?: AssetCrossOriginConfig\n}\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * When using full document hydration (hydrating from `<html>`), this component should be rendered in the `<body>`\n * to ensure it's part of the reactive tree and updates correctly during client-side navigation.\n * The component uses portals internally to render content into the `<head>` element.\n */\nexport function HeadContent(props: HeadContentProps) {\n const tags = useTags(props.assetCrossOrigin)\n const router = useRouter()\n\n const content = () => (\n <>\n <HydrationScript />\n <For each={tags()}>\n {(tag) => {\n const t = tag() as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>\n </>\n )\n\n return (isServer ?? router.isServer) ? (\n content()\n ) : (\n <>\n <HydrationScript />\n <Portal mount={document.head}>{content()}</Portal>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAiBA,SAAgBU,YAAYC,OAAyB;CACnD,MAAMC,OAAON,yBAAAA,QAAQK,MAAMF,iBAAiB;CAC5C,MAAMI,SAASR,kBAAAA,WAAW;CAE1B,MAAMS,gBAAU,EAAA,GAAA,aAAA,iBAEXb,aAAAA,iBAAe,EAAA,CAAA,GAAA,GAAA,aAAA,iBACfD,SAAAA,KAAG;EAAA,IAACgB,OAAI;AAAA,UAAEJ,MAAM;;EAAAK,WACbC,QAAQ;GACR,MAAMC,IAAID,KAAK;AACf,WAAA,GAAA,aAAA,iBAAQd,cAAAA,OAAK;IAAA,IAACc,MAAG;AAAA,YAAEC,EAAED;;IAAG,IAAEE,QAAK;AAAA,YAAED,EAAEC;;IAAK,IAAEH,WAAQ;AAAA,YAAEE,EAAEF;;IAAQ,CAAA;;EAC/D,CAAA,CAGN;AAED,QAAQd,aAAAA,YAAYU,OAAOV,WACzBW,SAAS,GAAA,EAAA,GAAA,aAAA,iBAGNb,aAAAA,iBAAe,EAAA,CAAA,GAAA,GAAA,aAAA,iBACfC,aAAAA,QAAM;EAAA,IAACmB,QAAK;AAAA,UAAEC,SAASC;;EAAI,IAAAN,WAAA;AAAA,UAAGH,SAAS;;EAAA,CAAA,CAE3C"}
import { useRouter } from "./useRouter.js";
import { Asset } from "./Asset.js";
import { useTags } from "./headContentUtils.js";
import { Portal, createComponent, isServer } from "@solidjs/web";
import { HydrationScript, Portal, createComponent, isServer } from "@solidjs/web";
import { For } from "solid-js";

@@ -16,3 +16,3 @@ //#region src/HeadContent.tsx

const router = useRouter();
const content = () => createComponent(For, {
const content = () => [createComponent(HydrationScript, {}), createComponent(For, {
get each() {

@@ -35,4 +35,4 @@ return tags();

}
});
return isServer ?? router.isServer ? content() : createComponent(Portal, {
})];
return isServer ?? router.isServer ? content() : [createComponent(HydrationScript, {}), createComponent(Portal, {
get mount() {

@@ -44,3 +44,3 @@ return document.head;

}
});
})];
}

@@ -47,0 +47,0 @@ //#endregion

@@ -1,1 +0,1 @@

{"version":3,"file":"HeadContent.js","names":["For","Portal","isServer","Asset","useRouter","useTags","AssetCrossOriginConfig","HeadContentProps","assetCrossOrigin","HeadContent","props","tags","router","content","_$createComponent","each","children","tag","t","attrs","mount","document","head"],"sources":["../../src/HeadContent.tsx"],"sourcesContent":["import { For } from 'solid-js'\nimport { Portal, isServer } from '@solidjs/web'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport { useTags } from './headContentUtils'\nimport type { AssetCrossOriginConfig } from '@tanstack/router-core'\n\nexport interface HeadContentProps {\n assetCrossOrigin?: AssetCrossOriginConfig\n}\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * When using full document hydration (hydrating from `<html>`), this component should be rendered in the `<body>`\n * to ensure it's part of the reactive tree and updates correctly during client-side navigation.\n * The component uses portals internally to render content into the `<head>` element.\n */\nexport function HeadContent(props: HeadContentProps) {\n const tags = useTags(props.assetCrossOrigin)\n const router = useRouter()\n\n const content = () => (\n <For each={tags()}>\n {(tag) => {\n const t = tag() as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>\n )\n\n return (isServer ?? router.isServer) ? (\n content()\n ) : (\n <Portal mount={document.head}>{content()}</Portal>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,SAAgBS,YAAYC,OAAyB;CACnD,MAAMC,OAAON,QAAQK,MAAMF,iBAAiB;CAC5C,MAAMI,SAASR,WAAW;CAE1B,MAAMS,gBAAUC,gBACbd,KAAG;EAAA,IAACe,OAAI;AAAA,UAAEJ,MAAM;;EAAAK,WACbC,QAAQ;GACR,MAAMC,IAAID,KAAK;AACf,UAAAH,gBAAQX,OAAK;IAAA,IAACc,MAAG;AAAA,YAAEC,EAAED;;IAAG,IAAEE,QAAK;AAAA,YAAED,EAAEC;;IAAK,IAAEH,WAAQ;AAAA,YAAEE,EAAEF;;IAAQ,CAAA;;EAC/D,CAEJ;AAED,QAAQd,YAAYU,OAAOV,WACzBW,SAAS,GAAAC,gBAERb,QAAM;EAAA,IAACmB,QAAK;AAAA,UAAEC,SAASC;;EAAI,IAAAN,WAAA;AAAA,UAAGH,SAAS;;EAAA,CACzC"}
{"version":3,"file":"HeadContent.js","names":["For","HydrationScript","Portal","isServer","Asset","useRouter","useTags","AssetCrossOriginConfig","HeadContentProps","assetCrossOrigin","HeadContent","props","tags","router","content","_$createComponent","each","children","tag","t","attrs","mount","document","head"],"sources":["../../src/HeadContent.tsx"],"sourcesContent":["import { For } from 'solid-js'\nimport { HydrationScript, Portal, isServer } from '@solidjs/web'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport { useTags } from './headContentUtils'\nimport type { AssetCrossOriginConfig } from '@tanstack/router-core'\n\nexport interface HeadContentProps {\n assetCrossOrigin?: AssetCrossOriginConfig\n}\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * When using full document hydration (hydrating from `<html>`), this component should be rendered in the `<body>`\n * to ensure it's part of the reactive tree and updates correctly during client-side navigation.\n * The component uses portals internally to render content into the `<head>` element.\n */\nexport function HeadContent(props: HeadContentProps) {\n const tags = useTags(props.assetCrossOrigin)\n const router = useRouter()\n\n const content = () => (\n <>\n <HydrationScript />\n <For each={tags()}>\n {(tag) => {\n const t = tag() as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>\n </>\n )\n\n return (isServer ?? router.isServer) ? (\n content()\n ) : (\n <>\n <HydrationScript />\n <Portal mount={document.head}>{content()}</Portal>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,SAAgBU,YAAYC,OAAyB;CACnD,MAAMC,OAAON,QAAQK,MAAMF,iBAAiB;CAC5C,MAAMI,SAASR,WAAW;CAE1B,MAAMS,gBAAU,CAAAC,gBAEXd,iBAAe,EAAA,CAAA,EAAAc,gBACff,KAAG;EAAA,IAACgB,OAAI;AAAA,UAAEJ,MAAM;;EAAAK,WACbC,QAAQ;GACR,MAAMC,IAAID,KAAK;AACf,UAAAH,gBAAQX,OAAK;IAAA,IAACc,MAAG;AAAA,YAAEC,EAAED;;IAAG,IAAEE,QAAK;AAAA,YAAED,EAAEC;;IAAK,IAAEH,WAAQ;AAAA,YAAEE,EAAEF;;IAAQ,CAAA;;EAC/D,CAAA,CAGN;AAED,QAAQd,YAAYU,OAAOV,WACzBW,SAAS,GAAA,CAAAC,gBAGNd,iBAAe,EAAA,CAAA,EAAAc,gBACfb,QAAM;EAAA,IAACmB,QAAK;AAAA,UAAEC,SAASC;;EAAI,IAAAN,WAAA;AAAA,UAAGH,SAAS;;EAAA,CAAA,CAE3C"}
import { For } from 'solid-js';
import { Portal, isServer } from '@solidjs/web';
import { HydrationScript, Portal, isServer } from '@solidjs/web';
import { Asset } from './Asset';

@@ -15,10 +15,16 @@ import { useRouter } from './useRouter';

const router = useRouter();
const content = () => (<For each={tags()}>
{(tag) => {
const content = () => (<>
<HydrationScript />
<For each={tags()}>
{(tag) => {
const t = tag();
return <Asset tag={t.tag} attrs={t.attrs} children={t.children}/>;
}}
</For>);
return (isServer ?? router.isServer) ? (content()) : (<Portal mount={document.head}>{content()}</Portal>);
</For>
</>);
return (isServer ?? router.isServer) ? (content()) : (<>
<HydrationScript />
<Portal mount={document.head}>{content()}</Portal>
</>);
}
//# sourceMappingURL=HeadContent.jsx.map

@@ -1,1 +0,1 @@

{"version":3,"file":"HeadContent.jsx","sourceRoot":"","sources":["../../src/HeadContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAO5C;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;IAC5C,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,CACpB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAChB;MAAA,CAAC,CAAC,GAAG,EAAE,EAAE;YACP,MAAM,CAAC,GAAG,GAAG,EAAS,CAAA;YACtB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAG,CAAA;QACpE,CAAC,CACH;IAAA,EAAE,GAAG,CAAC,CACP,CAAA;IAED,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CACrC,OAAO,EAAE,CACV,CAAC,CAAC,CAAC,CACF,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,QA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AAAD,EAChB;MAAA,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CACnD;IAAA,GAAG,CACJ,CAAA;AACH,CAAC"}
{
"name": "@tanstack/solid-router",
"version": "2.0.0-beta.15",
"version": "2.0.0-beta.16",
"description": "Modern and scalable routing for Solid applications",

@@ -5,0 +5,0 @@ "author": "Tanner Linsley",

import { For } from 'solid-js'
import { Portal, isServer } from '@solidjs/web'
import { HydrationScript, Portal, isServer } from '@solidjs/web'
import { Asset } from './Asset'

@@ -23,8 +23,11 @@ import { useRouter } from './useRouter'

const content = () => (
<For each={tags()}>
{(tag) => {
const t = tag() as any
return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />
}}
</For>
<>
<HydrationScript />
<For each={tags()}>
{(tag) => {
const t = tag() as any
return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />
}}
</For>
</>
)

@@ -35,4 +38,7 @@

) : (
<Portal mount={document.head}>{content()}</Portal>
<>
<HydrationScript />
<Portal mount={document.head}>{content()}</Portal>
</>
)
}