browserify-rails 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +2 -0
- data/lib/browserify-rails/browserify_processor.rb +1 -1
- data/lib/browserify-rails/version.rb +1 -1
- data/test/compilation_test.rb +7 -0
- data/test/dummy/app/assets/javascripts/require_in_a_comment.js.example +3 -0
- data/test/fixtures/require_in_a_comment.js +3 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5051cb1b96115f8c8d020164649ca895761caa08
|
4
|
+
data.tar.gz: 0125b5f01c1d25aa75d3955f7736f61788bbd6d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 490d690fa6e640f4493bb67183f2e9c4b126736884146b7166675373cf302b9a41b792b8cf3081c0f02608b2ec0dd349dec39f3f91a3611d715c16ec72e914d4
|
7
|
+
data.tar.gz: e69de2ac275ebdaf00f3fd113a196cfcc84f7216d01b81b657bc106bb6364db64b1073cd0ca66cc8ba74a20b599931dba64728d904bf042c1513578038525858
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file going forward.
|
3
3
|
|
4
|
+
## [2.0.3] - 2015-12-18
|
5
|
+
- detection of CommonJS (require(.*)) now more stringent
|
6
|
+
- update README about 2.x and react-rails
|
7
|
+
|
4
8
|
## [2.0.2] - 2015-11-23
|
5
9
|
- fix bug in dependencies passed to sprockets which broke change detection
|
6
10
|
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# browserify-rails
|
2
2
|
|
3
|
+
**If you are using react-rails or experience any issues with browiserfy-rails 2.x, please use the 1.5.x versions until 2.x is stabilized. Please see the issues for discussions and feel free to post your experience. The use of react-rails with browserify-rails is a bit of an anti-pattern in terms of going to CommonJS so it may never be supported. Consider using a browserify transform for React support.
|
4
|
+
|
3
5
|
[![Join the chat at https://gitter.im/browserify-rails/browserify-rails](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/browserify-rails/browserify-rails?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4
6
|
[![Gem Version](https://badge.fury.io/rb/browserify-rails.svg)](http://badge.fury.io/rb/browserify-rails)
|
5
7
|
|
@@ -106,7 +106,7 @@ module BrowserifyRails
|
|
106
106
|
# Be here as strict as possible, so that non-commonjs files are not
|
107
107
|
# preprocessed.
|
108
108
|
def commonjs_module?
|
109
|
-
data.to_s.include?("module.exports") || data.present? && data.to_s.
|
109
|
+
data.to_s.include?("module.exports") || data.present? && data.to_s.match(/require\(.*\)/) && dependencies.length > 0
|
110
110
|
end
|
111
111
|
|
112
112
|
def asset_paths
|
data/test/compilation_test.rb
CHANGED
@@ -25,6 +25,7 @@ class BrowserifyTest < ActionDispatch::IntegrationTest
|
|
25
25
|
copy_example_file "coffee.js.coffee.example"
|
26
26
|
copy_example_file "node_path_based_require.js.example"
|
27
27
|
copy_example_file "main.js.example"
|
28
|
+
copy_example_file "require_in_a_comment.js.example"
|
28
29
|
copy_example_file "secondary.js.example"
|
29
30
|
copy_example_file "a_huge_library.js.example"
|
30
31
|
copy_example_file "some_folder/answer.js.example"
|
@@ -163,6 +164,12 @@ class BrowserifyTest < ActionDispatch::IntegrationTest
|
|
163
164
|
assert_equal fixture("plain.js"), @response.body.strip
|
164
165
|
end
|
165
166
|
|
167
|
+
test "skip files containing the word require in comments" do
|
168
|
+
get "/assets/require_in_a_comment.js"
|
169
|
+
|
170
|
+
assert_equal fixture("require_in_a_comment.js"), @response.body.strip
|
171
|
+
end
|
172
|
+
|
166
173
|
test "browserify even plain files if force == true" do
|
167
174
|
Dummy::Application.config.browserify_rails.force = true
|
168
175
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browserify-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henry Hsu, Cymen Vig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -180,6 +180,7 @@ files:
|
|
180
180
|
- test/dummy/app/assets/javascripts/node.js.example
|
181
181
|
- test/dummy/app/assets/javascripts/node_path_based_require.js.example
|
182
182
|
- test/dummy/app/assets/javascripts/plain.js
|
183
|
+
- test/dummy/app/assets/javascripts/require_in_a_comment.js.example
|
183
184
|
- test/dummy/app/assets/javascripts/secondary.js.example
|
184
185
|
- test/dummy/app/assets/javascripts/some_folder/answer.js.example
|
185
186
|
- test/dummy/app/assets/stylesheets/application.css
|
@@ -228,6 +229,7 @@ files:
|
|
228
229
|
- test/fixtures/node_test_package.out.js
|
229
230
|
- test/fixtures/plain.js
|
230
231
|
- test/fixtures/plain.out.js
|
232
|
+
- test/fixtures/require_in_a_comment.js
|
231
233
|
- test/fixtures/secondary.out.js
|
232
234
|
- test/test_helper.rb
|
233
235
|
homepage: https://github.com/browserify-rails/browserify-rails
|
@@ -272,6 +274,7 @@ test_files:
|
|
272
274
|
- test/dummy/app/assets/javascripts/node.js.example
|
273
275
|
- test/dummy/app/assets/javascripts/node_path_based_require.js.example
|
274
276
|
- test/dummy/app/assets/javascripts/plain.js
|
277
|
+
- test/dummy/app/assets/javascripts/require_in_a_comment.js.example
|
275
278
|
- test/dummy/app/assets/javascripts/secondary.js.example
|
276
279
|
- test/dummy/app/assets/javascripts/some_folder/answer.js.example
|
277
280
|
- test/dummy/app/assets/stylesheets/application.css
|
@@ -320,6 +323,6 @@ test_files:
|
|
320
323
|
- test/fixtures/node_test_package.out.js
|
321
324
|
- test/fixtures/plain.js
|
322
325
|
- test/fixtures/plain.out.js
|
326
|
+
- test/fixtures/require_in_a_comment.js
|
323
327
|
- test/fixtures/secondary.out.js
|
324
328
|
- test/test_helper.rb
|
325
|
-
has_rdoc:
|