inertia-wordpress icon indicating copy to clipboard operation
inertia-wordpress copied to clipboard

SSR Implementation

Open MattPurland opened this issue 2 years ago • 3 comments

I'll caveat this PR with the excuse that I've not developed a WordPress site in a while (over 3 years) and I wanted to use Inertia as that's what I currently use with Laravel. Awesome work on this by the way!

With the release of Inertia.js 1.0 I wanted SSR support with Svelte, so here we are.

It's not perfect as it can't apply a different id or the classes to the div, as the div is rendered by the SSR server. But it works well enough for me.

I've also updated your WordPress starter theme to use Vite (as per the Laravel and Inertia docs): https://github.com/MattPurland/inertia-vite-svelte-ssr-wordpress-theme

MattPurland avatar Feb 13 '23 14:02 MattPurland

Hello @MattPurland ! Great work!

Would it make sense to add ability to change SSR server host, as inside of docker container current host doesn't work. Also maybe option to change SSR entry point folder?

Cheers!

ElvisCaballero avatar May 17 '23 08:05 ElvisCaballero

Thanks @MattPurland ! I am testing this out and would love to use this in production.

I was curious what you meant by "can't apply a different id or the classes to the div"?

I am new to inertia and am trying to wrap my head around SSR implementation. Would it make sense to have a button within the plugin that turns SSR on/off? Does your version take a hit on performance vs the current version?

I would love to start using inertia for wordpress as its such a pain to build SPA's that need multiple repos etc. But i feel SEO is very important for most wordpress sites.

WRCarlile avatar May 25 '23 18:05 WRCarlile

@MattPurland I just realized I will need to use your svelte theme as well, so no need for a button since the plugin is looking for the ssr file with your PR

WRCarlile avatar May 26 '23 22:05 WRCarlile