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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSR: Mark masterbar and layout files as @ssr-ready #2271

Merged
merged 1 commit into from
Jan 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions server/pragma-checker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var includes = require( 'lodash/collection/includes' );

var PLUGIN_TITLE = 'PragmaChecker';
var SSR_READY = '/** @ssr-ready **/';
var IGNORED_MODULES = [ 'config' ];

function PragmaCheckPlugin( options ) {
this.options = options || {};
Expand All @@ -28,6 +29,7 @@ function scanDependencies( module, compilation ) {
// If the module is compiled through babel, we can be pretty sure it's our own module, not from npm.
if ( includes( dep.module.request, 'babel-loader' ) &&
dep.module._source &&
! includes( IGNORED_MODULES, dep.module.rawRequest ) &&
! includes( dep.module._source._value, SSR_READY ) ) {
compilation.errors.push( PLUGIN_TITLE + ': ' + module.rawRequest + ', dependency ' + dep.module.rawRequest + ' is not ' + SSR_READY );
}
Expand Down
1 change: 1 addition & 0 deletions shared/components/gridicon/index.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @ssr-ready **/

/* !!!
IF YOU ARE EDITING gridicon/index.jsx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially OT, but is this warning still current?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, there's a PR in the Gridicons repo for this. 136-gh-gridicons

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noice.

Expand Down
2 changes: 2 additions & 0 deletions shared/layout/logged-out-design.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/** @ssr-ready **/

/**
* External dependencies
*/
Expand Down
2 changes: 2 additions & 0 deletions shared/layout/masterbar/item.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/** @ssr-ready **/

/**
* External dependencies
*/
Expand Down
2 changes: 2 additions & 0 deletions shared/layout/masterbar/logged-out.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/** @ssr-ready **/

/**
* External dependencies
*/
Expand Down
2 changes: 2 additions & 0 deletions shared/layout/masterbar/masterbar.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/** @ssr-ready **/

/**
* External dependencies
*/
Expand Down