Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
<?php get_header(); ?>
and<?php get_footer(); ?>
.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
andsingle.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.