stimulus_reflex 3.4.0.pre4 → 3.4.0.pre9

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of stimulus_reflex might be problematic. Click here for more details.

Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +83 -6
  3. data/Gemfile.lock +79 -76
  4. data/README.md +5 -9
  5. data/Rakefile +5 -5
  6. data/app/channels/stimulus_reflex/channel.rb +22 -0
  7. data/bin/console +1 -0
  8. data/bin/standardize +1 -1
  9. data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/%file_name%_controller.js.tt +14 -2
  10. data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/application_controller.js.tt +10 -2
  11. data/lib/generators/stimulus_reflex/templates/app/reflexes/%file_name%_reflex.rb.tt +19 -9
  12. data/lib/generators/stimulus_reflex/templates/app/reflexes/application_reflex.rb.tt +2 -2
  13. data/lib/generators/stimulus_reflex/templates/config/initializers/stimulus_reflex.rb +10 -1
  14. data/lib/stimulus_reflex.rb +2 -1
  15. data/lib/stimulus_reflex/broadcasters/broadcaster.rb +3 -5
  16. data/lib/stimulus_reflex/broadcasters/page_broadcaster.rb +3 -2
  17. data/lib/stimulus_reflex/broadcasters/selector_broadcaster.rb +4 -4
  18. data/lib/stimulus_reflex/cable_ready_channels.rb +21 -0
  19. data/lib/stimulus_reflex/configuration.rb +2 -1
  20. data/lib/stimulus_reflex/reflex.rb +16 -6
  21. data/lib/stimulus_reflex/sanity_checker.rb +19 -5
  22. data/lib/stimulus_reflex/version.rb +1 -1
  23. data/lib/tasks/stimulus_reflex/install.rake +8 -3
  24. data/package.json +6 -6
  25. data/stimulus_reflex.gemspec +3 -1
  26. data/tags +95 -37
  27. data/test/broadcasters/broadcaster_test.rb +3 -6
  28. data/test/broadcasters/broadcaster_test_case.rb +15 -0
  29. data/test/broadcasters/nothing_broadcaster_test.rb +27 -26
  30. data/test/broadcasters/page_broadcaster_test.rb +56 -50
  31. data/test/broadcasters/selector_broadcaster_test.rb +57 -83
  32. data/test/reflex_test.rb +32 -0
  33. data/test/test_helper.rb +43 -2
  34. data/test/tmp/app/reflexes/application_reflex.rb +2 -2
  35. data/test/tmp/app/reflexes/demo_reflex.rb +35 -0
  36. data/yarn.lock +299 -300
  37. metadata +11 -6
  38. data/test/tmp/app/reflexes/posts_reflex.rb +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d3b9110da6cd9d446b19c1bd8ac2978b1d8b0c5ca88d1a1cf9fb849400a1757
4
- data.tar.gz: 5512ece82357de04c62f9c4fcff9bba59bf6dec9f9234effeb06772084e96d38
3
+ metadata.gz: 2848aafa546f97670d86dd381bc4b05ffcd56962fea931ba537004a1bf2593c8
4
+ data.tar.gz: 7dc8dfb4ff3760ca3701b5a34f2622e3d43b449e02d7ff3fb193fd6a124186d4
5
5
  SHA512:
6
- metadata.gz: 928a0b20cc704cb30a1a9c7ccfe7672cc44c2e8cce2f9387b87ddc531981b2521e926992271233fb18e7787121bcda84e4f90c64823d32f5c2824ad302ba24e4
7
- data.tar.gz: da166747c83c5dfee363e6a9475826cb32d3ba850f997481539cfdd475e390614e7726083bdf7e18762f410d4b74ff8b031922a66647498937d065479e939002
6
+ metadata.gz: 9e9bf858782e9a3a18ae76ccbc4e8808db4bd6c6c1ffd185f62101974ddcf708f3eef80439cae12ce6405ef632fd2ee1933866dc17eded4accd66422f7ff2231
7
+ data.tar.gz: 6535eb6146e20306e5b2bd9ef04cc793b61f7dea64232c73d344dbe8ae410c23f3ecba8961f895cbd1df708f10f6341c9b292ef22714615a5be8fcc150bd1d88
@@ -2,7 +2,88 @@
2
2
 
3
3
  ## [Unreleased](https://github.com/hopsoft/stimulus_reflex/tree/HEAD)
4
4
 
5
- [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.4.0.pre3...HEAD)
5
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.4.0.pre8...HEAD)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Support for Stimulus 2 [\#398](https://github.com/hopsoft/stimulus_reflex/pull/398) ([marcoroth](https://github.com/marcoroth))
10
+
11
+ **Fixed bugs:**
12
+
13
+ - fix up install task [\#401](https://github.com/hopsoft/stimulus_reflex/pull/401) ([leastbad](https://github.com/leastbad))
14
+ - Fix multiple broadcasts from within the same reflex [\#400](https://github.com/hopsoft/stimulus_reflex/pull/400) ([hopsoft](https://github.com/hopsoft))
15
+
16
+ **Closed issues:**
17
+
18
+ - Sanity checker will fail if node\_modules folder isn't present [\#402](https://github.com/hopsoft/stimulus_reflex/issues/402)
19
+ - stimulus\_reflex.js:388 Uncaught TypeError: Cannot read property 'completedOperations' of undefined [\#394](https://github.com/hopsoft/stimulus_reflex/issues/394)
20
+
21
+ **Merged pull requests:**
22
+
23
+ - Add dom\_id to the reflex [\#405](https://github.com/hopsoft/stimulus_reflex/pull/405) ([hopsoft](https://github.com/hopsoft))
24
+ - Check package version from yarn.lock if node\_modules folder is not av… [\#403](https://github.com/hopsoft/stimulus_reflex/pull/403) ([RolandStuder](https://github.com/RolandStuder))
25
+
26
+ ## [v3.4.0.pre8](https://github.com/hopsoft/stimulus_reflex/tree/v3.4.0.pre8) (2020-12-02)
27
+
28
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.4.0.pre7...v3.4.0.pre8)
29
+
30
+ **Closed issues:**
31
+
32
+ - DirectUpload URL not set using morphs [\#396](https://github.com/hopsoft/stimulus_reflex/issues/396)
33
+
34
+ **Merged pull requests:**
35
+
36
+ - Delegate render to controller [\#397](https://github.com/hopsoft/stimulus_reflex/pull/397) ([hopsoft](https://github.com/hopsoft))
37
+
38
+ ## [v3.4.0.pre7](https://github.com/hopsoft/stimulus_reflex/tree/v3.4.0.pre7) (2020-12-01)
39
+
40
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.4.0.pre6...v3.4.0.pre7)
41
+
42
+ **Closed issues:**
43
+
44
+ - Multiple reflex submissions can lead to unexpected behaviour. [\#391](https://github.com/hopsoft/stimulus_reflex/issues/391)
45
+
46
+ **Merged pull requests:**
47
+
48
+ - Trigger piggy back operations after SR operations [\#395](https://github.com/hopsoft/stimulus_reflex/pull/395) ([hopsoft](https://github.com/hopsoft))
49
+ - `invokeLifecycleMethod\(\)`: handle undefined `element` parameter [\#393](https://github.com/hopsoft/stimulus_reflex/pull/393) ([marcoroth](https://github.com/marcoroth))
50
+ - don't warn folks twice [\#392](https://github.com/hopsoft/stimulus_reflex/pull/392) ([leastbad](https://github.com/leastbad))
51
+
52
+ ## [v3.4.0.pre6](https://github.com/hopsoft/stimulus_reflex/tree/v3.4.0.pre6) (2020-11-29)
53
+
54
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.4.0.pre5...v3.4.0.pre6)
55
+
56
+ **Merged pull requests:**
57
+
58
+ - Update templates for new stage etc [\#390](https://github.com/hopsoft/stimulus_reflex/pull/390) ([leastbad](https://github.com/leastbad))
59
+ - reflexError and received refactor [\#389](https://github.com/hopsoft/stimulus_reflex/pull/389) ([leastbad](https://github.com/leastbad))
60
+ - add jQuery support to SR library events [\#388](https://github.com/hopsoft/stimulus_reflex/pull/388) ([leastbad](https://github.com/leastbad))
61
+ - dont exit in sanity checker on `stimulus\_reflex:install` [\#387](https://github.com/hopsoft/stimulus_reflex/pull/387) ([marcoroth](https://github.com/marcoroth))
62
+ - Allow `success` and `after` lifecycle methods on replaced elements [\#386](https://github.com/hopsoft/stimulus_reflex/pull/386) ([marcoroth](https://github.com/marcoroth))
63
+ - split SR operations from data.operations [\#385](https://github.com/hopsoft/stimulus_reflex/pull/385) ([leastbad](https://github.com/leastbad))
64
+ - don't show findElement warnings unless debugging [\#384](https://github.com/hopsoft/stimulus_reflex/pull/384) ([leastbad](https://github.com/leastbad))
65
+ - Setup a proxy object that wraps CableReady::Channels [\#382](https://github.com/hopsoft/stimulus_reflex/pull/382) ([hopsoft](https://github.com/hopsoft))
66
+ - non-SR cable\_ready operation pass-through [\#381](https://github.com/hopsoft/stimulus_reflex/pull/381) ([leastbad](https://github.com/leastbad))
67
+
68
+ ## [v3.4.0.pre5](https://github.com/hopsoft/stimulus_reflex/tree/v3.4.0.pre5) (2020-11-25)
69
+
70
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.4.0.pre4...v3.4.0.pre5)
71
+
72
+ **Closed issues:**
73
+
74
+ - SR doesn't seem to handle redirects / 302s [\#376](https://github.com/hopsoft/stimulus_reflex/issues/376)
75
+
76
+ **Merged pull requests:**
77
+
78
+ - Move package.json to root of project [\#380](https://github.com/hopsoft/stimulus_reflex/pull/380) ([hopsoft](https://github.com/hopsoft))
79
+ - make element.reflexController a dictionary [\#379](https://github.com/hopsoft/stimulus_reflex/pull/379) ([existentialmutt](https://github.com/existentialmutt))
80
+ - fixed bug preventing callbacks for multiple morphs [\#378](https://github.com/hopsoft/stimulus_reflex/pull/378) ([leastbad](https://github.com/leastbad))
81
+ - Handles to mitigate race conditions when running reflexes in quick succession on the same element [\#377](https://github.com/hopsoft/stimulus_reflex/pull/377) ([existentialmutt](https://github.com/existentialmutt))
82
+ - Exit with nonzero status code [\#375](https://github.com/hopsoft/stimulus_reflex/pull/375) ([julianrubisch](https://github.com/julianrubisch))
83
+
84
+ ## [v3.4.0.pre4](https://github.com/hopsoft/stimulus_reflex/tree/v3.4.0.pre4) (2020-11-19)
85
+
86
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.4.0.pre3...v3.4.0.pre4)
6
87
 
7
88
  **Fixed bugs:**
8
89
 
@@ -81,7 +162,6 @@
81
162
  - ActionController::RoutingError with Rails 6 Engines [\#342](https://github.com/hopsoft/stimulus_reflex/issues/342)
82
163
  - Wrong input name parsing [\#321](https://github.com/hopsoft/stimulus_reflex/issues/321)
83
164
  - Stimulus' controllers are not reconnecting after reflex, why? [\#314](https://github.com/hopsoft/stimulus_reflex/issues/314)
84
- - Rendering issue [\#289](https://github.com/hopsoft/stimulus_reflex/issues/289)
85
165
  - Documentation Request for a Rails 6.x app with 5.2 defaults [\#265](https://github.com/hopsoft/stimulus_reflex/issues/265)
86
166
 
87
167
  **Merged pull requests:**
@@ -203,6 +283,7 @@
203
283
  - Fix argument of type object always being assigned to options [\#279](https://github.com/hopsoft/stimulus_reflex/pull/279) ([shawnleong](https://github.com/shawnleong))
204
284
  - Simplify devise authentication logic \(in docs\) [\#276](https://github.com/hopsoft/stimulus_reflex/pull/276) ([inner-whisper](https://github.com/inner-whisper))
205
285
  - Bump lodash from 4.17.15 to 4.17.19 in /javascript [\#275](https://github.com/hopsoft/stimulus_reflex/pull/275) ([dependabot[bot]](https://github.com/apps/dependabot))
286
+ - Fix selector morphs for updating partials and ViewComponents [\#262](https://github.com/hopsoft/stimulus_reflex/pull/262) ([leastbad](https://github.com/leastbad))
206
287
 
207
288
  ## [v3.3.0.pre2](https://github.com/hopsoft/stimulus_reflex/tree/v3.3.0.pre2) (2020-07-17)
208
289
 
@@ -227,10 +308,6 @@
227
308
 
228
309
  [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.3.0.pre0...v3.3.0.pre1)
229
310
 
230
- **Merged pull requests:**
231
-
232
- - Fix selector morphs for updating partials and ViewComponents [\#262](https://github.com/hopsoft/stimulus_reflex/pull/262) ([leastbad](https://github.com/leastbad))
233
-
234
311
  ## [v3.3.0.pre0](https://github.com/hopsoft/stimulus_reflex/tree/v3.3.0.pre0) (2020-07-04)
235
312
 
236
313
  [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.2.3...v3.3.0.pre0)
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stimulus_reflex (3.4.0.pre4)
5
- cable_ready (>= 4.3.0)
4
+ stimulus_reflex (3.4.0.pre9)
5
+ cable_ready (>= 4.4)
6
6
  nokogiri
7
7
  rack
8
8
  rails (>= 5.2)
@@ -11,64 +11,68 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- actioncable (6.0.3.4)
15
- actionpack (= 6.0.3.4)
14
+ actioncable (6.1.0)
15
+ actionpack (= 6.1.0)
16
+ activesupport (= 6.1.0)
16
17
  nio4r (~> 2.0)
17
18
  websocket-driver (>= 0.6.1)
18
- actionmailbox (6.0.3.4)
19
- actionpack (= 6.0.3.4)
20
- activejob (= 6.0.3.4)
21
- activerecord (= 6.0.3.4)
22
- activestorage (= 6.0.3.4)
23
- activesupport (= 6.0.3.4)
19
+ actionmailbox (6.1.0)
20
+ actionpack (= 6.1.0)
21
+ activejob (= 6.1.0)
22
+ activerecord (= 6.1.0)
23
+ activestorage (= 6.1.0)
24
+ activesupport (= 6.1.0)
24
25
  mail (>= 2.7.1)
25
- actionmailer (6.0.3.4)
26
- actionpack (= 6.0.3.4)
27
- actionview (= 6.0.3.4)
28
- activejob (= 6.0.3.4)
26
+ actionmailer (6.1.0)
27
+ actionpack (= 6.1.0)
28
+ actionview (= 6.1.0)
29
+ activejob (= 6.1.0)
30
+ activesupport (= 6.1.0)
29
31
  mail (~> 2.5, >= 2.5.4)
30
32
  rails-dom-testing (~> 2.0)
31
- actionpack (6.0.3.4)
32
- actionview (= 6.0.3.4)
33
- activesupport (= 6.0.3.4)
34
- rack (~> 2.0, >= 2.0.8)
33
+ actionpack (6.1.0)
34
+ actionview (= 6.1.0)
35
+ activesupport (= 6.1.0)
36
+ rack (~> 2.0, >= 2.0.9)
35
37
  rack-test (>= 0.6.3)
36
38
  rails-dom-testing (~> 2.0)
37
39
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
38
- actiontext (6.0.3.4)
39
- actionpack (= 6.0.3.4)
40
- activerecord (= 6.0.3.4)
41
- activestorage (= 6.0.3.4)
42
- activesupport (= 6.0.3.4)
40
+ actiontext (6.1.0)
41
+ actionpack (= 6.1.0)
42
+ activerecord (= 6.1.0)
43
+ activestorage (= 6.1.0)
44
+ activesupport (= 6.1.0)
43
45
  nokogiri (>= 1.8.5)
44
- actionview (6.0.3.4)
45
- activesupport (= 6.0.3.4)
46
+ actionview (6.1.0)
47
+ activesupport (= 6.1.0)
46
48
  builder (~> 3.1)
47
49
  erubi (~> 1.4)
48
50
  rails-dom-testing (~> 2.0)
49
51
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
50
- activejob (6.0.3.4)
51
- activesupport (= 6.0.3.4)
52
+ activejob (6.1.0)
53
+ activesupport (= 6.1.0)
52
54
  globalid (>= 0.3.6)
53
- activemodel (6.0.3.4)
54
- activesupport (= 6.0.3.4)
55
- activerecord (6.0.3.4)
56
- activemodel (= 6.0.3.4)
57
- activesupport (= 6.0.3.4)
58
- activestorage (6.0.3.4)
59
- actionpack (= 6.0.3.4)
60
- activejob (= 6.0.3.4)
61
- activerecord (= 6.0.3.4)
55
+ activemodel (6.1.0)
56
+ activesupport (= 6.1.0)
57
+ activerecord (6.1.0)
58
+ activemodel (= 6.1.0)
59
+ activesupport (= 6.1.0)
60
+ activestorage (6.1.0)
61
+ actionpack (= 6.1.0)
62
+ activejob (= 6.1.0)
63
+ activerecord (= 6.1.0)
64
+ activesupport (= 6.1.0)
62
65
  marcel (~> 0.3.1)
63
- activesupport (6.0.3.4)
66
+ mimemagic (~> 0.3.2)
67
+ activesupport (6.1.0)
64
68
  concurrent-ruby (~> 1.0, >= 1.0.2)
65
- i18n (>= 0.7, < 2)
66
- minitest (~> 5.1)
67
- tzinfo (~> 1.1)
68
- zeitwerk (~> 2.2, >= 2.2.2)
69
+ i18n (>= 1.6, < 2)
70
+ minitest (>= 5.1)
71
+ tzinfo (~> 2.0)
72
+ zeitwerk (~> 2.3)
69
73
  ast (2.4.1)
70
74
  builder (3.2.4)
71
- cable_ready (4.3.0)
75
+ cable_ready (4.4.5)
72
76
  rails (>= 5.2)
73
77
  coderay (1.1.3)
74
78
  concurrent-ruby (1.1.7)
@@ -78,7 +82,7 @@ GEM
78
82
  activesupport (>= 4.2.0)
79
83
  i18n (1.8.5)
80
84
  concurrent-ruby (~> 1.0)
81
- loofah (2.7.0)
85
+ loofah (2.8.0)
82
86
  crass (~> 1.0.2)
83
87
  nokogiri (>= 1.5.9)
84
88
  mail (2.7.1)
@@ -93,7 +97,7 @@ GEM
93
97
  nio4r (2.5.4)
94
98
  nokogiri (1.10.10)
95
99
  mini_portile2 (~> 2.4.0)
96
- parallel (1.20.0)
100
+ parallel (1.20.1)
97
101
  parser (2.7.2.0)
98
102
  ast (~> 2.4.1)
99
103
  pry (0.12.2)
@@ -104,50 +108,50 @@ GEM
104
108
  rack (2.2.3)
105
109
  rack-test (1.1.0)
106
110
  rack (>= 1.0, < 3)
107
- rails (6.0.3.4)
108
- actioncable (= 6.0.3.4)
109
- actionmailbox (= 6.0.3.4)
110
- actionmailer (= 6.0.3.4)
111
- actionpack (= 6.0.3.4)
112
- actiontext (= 6.0.3.4)
113
- actionview (= 6.0.3.4)
114
- activejob (= 6.0.3.4)
115
- activemodel (= 6.0.3.4)
116
- activerecord (= 6.0.3.4)
117
- activestorage (= 6.0.3.4)
118
- activesupport (= 6.0.3.4)
119
- bundler (>= 1.3.0)
120
- railties (= 6.0.3.4)
111
+ rails (6.1.0)
112
+ actioncable (= 6.1.0)
113
+ actionmailbox (= 6.1.0)
114
+ actionmailer (= 6.1.0)
115
+ actionpack (= 6.1.0)
116
+ actiontext (= 6.1.0)
117
+ actionview (= 6.1.0)
118
+ activejob (= 6.1.0)
119
+ activemodel (= 6.1.0)
120
+ activerecord (= 6.1.0)
121
+ activestorage (= 6.1.0)
122
+ activesupport (= 6.1.0)
123
+ bundler (>= 1.15.0)
124
+ railties (= 6.1.0)
121
125
  sprockets-rails (>= 2.0.0)
122
126
  rails-dom-testing (2.0.3)
123
127
  activesupport (>= 4.2.0)
124
128
  nokogiri (>= 1.6)
125
129
  rails-html-sanitizer (1.3.0)
126
130
  loofah (~> 2.3)
127
- railties (6.0.3.4)
128
- actionpack (= 6.0.3.4)
129
- activesupport (= 6.0.3.4)
131
+ railties (6.1.0)
132
+ actionpack (= 6.1.0)
133
+ activesupport (= 6.1.0)
130
134
  method_source
131
135
  rake (>= 0.8.7)
132
- thor (>= 0.20.3, < 2.0)
136
+ thor (~> 1.0)
133
137
  rainbow (3.0.0)
134
138
  rake (13.0.1)
135
- redis (4.2.4)
136
- regexp_parser (1.8.2)
139
+ redis (4.2.5)
140
+ regexp_parser (2.0.0)
137
141
  rexml (3.2.4)
138
- rubocop (1.2.0)
142
+ rubocop (1.4.2)
139
143
  parallel (~> 1.10)
140
144
  parser (>= 2.7.1.5)
141
145
  rainbow (>= 2.2.2, < 4.0)
142
146
  regexp_parser (>= 1.8)
143
147
  rexml
144
- rubocop-ast (>= 1.0.1)
148
+ rubocop-ast (>= 1.1.1)
145
149
  ruby-progressbar (~> 1.7)
146
150
  unicode-display_width (>= 1.4.0, < 2.0)
147
- rubocop-ast (1.1.1)
151
+ rubocop-ast (1.3.0)
148
152
  parser (>= 2.7.1.5)
149
- rubocop-performance (1.8.1)
150
- rubocop (>= 0.87.0)
153
+ rubocop-performance (1.9.1)
154
+ rubocop (>= 0.90.0, < 2.0)
151
155
  rubocop-ast (>= 0.4.0)
152
156
  ruby-progressbar (1.10.1)
153
157
  sprockets (4.0.2)
@@ -157,20 +161,19 @@ GEM
157
161
  actionpack (>= 4.0)
158
162
  activesupport (>= 4.0)
159
163
  sprockets (>= 3.0.0)
160
- standard (0.9.0)
161
- rubocop (= 1.2.0)
162
- rubocop-performance (= 1.8.1)
164
+ standard (0.10.2)
165
+ rubocop (= 1.4.2)
166
+ rubocop-performance (= 1.9.1)
163
167
  standardrb (1.0.0)
164
168
  standard
165
169
  thor (1.0.1)
166
- thread_safe (0.3.6)
167
- tzinfo (1.2.8)
168
- thread_safe (~> 0.1)
170
+ tzinfo (2.0.3)
171
+ concurrent-ruby (~> 1.0)
169
172
  unicode-display_width (1.7.0)
170
173
  websocket-driver (0.7.3)
171
174
  websocket-extensions (>= 0.1.0)
172
175
  websocket-extensions (0.1.5)
173
- zeitwerk (2.4.1)
176
+ zeitwerk (2.4.2)
174
177
 
175
178
  PLATFORMS
176
179
  ruby
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="assets/stimulus-reflex-logo-with-copy.svg" width="360" />
2
+ <img src="https://gitcdn.link/repo/hopsoft/stimulus_reflex/master/assets/stimulus-reflex-logo-with-copy.svg" width="360" />
3
3
  <h1 align="center">Welcome to StimulusReflex 👋</h1>
4
4
  <p align="center">
5
5
  <img src="https://img.shields.io/gem/v/stimulus_reflex.svg?color=red" />
@@ -11,7 +11,7 @@
11
11
  <img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-brightgreen.svg" target="_blank" />
12
12
  </a>
13
13
  <a href="http://blog.codinghorror.com/the-best-code-is-no-code-at-all/" target="_blank">
14
- <img alt="Lines of Code" src="https://img.shields.io/badge/lines_of_code-1322-brightgreen.svg?style=flat" />
14
+ <img alt="Lines of Code" src="https://img.shields.io/badge/lines_of_code-1632-brightgreen.svg?style=flat" />
15
15
  </a>
16
16
  <a href="https://docs.stimulusreflex.com/" target="_blank">
17
17
  <img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
@@ -30,9 +30,6 @@
30
30
  <a href="https://www.codacy.com/manual/hopsoft/stimulus_reflex/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=hopsoft/stimulus_reflex&amp;utm_campaign=Badge_Grade" target="_blank">
31
31
  <img alt="Code Quality" src="https://app.codacy.com/project/badge/Grade/d1d72a7060f5467b8696884351cf477f"/>
32
32
  </a>
33
- <a href="https://codeclimate.com/github/hopsoft/stimulus_reflex/maintainability" target="_blank">
34
- <img alt="Maintainability" src="https://api.codeclimate.com/v1/badges/2b24fdbd1ae37a24bedb/maintainability" />
35
- </a>
36
33
  <a target="_blank" rel="noopener noreferrer" href="https://github.com/hopsoft/stimulus_reflex/workflows/Prettier-Standard/badge.svg">
37
34
  <img src="https://github.com/hopsoft/stimulus_reflex/workflows/Prettier-Standard/badge.svg" alt="Prettier-Standard" style="max-width:100%;">
38
35
  </a>
@@ -77,7 +74,7 @@ This project strives to live up to the vision outlined in [The Rails Doctrine](h
77
74
 
78
75
  ## 👩‍👩‍👧 Discord Community
79
76
 
80
- Please join over 700 of us on [Discord](https://discord.gg/XveN625) for support getting started, as well as active discussions around Rails, StimulusJS and CableReady.
77
+ Please join over 800 of us on [Discord](https://discord.gg/XveN625) for support getting started, as well as active discussions around Rails, StimulusJS and CableReady.
81
78
 
82
79
  ![](https://img.shields.io/discord/629472241427415060)
83
80
 
@@ -113,9 +110,8 @@ View the [wiki](https://github.com/hopsoft/stimulus_reflex/wiki/Editor-Configura
113
110
  1. Bump version number at `lib/stimulus_reflex/version.rb`
114
111
  1. Run `rake build`
115
112
  1. Run `rake release`
116
- 1. Change directories `cd ./javascript`
117
- 1. Run `yarn publish` - NOTE: this will throw a fatal error because the tag already exists but the package will still publish
118
-
113
+ 1. Run `yarn publish --no-git-tag-version`
114
+ 1. Commit and push changes to the `package.json` file
119
115
 
120
116
  ## 📝 License
121
117
 
data/Rakefile CHANGED
@@ -3,13 +3,13 @@
3
3
  require "bundler/gem_tasks"
4
4
  require "rails/test_unit/runner"
5
5
 
6
- task default: [:test]
7
-
8
- task :test do |task|
9
- return 1 unless system("cd javascript && yarn run test")
10
- Rails::TestUnit::Runner.run
6
+ task :test_javascript do |task|
7
+ system "yarn run test"
11
8
  end
12
9
 
13
10
  task :test_ruby do |task|
14
11
  Rails::TestUnit::Runner.run
15
12
  end
13
+
14
+ task test: [:test_javascript, :test_ruby]
15
+ task default: [:test]
@@ -49,11 +49,33 @@ class StimulusReflex::Channel < StimulusReflex.configuration.parent_channel.cons
49
49
  rescue => invoke_error
50
50
  message = exception_message_with_backtrace(invoke_error)
51
51
  body = "Reflex #{target} failed: #{message} [#{url}]"
52
+
52
53
  if reflex
53
54
  reflex.rescue_with_handler(invoke_error)
54
55
  reflex.broadcast_message subject: "error", body: body, data: data, error: invoke_error
55
56
  else
56
57
  puts "\e[31m#{body}\e[0m"
58
+
59
+ if body.to_s.include? "No route matches"
60
+ initializer_path = Rails.root.join("config", "initializers", "stimulus_reflex.rb")
61
+
62
+ puts <<~NOTE
63
+ \e[33mNOTE: StimulusReflex failed to locate a matching route and could not re-render the page.
64
+
65
+ If your app uses Rack middleware to rewrite part of the request path, you must enable those middleware modules in StimulusReflex.
66
+ The StimulusReflex initializer should be located at #{initializer_path}, or you can generate it with:
67
+
68
+ $ bundle exec rails generate stimulus_reflex:config
69
+
70
+ Configure any required middleware:
71
+
72
+ StimulusReflex.configure do |config|
73
+ config.middleware.use FirstRackMiddleware
74
+ config.middleware.use SecondRackMiddleware
75
+ end\e[0m
76
+
77
+ NOTE
78
+ end
57
79
  end
58
80
  return
59
81
  end