-
Notifications
You must be signed in to change notification settings - Fork 384
use webpacker_lite #387
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
use webpacker_lite #387
Conversation
Looking great! some comments! Reviewed 18 of 18 files at r1. Procfile.hot, line 6 at r1 (raw file):
this HOT var value applies to the env helper for the assets, not the new stuff. This will change: app/views/layouts/application.html.erb, line 9 at r1 (raw file):
missing the stylesheet tag client/server-rails-hot.js, line 8 at r1 (raw file):
why require and not import? client/webpack.client.base.config.js, line 53 at r1 (raw file):
should this have a hash? client/webpackConfigLoader.js, line 1 at r1 (raw file):
we can eventually put this into the react-on-rails npm module config/webpack/development.server.yml, line 15 at r1 (raw file):
Maybe this yaml inheritance is overkill? We'll really only use the dev server for development. config/webpack/paths.yml, line 14 at r1 (raw file):
Are we using all these settings above? I'd put some comments in this file indicating what's used and just documentation. And maybe comment out the lines that are just documentation. Comments from Reviewable |
Review status: 14 of 18 files reviewed at latest revision, 7 unresolved discussions. Procfile.hot, line 6 at r1 (raw file): Previously, justin808 (Justin Gordon) wrote…
If we use the webpacker helpers, they'll need a similar hot, static options. Since we need the css in static but not in hot loading. If I leave in the stylesheet_pack_ tag, it will throw an error when hot loading. app/views/layouts/application.html.erb, line 9 at r1 (raw file): Previously, justin808 (Justin Gordon) wrote…
If I leave in the stylesheet_pack_ tag, it will throw an error when hot loading. We need hot and static options client/server-rails-hot.js, line 8 at r1 (raw file): Previously, justin808 (Justin Gordon) wrote…
We require a lot of other places, but it would be better if it was consistent. client/webpack.client.base.config.js, line 53 at r1 (raw file): Previously, justin808 (Justin Gordon) wrote…
I'm not sure config/webpack/development.server.yml, line 15 at r1 (raw file): Previously, justin808 (Justin Gordon) wrote…
Then we might not need the yaml at all. Comments from Reviewable |
Review status: 14 of 18 files reviewed at latest revision, 7 unresolved discussions. app/views/layouts/application.html.erb, line 9 at r1 (raw file): Previously, kaizencodes (Daniel Szatmari) wrote…
or make so the stylesheet helper includes nothing if hot reloading Comments from Reviewable |
Review status: 14 of 18 files reviewed at latest revision, 9 unresolved discussions, some commit checks failed. client/webpack.server.rails.build.config.js, line 25 at r2 (raw file):
Let's put in the location where we expect it! better error message! and indicate where this is configured. client/webpackConfigLoader.js, line 8 at r2 (raw file):
this is a lot to read when chained. let's break up to two lines and let's think about abstracting this into react-on-rails npm config/webpack/development.server.yml, line 15 at r1 (raw file): Previously, kaizencodes (Daniel Szatmari) wrote…
I guess this is fine for now if this is what webpacker is doing. config/webpack/paths.yml, line 14 at r1 (raw file): Previously, justin808 (Justin Gordon) wrote…
https://webpack.js.org/configuration/resolve/#resolve-extensions I disagree on putting this in the paths file. I think it's confusing to import non JS/JSX files without the extension. In other words, if I'm importing a PNG, I want to see in the code that it's a PNG. @robwise Agree? Comments from Reviewable |
Looking good! Some comments. Reviewed 4 of 4 files at r2. Procfile.hot, line 6 at r1 (raw file): Previously, kaizencodes (Daniel Szatmari) wrote…
We need to modify the stylesheet pack tag to recognize that we're hot reloading. app/views/layouts/application.html.erb, line 9 at r1 (raw file): Previously, kaizencodes (Daniel Szatmari) wrote…
the latter! client/server-rails-hot.js, line 8 at r1 (raw file): Previously, kaizencodes (Daniel Szatmari) wrote…
OK. Not sure on this one. Leave for now. client/webpack.client.base.config.js, line 53 at r1 (raw file): Previously, kaizencodes (Daniel Szatmari) wrote…
Yes it should! otherwise browser won't know file changed! Comments from Reviewable |
Review status: all files reviewed at latest revision, 8 unresolved discussions, some commit checks failed. config/webpack/paths.yml, line 14 at r1 (raw file): Previously, justin808 (Justin Gordon) wrote…
I don't get why we're still specifying any webpack settings outside of webpack? This still won't work for builds that require multiple configs Comments from Reviewable |
Review status: all files reviewed at latest revision, 8 unresolved discussions, some commit checks failed. client/webpack.client.base.config.js, line 53 at r1 (raw file): Previously, justin808 (Justin Gordon) wrote…
then this is wrong as well? config/webpack/paths.yml, line 14 at r1 (raw file): Previously, robwise (Rob Wise) wrote…
@justin Ditch the extentions part? Or the whole yaml? Place it into webpackConfigLoader maybe? Comments from Reviewable |
Review status: all files reviewed at latest revision, 8 unresolved discussions, some commit checks failed. client/webpack.client.base.config.js, line 53 at r1 (raw file): Previously, kaizencodes (Daniel Szatmari) wrote…
I'm quite sure we need the hash. @robwise Please confirm. and yes, in all places. config/webpack/paths.yml, line 14 at r1 (raw file): Previously, kaizencodes (Daniel Szatmari) wrote…
The webpackConfigLoader should focus on only bringing in the parts of the yaml file need. This yaml files should be slimmer. yes, ditch the extensions and hard code only .js .jsx Comments from Reviewable |
Review status: all files reviewed at latest revision, 10 unresolved discussions, some commit checks failed. config/webpack/paths.yml, line 2 at r2 (raw file):
we can clean this up per the new webpacker_lite config/webpack/paths.yml, line 19 at r2 (raw file):
we can remove the commented extensions Comments from Reviewable |
@kaizencodes Let's address the comments and get this ready to merge. Review status: all files reviewed at latest revision, 10 unresolved discussions, some commit checks failed. Comments from Reviewable |
config/webpack/paths.yml
Outdated
- .jsx | ||
# - .sass | ||
- .scss | ||
# - .css |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaizencodes We should tune up these files to match the updates we made to the generator.
Reviewed 15 of 15 files at r3, 2 of 2 files at r4. Procfile.dev, line 10 at r4 (raw file):
this should only delete the dev files, not all files Procfile.hot, line 9 at r4 (raw file):
see above comment --> only delete dev Procfile.static, line 5 at r4 (raw file):
again app/views/layouts/application.html.erb, line 6 at r4 (raw file):
these should change to app/views/layouts/application.html.erb, line 11 at r4 (raw file):
add client/server-rails-hot.js, line 12 at r4 (raw file):
did we lint? extra space? config/initializers/react_on_rails.rb, line 89 at r4 (raw file):
need to make this clear in the upgrade doc we should just delete this and the default is nil config/webpack/paths.yml, line 5 at r4 (raw file):
dont' need Comments from Reviewable |
@kaizencodes Will you have time to make the suggested changes? Or should I take this one over? |
@@ -31,12 +31,12 @@ | |||
"build:production:client": "NODE_ENV=production webpack --config webpack.client.rails.build.config.js", | |||
"build:production:server": "NODE_ENV=production webpack --config webpack.server.rails.build.config.js", | |||
"build:client": "webpack --config webpack.client.rails.build.config.js", | |||
"build:dev:client": "webpack -w --config webpack.client.rails.build.config.js", | |||
"build:dev:server": "webpack -w --config webpack.server.rails.build.config.js", | |||
"build:dev:client": "NODE_ENV=development webpack -w --config webpack.client.rails.build.config.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaizencodes Why are we setting the NODE_ENV for development?
client/webpack.client.base.config.js
Outdated
}, | ||
modules: [ | ||
paths.source, | ||
paths.node_modules, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robwise, Webpack guru, what should we change this to? No need to put this in paths.yml, right? per shakacode/react_on_rails#834
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just hardcode the string 'node_modules' and call it a day, you don't have to add any other paths here
config/webpack/paths.yml
Outdated
assets: webpack | ||
manifest: manifest.json | ||
node_modules: client/node_modules | ||
source: client/app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not necessary. See shakacode/react_on_rails#834
Review status: 15 of 19 files reviewed at latest revision, 22 unresolved discussions, some commit checks failed. app/views/layouts/application.html.erb, line 6 at r4 (raw file): Previously, justin808 (Justin Gordon) wrote…
there is a problem setting it to -bundle here, look at the build and hot configs. we push to the existing config and that syntax doesn't support the - char. we would have to rewrite the whole config. app/views/layouts/application.html.erb, line 11 at r4 (raw file): Previously, justin808 (Justin Gordon) wrote…
same as above client/package.json, line 34 at r4 (raw file): Previously, justin808 (Justin Gordon) wrote…
we set it so the config loader gets the dev paths from paths.yml Comments from Reviewable |
I don't understand the Reviewed 4 of 4 files at r5, 4 of 4 files at r6. Gemfile, line 41 at r6 (raw file):
beta.2 app/views/layouts/application.html.erb, line 6 at r4 (raw file): Previously, kaizencodes (Daniel Szatmari) wrote…
I'm not following this comment. Why can we support the "-"? Comments from Reviewable |
- use webpack-merge to support - in bundle name - update react_on_rails version
Reviewed 11 of 11 files at r7. Comments from Reviewable |
See #395 |
Integrate webpacker_lite
This change is