From 71ea400c796708a501e4c4e94f8b2d4fe4dd19ea Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Sat, 26 Mar 2016 17:59:54 -1000 Subject: [PATCH 1/2] Add turbolinks 5 from npm --- Gemfile | 3 ++- Gemfile.lock | 4 ---- app/assets/javascripts/application_non_webpack.js | 4 +--- client/npm-shrinkwrap.json | 9 +++++++-- client/package.json | 3 ++- client/webpack.client.base.config.js | 2 ++ 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 7eb8953be..9bcb01611 100644 --- a/Gemfile +++ b/Gemfile @@ -25,7 +25,8 @@ gem "coffee-rails" # Turbolinks makes following links in your web application faster. # Read more: https://github.com/turbolinks/turbolinks -gem 'turbolinks', '>= 5.0.0.beta2' +# Get turbolinks from npm! +# gem 'turbolinks', '>= 5.0.0.beta2' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem "jbuilder" diff --git a/Gemfile.lock b/Gemfile.lock index 9345d95b2..41a52b64d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -296,9 +296,6 @@ GEM thread_safe (0.3.5) tilt (2.0.2) tins (1.6.0) - turbolinks (5.0.0.beta2) - turbolinks-source - turbolinks-source (5.0.0.beta2) tzinfo (1.2.2) thread_safe (~> 0.1) uglifier (2.7.2) @@ -363,7 +360,6 @@ DEPENDENCIES spring-commands-rspec sqlite3 therubyracer - turbolinks (>= 5.0.0.beta2) uglifier web-console diff --git a/app/assets/javascripts/application_non_webpack.js b/app/assets/javascripts/application_non_webpack.js index 855ebb658..a761af074 100644 --- a/app/assets/javascripts/application_non_webpack.js +++ b/app/assets/javascripts/application_non_webpack.js @@ -1,7 +1,5 @@ // All webpack assets in development will be loaded via webpack dev server -// It's important to include them in layout view above this asset -// b/c it exposes jQuery for turbolinks and another non-webpack JS (if any) -//= require turbolinks +// turbolinks comes from npm and is listed in webpack.client.base.config.js //= require rails_startup diff --git a/client/npm-shrinkwrap.json b/client/npm-shrinkwrap.json index ea56ace53..458b6fb45 100644 --- a/client/npm-shrinkwrap.json +++ b/client/npm-shrinkwrap.json @@ -4151,8 +4151,9 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-0.14.7.tgz" }, "react-on-rails": { - "version": "4.0.0", - "from": "react-on-rails@>=4.0.0 <5.0.0" + "version": "4.0.2", + "from": "react-on-rails@4.0.2", + "resolved": "https://registry.npmjs.org/react-on-rails/-/react-on-rails-4.0.2.tgz" }, "react-overlays": { "version": "0.6.0", @@ -4913,6 +4914,10 @@ "from": "tunnel-agent@>=0.4.1 <0.5.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.2.tgz" }, + "turbolinks": { + "version": "0.0.2", + "from": "turbolinks@latest" + }, "tv4": { "version": "1.2.7", "from": "tv4@>=1.2.7 <2.0.0", diff --git a/client/package.json b/client/package.json index 2b39b1069..bc4ed51e4 100644 --- a/client/package.json +++ b/client/package.json @@ -73,14 +73,15 @@ "react-on-rails": "^4.0.0", "react-redux": "^4.4.0", "react-router": "^2.0.0", - "redux": "^3.3.1", "react-router-redux": "^4.0.0", + "redux": "^3.3.1", "redux-promise": "^0.5.1", "redux-thunk": "^1.0.3", "resolve-url-loader": "^1.4.3", "sass-loader": "^3.1.2", "sass-resources-loader": "1.0.2", "style-loader": "^0.13.0", + "turbolinks": "0.0.2", "url-loader": "^0.5.7", "webpack": "^1.12.14" }, diff --git a/client/webpack.client.base.config.js b/client/webpack.client.base.config.js index 303b68bb9..65db6b074 100644 --- a/client/webpack.client.base.config.js +++ b/client/webpack.client.base.config.js @@ -19,6 +19,7 @@ module.exports = { 'es5-shim/es5-shim', 'es5-shim/es5-sham', 'jquery', + 'turbolinks', ], // This will contain the app entry points defined by webpack.hot.config and webpack.rails.config @@ -65,6 +66,7 @@ module.exports = { { test: require.resolve('jquery'), loader: 'expose?jQuery' }, { test: require.resolve('jquery'), loader: 'expose?$' }, + { test: require.resolve('turbolinks'), loader: 'imports?this=>window' }, // Use one of these to serve jQuery for Bootstrap scripts: From 2854b294ed31147851bad9cbcb3e3cf049229791 Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Sat, 26 Mar 2016 18:40:48 -1000 Subject: [PATCH 2/2] estraverse-fb is needed for eslint --- client/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/client/package.json b/client/package.json index bc4ed51e4..cd9a9ddc8 100644 --- a/client/package.json +++ b/client/package.json @@ -93,6 +93,7 @@ "eslint": "^2.3.0", "eslint-config-shakacode": "^3.0.0", "eslint-plugin-react": "^4.2.0", + "estraverse-fb": "^1.3.1", "express": "^4.13.4", "jade": "^1.11.0", "jscs": "^2.11.0",