Skip to content

Commit

Permalink
Final fixes for v7.1.0
Browse files Browse the repository at this point in the history
* Removed unnecessary rake task for running specs
* Fixed inconsistency with using "-bundle" only some of the time.
* Removed unused node_modules value in paths.yml
* Upgraded to webpacker_lite 1.0.0
  • Loading branch information
justin808 committed May 3, 2017
1 parent 84811ff commit bc257a7
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 24 deletions.
9 changes: 0 additions & 9 deletions rakelib/run_rspec.rake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ include ReactOnRails::TaskHelpers

namespace :run_rspec do
spec_dummy_dir = File.join("spec", "dummy")
spec_dummy_client_dir = File.join("spec", "dummy", "client")

desc "Run RSpec for top level only"
task :gem do
Expand All @@ -21,14 +20,12 @@ namespace :run_rspec do
desc "Runs dummy rspec with turbolinks"
task dummy: ["dummy_apps:dummy_app"] do
clean_gen_assets(spec_dummy_dir)
gen_assets(spec_dummy_client_dir)
run_tests_in(spec_dummy_dir)
end

desc "Runs dummy rspec without turbolinks"
task dummy_no_turbolinks: ["dummy_apps:dummy_app"] do
clean_gen_assets(spec_dummy_dir)
gen_assets(spec_dummy_client_dir)
run_tests_in(spec_dummy_dir,
env_vars: "DISABLE_TURBOLINKS=TRUE",
command_name: "dummy_no_turbolinks")
Expand All @@ -38,7 +35,6 @@ namespace :run_rspec do
desc "Runs dummy respec with turbolinks 2"
task dummy_turbolinks_2: ["dummy_apps:dummy_app_with_turbolinks_2"] do
clean_gen_assets(spec_dummy_dir)
gen_assets(spec_dummy_client_dir)
run_tests_in(spec_dummy_dir, env_vars:
"ENABLE_TURBOLINKS_2=TRUE BUNDLE_GEMFILE=#{dummy_app_dir}/Gemfile")
end
Expand Down Expand Up @@ -119,8 +115,3 @@ def clean_gen_assets(dir)
path = calc_path(dir)
sh_in_dir(path.realpath, "yarn run build:clean")
end

def gen_assets(dir)
path = calc_path(dir)
sh_in_dir(path.realpath, "yarn run build:test")
end
2 changes: 1 addition & 1 deletion spec/dummy/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ gem 'sdoc', '~> 0.4.0', group: :doc

gem "react_on_rails", path: "../.."

gem "webpacker_lite", "0.0.5"
gem "webpacker_lite"

gem "mini_racer"

Expand Down
8 changes: 4 additions & 4 deletions spec/dummy/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ GEM
minitest (5.10.1)
multi_json (1.12.1)
nio4r (2.0.0)
nokogiri (1.7.0.1)
nokogiri (1.7.1)
mini_portile2 (~> 2.1.0)
parser (2.4.0.0)
ast (~> 2.2)
Expand Down Expand Up @@ -272,12 +272,12 @@ GEM
turbolinks (5.0.1)
turbolinks-source (~> 5)
turbolinks-source (5.0.0)
tzinfo (1.2.2)
tzinfo (1.2.3)
thread_safe (~> 0.1)
uglifier (3.1.4)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.1.3)
webpacker_lite (0.0.5)
webpacker_lite (1.0.0)
activesupport (>= 4.2)
multi_json (~> 1.2)
railties (>= 4.2)
Expand Down Expand Up @@ -328,7 +328,7 @@ DEPENDENCIES
sqlite3
turbolinks (~> 5.0)
uglifier
webpacker_lite (= 0.0.5)
webpacker_lite

BUNDLED WITH
1.14.6
2 changes: 1 addition & 1 deletion spec/dummy/Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: bundle exec puma -C config/puma.rb
run: echo "Run Procfile.static or Procfile.hot"
6 changes: 3 additions & 3 deletions spec/dummy/app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<%= yield :head %>
<%= stylesheet_pack_tag(static: 'app',
<%= stylesheet_pack_tag(static: 'app-bundle',
media: 'all',
'data-turbolinks-track': true) %>
<%= javascript_pack_tag('vendor', 'data-turbolinks-track': true) %>)
<%= javascript_pack_tag('app', 'data-turbolinks-track': true) %>)
<%= javascript_pack_tag('vendor-bundle', 'data-turbolinks-track': true) %>
<%= javascript_pack_tag('app-bundle', 'data-turbolinks-track': true) %>
<%= csrf_meta_tags %>
</head>
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/client/webpack.client.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = {
entry: {
// This will contain the app entry points defined by
// webpack.client.rails.hot.config and webpack.client.rails.build.config
app: [
'app-bundle': [
'./app/startup/clientRegistration',
],
},
Expand All @@ -40,7 +40,7 @@ module.exports = {

// https://webpack.js.org/guides/code-splitting-libraries/#implicit-common-vendor-chunk
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
name: 'vendor-bundle',
minChunks(module) {
// this assumes your vendor imports exist in the node_modules directory
return module.context && module.context.indexOf('node_modules') !== -1;
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/client/webpack.client.rails.build.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { paths, publicPath } = webpackConfigLoader(configPath);
const devBuild = process.env.NODE_ENV !== 'production';

config.output = {
filename: '[name]-bundle.js',
filename: '[name].js',
path: resolve('..', paths.output, paths.assets),
publicPath,
},
Expand Down Expand Up @@ -98,7 +98,7 @@ config.module.rules.push(

config.plugins.push(
new ExtractTextPlugin({
filename: '[name]-bundle.css',
filename: '[name].css',
allChunks: true
})
);
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/client/webpack.client.rails.hot.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ config.entry.app.push(
);

config.output = {
filename: '[name]-bundle.js',
filename: '[name].js',
path: resolve('..', paths.output, paths.assets),
publicPath,
};
Expand Down
1 change: 0 additions & 1 deletion spec/dummy/config/webpack/paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ default: &default
output: public
assets: webpack
manifest: manifest.json
node_modules: client/node_modules
source: client/app

development:
Expand Down

0 comments on commit bc257a7

Please sign in to comment.