-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add SSR prompt in configure hook
- Loading branch information
1 parent
6c9705e
commit 04f45be
Showing
11 changed files
with
264 additions
and
9 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
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
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,17 @@ | ||
{{{ | ||
exports({ to: app.makePath('resources/ssr.tsx') }) | ||
}}} | ||
import ReactDOMServer from 'react-dom/server' | ||
import { createInertiaApp } from '@inertiajs/react' | ||
|
||
export default function render(page: any) { | ||
return createInertiaApp({ | ||
page, | ||
render: ReactDOMServer.renderToString, | ||
resolve: (name) => { | ||
const pages = import.meta.glob('./pages/**/*.tsx', { eager: true }) | ||
{{ 'return pages[`./pages/${name}.tsx`]' }} | ||
}, | ||
setup: ({ App, props }) => <App {...props} />, | ||
}) | ||
} |
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,19 @@ | ||
{{{ | ||
exports({ to: app.makePath('resources/ssr.tsx') }) | ||
}}} | ||
|
||
import { hydrate } from 'solid-js/web' | ||
import { createInertiaApp } from 'inertia-adapter-solid' | ||
|
||
export default function render(page: any) { | ||
return createInertiaApp({ | ||
page, | ||
resolve: (name) => { | ||
const pages = import.meta.glob('./pages/**/*.tsx', { eager: true }) | ||
{{ 'return pages[`./pages/${name}.tsx`]' }} | ||
}, | ||
setup({ el, App, props }) { | ||
hydrate(() => <App {...props} />, el) | ||
}, | ||
}) | ||
} |
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,22 @@ | ||
{{{ | ||
exports({ to: app.makePath('resources/ssr.ts') }) | ||
}}} | ||
|
||
import { createInertiaApp } from '@inertiajs/vue3' | ||
import { renderToString } from '@vue/server-renderer' | ||
import { createSSRApp, h, type DefineComponent } from 'vue' | ||
|
||
export default function render(page: any) { | ||
return createInertiaApp({ | ||
page, | ||
render: renderToString, | ||
resolve: (name) => { | ||
const pages = import.meta.glob<DefineComponent>('./pages/**/*.vue', { eager: true }) | ||
{{ 'return pages[`./pages/${name}.vue`]' }} | ||
}, | ||
|
||
setup({ App, props, plugin }) { | ||
return createSSRApp({ render: () => h(App, props) }).use(plugin) | ||
}, | ||
}) | ||
} |
Oops, something went wrong.