Skip to content

Conversation

@jacklenox
Copy link
Contributor

This PR adds a basic level of server-side rendering to Picard. It is dependent on #37 and the upgrading of Picard to be able to use v2 of WP-API. It has been rebased against that branch for this reason.

The premise is relatively simple:

What we end up with is automatically generated theme files whose markup is drawn from that found in our React components.

At present, I have placed all of this in a Webpack config file. This means that as part of a general Webpack build process that is set to watch our project, the files will be recompiled as we make updates.

(As a sidenote, I'm intending to switch the build process from Gulp to Webpack, for now though it just handles this automated file generation and doesn't actually do anything Webpacky.)

Thus, once this is all in place. We can pretty much forget about it and know that our server-side files will be updated as is necessary.

For now, and for the purposes of a proof of concept, only the index.php, page.php and single.php files are being generated. There is also scope to make this much DRYer, rather than just the same thing repeated over and over. However, for the purposes of showing how it works, I'm liking it exploded out for the time being.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants