-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Roman Sarvarov
committed
Jun 15, 2024
1 parent
b9cfac0
commit 4139d69
Showing
37 changed files
with
2,467 additions
and
44,598 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
examples/vue3_tailwind/bootstrap/ssr/assets/Index-BR6qyg05.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { unref, withCtx, createVNode, useSSRContext } from "vue"; | ||
import { ssrRenderComponent, ssrRenderStyle, ssrInterpolate } from "vue/server-renderer"; | ||
import { Head } from "@inertiajs/vue3"; | ||
import { _ as _sfc_main$1 } from "./Navbar-D1KJP_4P.js"; | ||
import "@headlessui/vue"; | ||
import "@heroicons/vue/24/outline"; | ||
const _sfc_main = { | ||
__name: "Index", | ||
__ssrInlineRender: true, | ||
props: { | ||
text: String | ||
}, | ||
setup(__props) { | ||
return (_ctx, _push, _parent, _attrs) => { | ||
_push(`<!--[-->`); | ||
_push(ssrRenderComponent(unref(Head), null, { | ||
default: withCtx((_, _push2, _parent2, _scopeId) => { | ||
if (_push2) { | ||
_push2(`<title${_scopeId}>Page 1</title>`); | ||
} else { | ||
return [ | ||
createVNode("title", null, "Page 1") | ||
]; | ||
} | ||
}), | ||
_: 1 | ||
}, _parent)); | ||
_push(ssrRenderComponent(_sfc_main$1, null, null, _parent)); | ||
_push(`<div class="relative isolate px-6 pt-14 lg:px-8"><div class="absolute inset-x-0 -top-40 -z-10 transform-gpu overflow-hidden blur-3xl sm:-top-80" aria-hidden="true"><div class="relative left-[calc(50%-11rem)] aspect-[1155/678] w-[36.125rem] -translate-x-1/2 rotate-[30deg] bg-gradient-to-tr from-[#ff80b5] to-[#9089fc] opacity-30 sm:left-[calc(50%-30rem)] sm:w-[72.1875rem]" style="${ssrRenderStyle({ "clip-path": "polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)" })}"></div></div><div class="mx-auto max-w-2xl py-32 sm:py-48 lg:py-56"><div class="text-center"><h1 class="text-4xl font-bold tracking-tight text-gray-900 sm:text-6xl">Hello, ${ssrInterpolate(__props.text)}!</h1><p class="mt-6 text-lg leading-8 text-gray-600">Anim aute id magna aliqua ad ad non deserunt sunt. Qui irure qui lorem cupidatat commodo. Elit sunt amet fugiat veniam occaecat fugiat aliqua.</p><div class="mt-10 flex items-center justify-center gap-x-6"><a href="#" class="rounded-md bg-indigo-600 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">Get started</a><a href="#" class="text-sm font-semibold leading-6 text-gray-900">Learn more <span aria-hidden="true">→</span></a></div></div></div><div class="absolute inset-x-0 top-[calc(100%-13rem)] -z-10 transform-gpu overflow-hidden blur-3xl sm:top-[calc(100%-30rem)]" aria-hidden="true"><div class="relative left-[calc(50%+3rem)] aspect-[1155/678] w-[36.125rem] -translate-x-1/2 bg-gradient-to-tr from-[#ff80b5] to-[#9089fc] opacity-30 sm:left-[calc(50%+36rem)] sm:w-[72.1875rem]" style="${ssrRenderStyle({ "clip-path": "polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)" })}"></div></div></div><!--]-->`); | ||
}; | ||
} | ||
}; | ||
const _sfc_setup = _sfc_main.setup; | ||
_sfc_main.setup = (props, ctx) => { | ||
const ssrContext = useSSRContext(); | ||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/Pages/Home/Index.vue"); | ||
return _sfc_setup ? _sfc_setup(props, ctx) : void 0; | ||
}; | ||
export { | ||
_sfc_main as default | ||
}; |
87 changes: 87 additions & 0 deletions
87
examples/vue3_tailwind/bootstrap/ssr/assets/Navbar-D1KJP_4P.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { mergeProps, unref, withCtx, createTextVNode, createVNode, useSSRContext } from "vue"; | ||
import { ssrRenderAttrs, ssrRenderComponent } from "vue/server-renderer"; | ||
import { Link } from "@inertiajs/vue3"; | ||
import { PopoverGroup } from "@headlessui/vue"; | ||
import { Bars3Icon } from "@heroicons/vue/24/outline"; | ||
const _sfc_main = { | ||
__name: "Navbar", | ||
__ssrInlineRender: true, | ||
setup(__props) { | ||
return (_ctx, _push, _parent, _attrs) => { | ||
_push(`<header${ssrRenderAttrs(mergeProps({ class: "absolute inset-x-0 top-0 z-50" }, _attrs))}><nav class="mx-auto flex max-w-7xl items-center justify-between p-6 lg:px-8" aria-label="Global"><div class="flex lg:flex-1"><a href="#" class="-m-1.5 p-1.5"><span class="sr-only">Your Company</span><img class="h-8 w-auto" src="https://tailwindui.com/img/logos/mark.svg?color=indigo&shade=600" alt=""></a></div><div class="flex lg:hidden"><button type="button" class="-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700"><span class="sr-only">Open main menu</span>`); | ||
_push(ssrRenderComponent(unref(Bars3Icon), { | ||
class: "h-6 w-6", | ||
"aria-hidden": "true" | ||
}, null, _parent)); | ||
_push(`</button></div>`); | ||
_push(ssrRenderComponent(unref(PopoverGroup), { class: "hidden lg:flex lg:gap-x-12" }, { | ||
default: withCtx((_, _push2, _parent2, _scopeId) => { | ||
if (_push2) { | ||
_push2(ssrRenderComponent(unref(Link), { | ||
href: "/home", | ||
class: "text-sm font-semibold leading-6 text-gray-900" | ||
}, { | ||
default: withCtx((_2, _push3, _parent3, _scopeId2) => { | ||
if (_push3) { | ||
_push3(`Home`); | ||
} else { | ||
return [ | ||
createTextVNode("Home") | ||
]; | ||
} | ||
}), | ||
_: 1 | ||
}, _parent2, _scopeId)); | ||
_push2(ssrRenderComponent(unref(Link), { | ||
href: "/secondary", | ||
class: "text-sm font-semibold leading-6 text-gray-900" | ||
}, { | ||
default: withCtx((_2, _push3, _parent3, _scopeId2) => { | ||
if (_push3) { | ||
_push3(`Secondary`); | ||
} else { | ||
return [ | ||
createTextVNode("Secondary") | ||
]; | ||
} | ||
}), | ||
_: 1 | ||
}, _parent2, _scopeId)); | ||
} else { | ||
return [ | ||
createVNode(unref(Link), { | ||
href: "/home", | ||
class: "text-sm font-semibold leading-6 text-gray-900" | ||
}, { | ||
default: withCtx(() => [ | ||
createTextVNode("Home") | ||
]), | ||
_: 1 | ||
}), | ||
createVNode(unref(Link), { | ||
href: "/secondary", | ||
class: "text-sm font-semibold leading-6 text-gray-900" | ||
}, { | ||
default: withCtx(() => [ | ||
createTextVNode("Secondary") | ||
]), | ||
_: 1 | ||
}) | ||
]; | ||
} | ||
}), | ||
_: 1 | ||
}, _parent)); | ||
_push(`<div class="hidden lg:flex lg:flex-1 lg:justify-end"><a href="#" class="text-sm font-semibold leading-6 text-gray-900">Log in <span aria-hidden="true">→</span></a></div></nav></header>`); | ||
}; | ||
} | ||
}; | ||
const _sfc_setup = _sfc_main.setup; | ||
_sfc_main.setup = (props, ctx) => { | ||
const ssrContext = useSSRContext(); | ||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/Components/Navbar.vue"); | ||
return _sfc_setup ? _sfc_setup(props, ctx) : void 0; | ||
}; | ||
export { | ||
_sfc_main as _ | ||
}; |
41 changes: 41 additions & 0 deletions
41
examples/vue3_tailwind/bootstrap/ssr/assets/Secondary-8nZPUrmp.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { unref, withCtx, createVNode, useSSRContext } from "vue"; | ||
import { ssrRenderComponent, ssrRenderStyle } from "vue/server-renderer"; | ||
import { Head } from "@inertiajs/vue3"; | ||
import { _ as _sfc_main$1 } from "./Navbar-D1KJP_4P.js"; | ||
import "@headlessui/vue"; | ||
import "@heroicons/vue/24/outline"; | ||
const _sfc_main = { | ||
__name: "Secondary", | ||
__ssrInlineRender: true, | ||
props: { | ||
text: String | ||
}, | ||
setup(__props) { | ||
return (_ctx, _push, _parent, _attrs) => { | ||
_push(`<!--[-->`); | ||
_push(ssrRenderComponent(unref(Head), null, { | ||
default: withCtx((_, _push2, _parent2, _scopeId) => { | ||
if (_push2) { | ||
_push2(`<title${_scopeId}>Page 2</title>`); | ||
} else { | ||
return [ | ||
createVNode("title", null, "Page 2") | ||
]; | ||
} | ||
}), | ||
_: 1 | ||
}, _parent)); | ||
_push(ssrRenderComponent(_sfc_main$1, null, null, _parent)); | ||
_push(`<div class="relative isolate px-6 pt-14 lg:px-8"><div class="absolute inset-x-0 -top-40 -z-10 transform-gpu overflow-hidden blur-3xl sm:-top-80" aria-hidden="true"><div class="relative left-[calc(50%-11rem)] aspect-[1155/678] w-[36.125rem] -translate-x-1/2 rotate-[30deg] bg-gradient-to-tr from-[#ff80b5] to-[#9089fc] opacity-30 sm:left-[calc(50%-30rem)] sm:w-[72.1875rem]" style="${ssrRenderStyle({ "clip-path": "polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)" })}"></div></div><div class="mx-auto max-w-2xl py-32 sm:py-48 lg:py-56"><div class="text-center"><h1 class="text-4xl font-bold tracking-tight text-gray-900 sm:text-6xl">This is secondary page!</h1><p class="mt-6 text-lg leading-8 text-gray-600">Anim aute id magna aliqua ad ad non deserunt sunt. Qui irure qui lorem cupidatat commodo. Elit sunt amet fugiat veniam occaecat fugiat aliqua.</p></div></div><div class="absolute inset-x-0 top-[calc(100%-13rem)] -z-10 transform-gpu overflow-hidden blur-3xl sm:top-[calc(100%-30rem)]" aria-hidden="true"><div class="relative left-[calc(50%+3rem)] aspect-[1155/678] w-[36.125rem] -translate-x-1/2 bg-gradient-to-tr from-[#ff80b5] to-[#9089fc] opacity-30 sm:left-[calc(50%+36rem)] sm:w-[72.1875rem]" style="${ssrRenderStyle({ "clip-path": "polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)" })}"></div></div></div><!--]-->`); | ||
}; | ||
} | ||
}; | ||
const _sfc_setup = _sfc_main.setup; | ||
_sfc_main.setup = (props, ctx) => { | ||
const ssrContext = useSSRContext(); | ||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/Pages/Home/Secondary.vue"); | ||
return _sfc_setup ? _sfc_setup(props, ctx) : void 0; | ||
}; | ||
export { | ||
_sfc_main as default | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"node_modules/laravel-vite-plugin/inertia-helpers/index.js": [], | ||
"resources/js/Components/Navbar.vue": [ | ||
"/build/assets/Navbar-D1KJP_4P.js" | ||
], | ||
"resources/js/Pages/Home/Index.vue": [ | ||
"/build/assets/Index-BR6qyg05.js" | ||
], | ||
"resources/js/Pages/Home/Secondary.vue": [ | ||
"/build/assets/Secondary-8nZPUrmp.js" | ||
], | ||
"resources/js/ssr.js": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { createSSRApp, h } from "vue"; | ||
import { renderToString } from "@vue/server-renderer"; | ||
import { createInertiaApp } from "@inertiajs/vue3"; | ||
import createServer from "@inertiajs/vue3/server"; | ||
async function resolvePageComponent(path, pages) { | ||
for (const p of Array.isArray(path) ? path : [path]) { | ||
const page = pages[p]; | ||
if (typeof page === "undefined") { | ||
continue; | ||
} | ||
return typeof page === "function" ? page() : page; | ||
} | ||
throw new Error(`Page not found: ${path}`); | ||
} | ||
createServer( | ||
(page) => createInertiaApp({ | ||
page, | ||
render: renderToString, | ||
resolve: (name) => resolvePageComponent(`./Pages/${name}.vue`, /* @__PURE__ */ Object.assign({ "./Pages/Home/Index.vue": () => import("./assets/Index-BR6qyg05.js"), "./Pages/Home/Secondary.vue": () => import("./assets/Secondary-8nZPUrmp.js") })), | ||
setup({ App, props, plugin }) { | ||
return createSSRApp({ render: () => h(App, props) }).use(plugin); | ||
} | ||
}) | ||
); |
Oops, something went wrong.