File tree Expand file tree Collapse file tree 16 files changed +299
-396
lines changed
Expand file tree Collapse file tree 16 files changed +299
-396
lines changed Original file line number Diff line number Diff line change 1- ruby- 2.7.1
1+ 2.7.5
Original file line number Diff line number Diff line change 33source "https://rubygems.org"
44git_source ( :github ) { |repo | "https://github.com/#{ repo } .git" }
55
6- ruby "2.7.3 "
6+ ruby "2.7.5 "
77
88gem "react_on_rails" , "12.5.2"
9- gem "webpacker " , "6.0.0.rc.6 "
9+ gem "shakapacker " , "6.0.2 "
1010
1111# Bundle edge Rails instead: gem "rails", github: "rails/rails"
1212gem "listen"
Original file line number Diff line number Diff line change 299299 rubyzip (>= 1.2.2 )
300300 semantic_range (3.0.0 )
301301 sexp_processor (4.16.0 )
302+ shakapacker (6.0.2 )
303+ activesupport (>= 5.2 )
304+ rack-proxy (>= 0.6.1 )
305+ railties (>= 5.2 )
306+ semantic_range (>= 2.3.0 )
302307 simplecov (0.16.1 )
303308 docile (~> 1.1 )
304309 json (>= 1.8 , < 3 )
@@ -392,15 +397,15 @@ DEPENDENCIES
392397 scss_lint
393398 sdoc
394399 selenium-webdriver
400+ shakapacker (= 6.0.2 )
395401 spring
396402 spring-commands-rspec
397403 uglifier
398404 web-console
399405 webdrivers (= 3.9.4 )
400- webpacker (= 6.0.0.rc.6 )
401406
402407RUBY VERSION
403- ruby 2.7.3p183
408+ ruby 2.7.5p203
404409
405410BUNDLED WITH
406411 2.1.4
Original file line number Diff line number Diff line change 22# You can run these commands in separate shells
33redis: redis-server
44rails: bundle exec rails s -p 3000
5- wp-client: HMR=true RAILS_ENV=development NODE_ENV=development bin/webpack -dev-server
6- wp-server: bundle exec rake react_on_rails:locale && HMR=true SERVER_BUNDLE_ONLY=yes bin/webpack --watch
5+ wp-client: HMR=true RAILS_ENV=development NODE_ENV=development bin/webpacker -dev-server
6+ wp-server: bundle exec rake react_on_rails:locale && HMR=true SERVER_BUNDLE_ONLY=yes bin/webpacker --watch
Original file line number Diff line number Diff line change @@ -6,5 +6,5 @@ redis: redis-server
66# When making frequent changes to client side assets, you will prefer building webpack assets
77# upon saving rather than when you refresh your browser page.
88# Note, if using React on Rails localization you will need to run
9- # `bundle exec rake react_on_rails:locale` before you run bin/webpack
10- webpack: sh -c 'bundle exec rake react_on_rails:locale && rm -rf public/packs/* || true && bin/webpack -w'
9+ # `bundle exec rake react_on_rails:locale` before you run bin/webpacker
10+ webpack: sh -c 'bundle exec rake react_on_rails:locale && rm -rf public/packs/* || true && bin/webpacker -w'
Original file line number Diff line number Diff line change 1- // The source code including full typescript support is available at:
2- // https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/babel.config.js
3-
4- const defaultConfigFunc = require ( '@rails/webpacker/package/babel/preset.js' ) ;
5-
61module . exports = function ( api ) {
7- const resultConfig = defaultConfigFunc ( api ) ;
2+ const defaultConfigFunc = require ( 'shakapacker/package/babel/preset.js' )
3+ const resultConfig = defaultConfigFunc ( api )
4+ const isProductionEnv = api . env ( 'production' )
85
96 const changesOnDefault = {
10- plugins : [ process . env . WEBPACK_SERVE && 'react-refresh/babel' ] . filter ( Boolean ) ,
11- } ;
7+ presets : [
8+ [
9+ '@babel/preset-react' ,
10+ {
11+ development : ! isProductionEnv ,
12+ useBuiltIns : true
13+ }
14+ ]
15+ ] . filter ( Boolean ) ,
16+ plugins : [
17+ process . env . WEBPACK_SERVE && 'react-refresh/babel' ,
18+ isProductionEnv && [ 'babel-plugin-transform-react-remove-prop-types' ,
19+ {
20+ removeImport : true
21+ }
22+ ]
23+ ] . filter ( Boolean ) ,
24+ }
1225
13- resultConfig . plugins = [ ...resultConfig . plugins , ...changesOnDefault . plugins ] ;
26+ resultConfig . presets = [ ...resultConfig . presets , ...changesOnDefault . presets ]
27+ resultConfig . plugins = [ ...resultConfig . plugins , ...changesOnDefault . plugins ]
1428
15- return resultConfig ;
16- } ;
29+ return resultConfig
30+ }
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ require "webpacker"
66require "webpacker/webpack_runner"
77
88ENV [ "RAILS_ENV" ] ||= "development"
9- ENV [ "NODE_ENV" ] ||= "development"
9+ ENV [ "NODE_ENV" ] ||= ENV [ "RAILS_ENV" ]
1010ENV [ "BUNDLE_GEMFILE" ] ||= File . expand_path ( "../../Gemfile" , Pathname . new ( __FILE__ ) . realpath )
1111
1212APP_ROOT = File . expand_path ( ".." , __dir__ )
Original file line number Diff line number Diff line change 11#!/usr/bin/env ruby
22
33ENV [ "RAILS_ENV" ] ||= "development"
4- ENV [ "NODE_ENV" ] ||= "development"
4+ ENV [ "NODE_ENV" ] ||= ENV [ "RAILS_ENV" ]
55
66require "pathname"
77ENV [ "BUNDLE_GEMFILE" ] ||= File . expand_path ( "../../Gemfile" ,
Original file line number Diff line number Diff line change 33# https://github.com/rails/webpacker/pull/2018
44
55To debug:
6- bin/webpack --debug
6+ bin/webpacker --debug-webpakcer
77
88And put a debugger statement in the file you're editing.
99
Original file line number Diff line number Diff line change 22// https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/config/webpack/commonWebpackConfig.js
33
44// Common configuration applying to client and server configuration
5- const { webpackConfig : baseClientWebpackConfig , merge } = require ( '@rails/webpacker ' ) ;
5+ const { webpackConfig : baseClientWebpackConfig , merge } = require ( 'shakapacker ' ) ;
66
77const commonOptions = {
88 resolve : {
You can’t perform that action at this time.
0 commit comments