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

HMR to DLL #26

Merged
merged 5 commits into from
Mar 19, 2017
Merged

HMR to DLL #26

merged 5 commits into from
Mar 19, 2017

Conversation

Judahmeek
Copy link
Contributor

per the group decision to abandon react-hot-loader and HMR due to its unreliability, incompatibility with flexbox, and lack of active development by Dan Abramov.

@Judahmeek
Copy link
Contributor Author

I want to create an devtool DLL bundle that is only loaded in development to supplement #27. @alexfedoseev, If you have any pointers on that, I'd greatly appreciate it. I've got a general idea of how to accomplish it, but I'm sure any guidance you could provide would facilitate things.

Copy link
Member

@alex35mil alex35mil left a comment

Choose a reason for hiding this comment

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

@Judahmeek LGTM overall, but I'm not sure I what you mean by "create devtool", can you elaborate?

if (builderConfig.deps === 'dll') {
throw new Error('DLL manifest is missing. Run `yarn run build:dll`');
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I think you already checked it in webpack.config.babel.js.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. I pulled both setups from F&G, which I just double-checked. Ya'll have the same redundant check, btw.

@Judahmeek
Copy link
Contributor Author

Yeah, My bad. I originally thought that DLL was used during production & development. I know better now. However, I'm curious why DLL isn't used for Rspec integration testing. Are there incompatibility issues I should know of?

@@ -0,0 +1,3 @@
// Webpack styles
@import "vendor-client-bundle.css";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without the *.css extension, SCSS was throwing an import error that vendor-client-bundle either could not be found or was not valid SCSS. I'm assuming that it was trying to import vendor-client-bundle.js, but since adding the extension worked, I didn't debug further.

'reselect',
];

module.exports.dllExceptions = ['babel-polyfill'];
Copy link
Contributor Author

@Judahmeek Judahmeek Mar 18, 2017

Choose a reason for hiding this comment

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

babel-polyfill is required even on Chrome for the regenerator-runtime which is used by Redux-Saga's generators. I removed jquery & Bootstrap because we're not using Facebook SDK.

'redux-devtools-diff-monitor',
'redux-devtools-dock-monitor',
'redux-logger',
];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I placed the devtools in a separate list so that they could be included in the DLL, yet not included in the production vendor chunk.

@@ -26,11 +28,11 @@
# If you are using the ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)
# with rspec then this controls what npm command is run
# to automatically refresh your webpack assets on every test run.
config.npm_build_test_command = "yarn run build:all:rspec"
config.npm_build_test_command = "yarn run build:client-bundles:rspec"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This probably wasn't absolutely necessary, but since we haven't implemented server rendering yet, I didn't see the point in running build:server-bundle:*

Copy link
Contributor

Choose a reason for hiding this comment

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

as long as you make sure you're the one to turn server rendering back on and that you remember you did this, otherwise it's going to cause a yak shave

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do.

@Judahmeek Judahmeek merged commit cbd011e into master Mar 19, 2017
@Judahmeek Judahmeek deleted the hmr-to-dll branch March 19, 2017 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants