Using Intertia.js with WordPress server-side
See original GitHub issueHas anybody tried, or is it against nature? š
I am thinking of a WordPress theme where the PHP templates fetch their data from the DB using standard WordPress API (get_post
, WP_Query
ā¦) and then call Inertia::render()
.
I guess it would be faster than using WordPress REST APIs from the clientā¦
Thank you! Guido
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (3 by maintainers)
Top Results From Across the Web
Server-side rendering (SSR) - Inertia.js
Server -side rendering allows you to pre-render an initial page visit on the server, and to send the rendered HTML to the browser....
Read more >The Ultimate Guide to Inertia.js - Kinsta
Creating an SPA using Inertia is similar to creating a server-side rendered app. You create controllers, make queries to the database forĀ ...
Read more >Server side rendering with Laravel + Inertia.js + Vue.js
Next we need to create a server configuration file called ssr.js inside the same folder as our app.js , meaning resources/js . This...
Read more >Inertia.js: Building Single-Page Apps the Old Way
Inertia converts your initial server-rendered HTML page into a SPA by passing a page object into a client-side app. This page object includesĀ ......
Read more >Laravel Inertia: Installation Tutorial and Tips & Tricks
Inertia is a JavaScript-based routing library popularly used for developing modern Single Page Apps by leveraging classic server-side routingĀ ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@coccoinomane Your thoughts on using
get_posts()
withInertia::render()
are right on the money. Itās 100% possible. I built a WordPress plugin that does just that, and more: https://github.com/boxybird/wordpress-inertia-pluginA little demo using the plugin: https://github.com/boxybird/wordpress-inertia-demo-theme
@lkraav I agree
Plus, the SEO discussion wouldnāt be WordPress specific. The same challenges exists when using Inertia with Laravel and Rails.
ā Iām not sure what ālack of server-side renderingā means here. As far as I can tell, WP is nothing but a server-side rendered app š
Can we keep this issue open for a while longer, so more interested parties could find it better? I still have a hunch thereās a way to make it work.