Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

🎨 Server-side rendering of wp-show in PHP#100

Closed
luisherranz wants to merge 24 commits intomain-wp-directives-pluginfrom
ssr-in-php
Closed

🎨 Server-side rendering of wp-show in PHP#100
luisherranz wants to merge 24 commits intomain-wp-directives-pluginfrom
ssr-in-php

Conversation

@luisherranz
Copy link
Copy Markdown
Member

Co-authored with @SantosGuillamot.

Mario and I have created a simple proof of concept of how server-side rendering of a wp-show client component could look like.

It uses a manual node script to parse the render.php file using ultrahtml (a simple HTML parser) and inject PHP functions. Then, we use those functions to evaluate the state and modify the markup accordingly.

We did this work on top of the wpmoviesdemo branch because we are using a block to test this out, and the wpmoviesdemo branch already had some blocks working fine. I didn't remove the wpmoviesdemo blocks, but I removed the Shared Elements transitions. We haven't decided whether the WP Directives plugin should contain block examples or not.

This is very basic yet, and everything is hardcoded, but it demonstrates one possible approach. If we go ahead with this technique, we'd need to figure out good APIs to make this extensible.

https://www.loom.com/share/ce216cb0286e4b6ea421129814418c3e

@luisherranz luisherranz self-assigned this Nov 3, 2022
@luisherranz luisherranz changed the title Server-side rendering of wp-show in PHP 🎨 Server-side rendering of wp-show in PHP Nov 3, 2022
@luisherranz luisherranz marked this pull request as draft November 3, 2022 15:49
@luisherranz
Copy link
Copy Markdown
Member Author

Closing this PR in favor of a possible run-time implementation based on the WP_HTML_Tag_Processor that @ockham and @dmsnell have started investigating.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants