Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add server-side rendering #39

wants to merge 10 commits into
base: master
Choose a base branch

Add server-side rendering #39

wants to merge 10 commits into from


Copy link

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
None yet

Successfully merging this pull request may close these issues.

None yet

1 participant