-
-
Notifications
You must be signed in to change notification settings - Fork 633
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
WIP of converting examples to Webpack v2 #742
Conversation
@alexfedoseev Can you take a look at my conversions of the webpack configs in |
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.
Few comments.
spec/dummy/client/.babelrc
Outdated
@@ -1,4 +1,4 @@ | |||
{ | |||
"presets": ["es2015", "stage-0", "react"], | |||
"presets": ["es2015", "stage-2", "react"], | |||
"plugins": ["syntax-decorators"] |
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 don't think it should be here.
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.
you mean syntax-decorators?
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.
Yeah, AFAIR we don't use them anywhere.
), | ||
loader: ExtractTextPlugin.extract({ | ||
fallback: 'style-loader', | ||
loader: [ |
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.
use:
loader: [ | ||
{ | ||
loader: 'css-loader', | ||
query: { |
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.
options:
), | ||
loader: ExtractTextPlugin.extract({ | ||
fallback: 'style-loader', | ||
loader: [ |
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.
use:
loader: [ | ||
{ | ||
loader: 'css-loader', | ||
query: { |
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.
options:
Still some issues:
Phantomjs issue➜ ~/shakacode/react-on-rails/react_on_rails/spec/dummy (update-to-webpack-v2 u=) ✗ rspec './spec/features/integration_spec.rb[1:1:1:1]' ✹ [21:00:16] Capybara using driver: poltergeist Run options: include {:ids=>{"./spec/features/integration_spec.rb"=>["1:1:1:1"]}} Hot Reload Issue➜ ~/shakacode/react-on-rails/react_on_rails/spec/dummy (update-to-webpack-v2 u=) foreman start -f Procfile.hot [21:06:20] 21:06:30 rails.1 | started with pid 7264 21:06:30 hot-assets.1 | started with pid 7265 21:06:30 rails-server-assets.1 | started with pid 7266 21:06:30 hot-assets.1 | yarn run v0.20.3 21:06:30 rails-server-assets.1 | yarn run v0.20.3 21:06:31 rails-server-assets.1 | $ (cd client && yarn run build:dev:server --silent) 21:06:31 hot-assets.1 | $ (cd client && yarn run hot-assets) 21:06:32 hot-assets.1 | yarn run v0.20.3 21:06:32 rails-server-assets.1 | yarn run v0.20.3 21:06:32 hot-assets.1 | $ babel-node server-rails-hot.js 21:06:32 rails-server-assets.1 | $ webpack -w --config webpack.server.rails.build.config.js 21:06:33 rails-server-assets.1 | 21:06:33 rails-server-assets.1 | Webpack is watching the files… 21:06:33 rails-server-assets.1 | 21:06:35 rails.1 | => Booting Puma 21:06:35 rails.1 | => Rails 4.2.8 application starting in development on http://0.0.0.0:3000 21:06:35 rails.1 | => Run `rails server -h` for more startup options 21:06:35 rails.1 | => Ctrl-C to shutdown server 21:06:35 rails.1 | ================================================================================ 21:06:35 rails.1 | Using caching = false 21:06:35 rails.1 | ================================================================================ 21:06:36 hot-assets.1 | /Users/justin/shakacode/react-on-rails/react_on_rails/spec/dummy/client/webpack.client.rails.hot.config.js:24 21:06:36 hot-assets.1 | config.module.loaders.push({ 21:06:36 hot-assets.1 | ^ 21:06:36 hot-assets.1 | 21:06:36 hot-assets.1 | TypeError: Cannot read property 'push' of undefined 21:06:36 hot-assets.1 | at Object. (/Users/justin/shakacode/react-on-rails/react_on_rails/spec/dummy/client/webpack.client.rails.hot.config.js:25:1) 21:06:36 hot-assets.1 | at Module._compile (module.js:571:32) 21:06:36 hot-assets.1 | at loader (/Users/justin/shakacode/react-on-rails/react_on_rails/spec/dummy/client/node_modules/babel-register/lib/node.js:144:5) 21:06:36 hot-assets.1 | at Object.require.extensions.(anonymous function) [as .js] (/Users/justin/shakacode/react-on-rails/react_on_rails/spec/dummy/client/node_modules/babel-register/lib/node.js:154:7) 21:06:36 hot-assets.1 | at Module.load (module.js:488:32) 21:06:36 hot-assets.1 | at tryModuleLoad (module.js:447:12) 21:06:36 hot-assets.1 | at Function.Module._load (module.js:439:3) 21:06:36 hot-assets.1 | at Module.require (module.js:498:17) 21:06:36 hot-assets.1 | at require (internal/module.js:20:19) 21:06:36 hot-assets.1 | at Object. (/Users/justin/shakacode/react-on-rails/react_on_rails/spec/dummy/client/server-rails-hot.js:20:1) 21:06:36 hot-assets.1 | error Command failed with exit code 1. 21:06:36 hot-assets.1 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 21:06:37 hot-assets.1 | error Command failed with exit code 1. 21:06:37 hot-assets.1 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 21:06:37 hot-assets.1 | exited with code 1 21:06:37 system | sending SIGTERM to all processes 21:06:37 rails.1 | Exiting 21:06:37 rails-server-assets.1 | terminated by SIGTERM 21:06:37 rails.1 | terminated by SIGTERM |
Might be related: shakacode/react-webpack-rails-tutorial#361 |
Took out lots of errors! Still got 6 left. Please help!
|
* Including the babel-polyfill in the registrations files. * Same for the es5shim
Require path instead of assuming it's already imported.
740e35f
to
96bed98
Compare
Can anybody tell me why travis is failing? https://travis-ci.org/shakacode/react_on_rails https://travis-ci.org/shakacode/react_on_rails/builds/208035037 but codeship is passing: https://app.codeship.com/projects/187011/builds/23158421 |
@robwise can you scan these changes. I'd like to merge soon! |
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.
lgtm
"jsdom": "^9.9.1", | ||
"eslint-plugin-jsx-a11y": "^4.0.0", | ||
"eslint-plugin-react": "^6.10.0", | ||
"fbjs": "^0.8.9", |
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.
Why is this a direct dep?
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.
at some point, this was a peer dep...
This change is