Build: Simplify Dashboard Build Toolchain#12127
Conversation
|
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: June 4, 2019. |
|
Caution: This PR has changes that must be merged to WordPress.com |
|
ockham, Your synced wpcom patch D27270-code has been updated. |
1 similar comment
|
ockham, Your synced wpcom patch D27270-code has been updated. |
| }; | ||
| export const setInitialState = () => ( { | ||
| type: JETPACK_SET_INITIAL_STATE, | ||
| initialState: window.Initial_State, |
There was a problem hiding this comment.
We should probably parametrize the action for initialState to put the burden of instantiating it with window.Initial_State on the consumer.
| <StaticMain /> | ||
| </Provider> | ||
| </div> | ||
| ); |
There was a problem hiding this comment.
| ); | ||
|
|
||
| window.versionNotice = Server.renderToStaticMarkup( | ||
| window.versionNotice = renderToStaticMarkup( |
There was a problem hiding this comment.
Will probably need to move noscriptNotice and versionNotice to separate files,
|
ockham, Your synced wpcom patch D27270-code has been updated. |
54de292 to
3aa10e9
Compare
|
ockham, Your synced wpcom patch D27270-code has been updated. |
There was a problem hiding this comment.
Prolly just onBuild.bind( this, done ) would work here but good also as-is.
73cff5d to
f269d39
Compare
|
ockham, Your synced wpcom patch D27270-code has been updated. |
|
Rebased |
f269d39 to
3a2ec1b
Compare
|
ockham, Your synced wpcom patch D27270-code has been updated. |
|
ockham, Your synced wpcom patch D27270-code has been updated. |
This was solely meant to facilitate migration from Webpack v1 to v2. The debug option specifically was dropped by Webpack 3. https://webpack.js.org/plugins/loader-options-plugin/
2a806f7 to
ef045b8
Compare
|
Closing in favor of #12381. |
WIP. Prep work for #12072.
One core thing I've identified is that
tools/builder/react.jsusesstatic.jsxto produce minimal static markup (HTML) versions of the dashboard (really just "Turn on your JavaScript" notices). Itrequire()s the webpack-bundled version ofstatic.jsxto that end, and attachesrenderToStaticMarkup()-produced strings towindow, which it then writes to HTML files.Getting rid of the complexity added by passing information by attaching to
window(and thus requiringjsdometc) is the main objective of this PR.Maybe we can instead produce those HTML files as by-products of the bundling, i.e. through a Webpack plugin or loader? https://github.com/GoogleChromeLabs/prerender-loader#string-prerendering looks very promising!
Alternatively, we shouldn't bundle but just transpile
static.jsxso we can simplyrequire()it fromtools/builder/react.js.Changes proposed in this Pull Request:
Don't use
window/jsdomin build system.Testing instructions:
/wp-admin/admin.php?page=jetpack_modulesProposed changelog entry for your changes:
Build: Simplify Dashboard Build Toolchain