stimulus_reflex 3.3.0.pre3 → 3.4.0.pre0

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 (29) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +118 -4
  3. data/Gemfile.lock +72 -69
  4. data/README.md +5 -2
  5. data/lib/generators/stimulus_reflex/config_generator.rb +14 -0
  6. data/lib/generators/{stimulus_reflex_generator.rb → stimulus_reflex/stimulus_reflex_generator.rb} +0 -0
  7. data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/%file_name%_controller.js.tt +89 -0
  8. data/lib/generators/{templates → stimulus_reflex/templates}/app/javascript/controllers/application_controller.js.tt +11 -8
  9. data/lib/generators/{templates → stimulus_reflex/templates}/app/reflexes/%file_name%_reflex.rb.tt +0 -0
  10. data/lib/generators/{templates → stimulus_reflex/templates}/app/reflexes/application_reflex.rb.tt +0 -0
  11. data/lib/generators/stimulus_reflex/templates/config/initializers/stimulus_reflex.rb +9 -0
  12. data/lib/stimulus_reflex.rb +5 -2
  13. data/lib/stimulus_reflex/broadcasters/broadcaster.rb +4 -7
  14. data/lib/stimulus_reflex/broadcasters/page_broadcaster.rb +2 -3
  15. data/lib/stimulus_reflex/broadcasters/selector_broadcaster.rb +2 -5
  16. data/lib/stimulus_reflex/configuration.rb +24 -0
  17. data/lib/stimulus_reflex/element.rb +8 -0
  18. data/lib/stimulus_reflex/reflex.rb +21 -18
  19. data/lib/stimulus_reflex/sanity_checker.rb +98 -0
  20. data/lib/stimulus_reflex/version.rb +1 -1
  21. data/lib/tasks/stimulus_reflex/install.rake +23 -8
  22. data/package.json +63 -0
  23. data/stimulus_reflex.gemspec +2 -1
  24. data/tags +23 -1
  25. data/test/generators/stimulus_reflex_generator_test.rb +3 -2
  26. data/yarn.lock +6261 -0
  27. metadata +30 -11
  28. data/lib/generators/templates/app/javascript/controllers/%file_name%_controller.js.tt +0 -57
  29. data/lib/stimulus_reflex/channel.rb +0 -99
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7573abb6ad8e3dbf3a7512084be5947c17fcb3ce55fe37b75372702f6372aa45
4
- data.tar.gz: 14b658def13f3052406398c6607bef62eded64f048ca1e69a053902e11b9ab4d
3
+ metadata.gz: 81b721f2742cc09bd39632481e120723205409806d86a0e98e99954fc10b4974
4
+ data.tar.gz: ca698e3f7b6f3c2fe740429313b166605ad3bab37a74dae4b4fadc4f7e983a21
5
5
  SHA512:
6
- metadata.gz: 02bff2943495c27165b4609f877904496f6b5d488e17b08f9e4e1aea5c53f5be1b8c8411ac8d07391704ceac08b1c7a59e44c216221735cabccbbfc6d56ee0f2
7
- data.tar.gz: ee4bcdb5885070e1cb8b5f90964c4cde12b3c0a1125bb1556ecf21857247da21344e4f86655586b90742a8b76ef594aecbe3150ea06c82bd5ec5fc0509feecb7
6
+ metadata.gz: 88c0a588d1e9e538bf53ad2a40cfcd504d4715ee9cef23c0aaf8a41909c8cd28243030e02ea9b9daf9c4dc56874e1c7f34decf082e21ea18195cf9523c830dc6
7
+ data.tar.gz: c021b8e46203b36abb2386ad50f999bd05c396e0bec0ba943a667ceccc213ea24d6f3ac310c0eff922c518165b3879dcbd3ddae320c78b78821529514ee5d021
@@ -2,7 +2,121 @@
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.3.0.pre2...HEAD)
5
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.3.0...HEAD)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Move StimulusReflex::Channel to app/ and allow for a configurable parent channel [\#346](https://github.com/hopsoft/stimulus_reflex/pull/346) ([leastbad](https://github.com/leastbad))
10
+ - tab isolation mode v2 [\#335](https://github.com/hopsoft/stimulus_reflex/pull/335) ([leastbad](https://github.com/leastbad))
11
+ - Delegate flash to the request [\#334](https://github.com/hopsoft/stimulus_reflex/pull/334) ([hopsoft](https://github.com/hopsoft))
12
+ - Opt-in form serialization & params overriding [\#325](https://github.com/hopsoft/stimulus_reflex/pull/325) ([s-s](https://github.com/s-s))
13
+ - Exit on failed sanity check, provide config to skip exit [\#318](https://github.com/hopsoft/stimulus_reflex/pull/318) ([RolandStuder](https://github.com/RolandStuder))
14
+
15
+ **Fixed bugs:**
16
+
17
+ - Console exception when reflex updates a page that didn't trigger the update [\#336](https://github.com/hopsoft/stimulus_reflex/issues/336)
18
+ - AlpineJS components not reinitalised after reflex [\#329](https://github.com/hopsoft/stimulus_reflex/issues/329)
19
+ - Encoding changes from UTF-8 to ASCII-8BIT [\#202](https://github.com/hopsoft/stimulus_reflex/issues/202)
20
+
21
+ **Closed issues:**
22
+
23
+ - ActionController::RoutingError with Rails 6 Engines [\#342](https://github.com/hopsoft/stimulus_reflex/issues/342)
24
+ - Wrong input name parsing [\#321](https://github.com/hopsoft/stimulus_reflex/issues/321)
25
+ - Stimulus' controllers are not reconnecting after reflex, why? [\#314](https://github.com/hopsoft/stimulus_reflex/issues/314)
26
+ - Rendering issue [\#289](https://github.com/hopsoft/stimulus_reflex/issues/289)
27
+ - Documentation Request for a Rails 6.x app with 5.2 defaults [\#265](https://github.com/hopsoft/stimulus_reflex/issues/265)
28
+
29
+ **Merged pull requests:**
30
+
31
+ - \[docs\] StimulusReflex.debug= on left hand side [\#348](https://github.com/hopsoft/stimulus_reflex/pull/348) ([drnic](https://github.com/drnic))
32
+ - Fix page morphs inside Rails engines [\#344](https://github.com/hopsoft/stimulus_reflex/pull/344) ([leastbad](https://github.com/leastbad))
33
+ - Use Webpacker folder if available [\#343](https://github.com/hopsoft/stimulus_reflex/pull/343) ([coorasse](https://github.com/coorasse))
34
+ - feat: create a more robust package.json [\#340](https://github.com/hopsoft/stimulus_reflex/pull/340) ([ParamagicDev](https://github.com/ParamagicDev))
35
+ - Make StimulusReflex configurable and add an initializer [\#339](https://github.com/hopsoft/stimulus_reflex/pull/339) ([RolandStuder](https://github.com/RolandStuder))
36
+ - Aliases method\_name to action\_name [\#338](https://github.com/hopsoft/stimulus_reflex/pull/338) ([obie](https://github.com/obie))
37
+ - remove isolate concept and make behavior default [\#332](https://github.com/hopsoft/stimulus_reflex/pull/332) ([leastbad](https://github.com/leastbad))
38
+ - add signed/unsigned accessors to element [\#330](https://github.com/hopsoft/stimulus_reflex/pull/330) ([joshleblanc](https://github.com/joshleblanc))
39
+ - merge environment into ApplicationController and descendants [\#328](https://github.com/hopsoft/stimulus_reflex/pull/328) ([leastbad](https://github.com/leastbad))
40
+ - Move form-data merge logic to the server-side [\#327](https://github.com/hopsoft/stimulus_reflex/pull/327) ([marcoroth](https://github.com/marcoroth))
41
+ - fix for PR\#317 which was preventing server messages [\#326](https://github.com/hopsoft/stimulus_reflex/pull/326) ([leastbad](https://github.com/leastbad))
42
+ - introduce tab isolation mode [\#324](https://github.com/hopsoft/stimulus_reflex/pull/324) ([leastbad](https://github.com/leastbad))
43
+ - Force request encodings to be UTF-8 instead of ASCII-8BIT after a reflex [\#320](https://github.com/hopsoft/stimulus_reflex/pull/320) ([marcoroth](https://github.com/marcoroth))
44
+ - Append short section about resetting a form [\#319](https://github.com/hopsoft/stimulus_reflex/pull/319) ([julianrubisch](https://github.com/julianrubisch))
45
+ - lifecycle refactor: introduce new finalize stage, global reflexes dictionary [\#317](https://github.com/hopsoft/stimulus_reflex/pull/317) ([leastbad](https://github.com/leastbad))
46
+ - Update events.md [\#316](https://github.com/hopsoft/stimulus_reflex/pull/316) ([gahia](https://github.com/gahia))
47
+ - Proposal: Reduce bundle size and add a bundler for Stimulus Reflex javascript [\#315](https://github.com/hopsoft/stimulus_reflex/pull/315) ([ParamagicDev](https://github.com/ParamagicDev))
48
+
49
+ ## [v3.3.0](https://github.com/hopsoft/stimulus_reflex/tree/v3.3.0) (2020-09-22)
50
+
51
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.3.0.pre6...v3.3.0)
52
+
53
+ ## [v3.3.0.pre6](https://github.com/hopsoft/stimulus_reflex/tree/v3.3.0.pre6) (2020-09-20)
54
+
55
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.3.0.pre5...v3.3.0.pre6)
56
+
57
+ **Implemented enhancements:**
58
+
59
+ - Support for token-based authentication [\#243](https://github.com/hopsoft/stimulus_reflex/pull/243) ([leastbad](https://github.com/leastbad))
60
+
61
+ **Closed issues:**
62
+
63
+ - Authorization [\#292](https://github.com/hopsoft/stimulus_reflex/issues/292)
64
+ - Params incorrect for form submitted for nested resource [\#290](https://github.com/hopsoft/stimulus_reflex/issues/290)
65
+ - Use set I18n.locale in Reflexes with Selector Morphs [\#280](https://github.com/hopsoft/stimulus_reflex/issues/280)
66
+
67
+ **Merged pull requests:**
68
+
69
+ - fixes and tweaks to client logging subsystem [\#313](https://github.com/hopsoft/stimulus_reflex/pull/313) ([leastbad](https://github.com/leastbad))
70
+ - add ready event after setupDeclarativeReflexes [\#312](https://github.com/hopsoft/stimulus_reflex/pull/312) ([leastbad](https://github.com/leastbad))
71
+ - Refactor sanity checks on boot [\#311](https://github.com/hopsoft/stimulus_reflex/pull/311) ([excid3](https://github.com/excid3))
72
+
73
+ ## [v3.3.0.pre5](https://github.com/hopsoft/stimulus_reflex/tree/v3.3.0.pre5) (2020-09-18)
74
+
75
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.3.0.pre4...v3.3.0.pre5)
76
+
77
+ **Implemented enhancements:**
78
+
79
+ - Fail loudly if there's a version mismatch between the gem and the npm package. [\#294](https://github.com/hopsoft/stimulus_reflex/issues/294)
80
+
81
+ **Closed issues:**
82
+
83
+ - IE11 Support: "crypto" is undefined [\#308](https://github.com/hopsoft/stimulus_reflex/issues/308)
84
+ - Using `morph` gives error on missing Warden::Manager midddleware? [\#304](https://github.com/hopsoft/stimulus_reflex/issues/304)
85
+ - Update client controller template comments [\#298](https://github.com/hopsoft/stimulus_reflex/issues/298)
86
+
87
+ **Merged pull requests:**
88
+
89
+ - Support IE11 msCrypto \(\#308\) [\#310](https://github.com/hopsoft/stimulus_reflex/pull/310) ([chooselife22](https://github.com/chooselife22))
90
+ - Print warning and exit if caching is disabled or npm/gem versions are mismatched [\#309](https://github.com/hopsoft/stimulus_reflex/pull/309) ([excid3](https://github.com/excid3))
91
+ - ActionCable connectivity events [\#307](https://github.com/hopsoft/stimulus_reflex/pull/307) ([leastbad](https://github.com/leastbad))
92
+ - Copyedits [\#306](https://github.com/hopsoft/stimulus_reflex/pull/306) ([CodingItWrong](https://github.com/CodingItWrong))
93
+ - add redis to cable.yml in development mode [\#305](https://github.com/hopsoft/stimulus_reflex/pull/305) ([leastbad](https://github.com/leastbad))
94
+ - Update morph-modes.md [\#302](https://github.com/hopsoft/stimulus_reflex/pull/302) ([scottbarrow](https://github.com/scottbarrow))
95
+ - Enhance controller templates docs [\#300](https://github.com/hopsoft/stimulus_reflex/pull/300) ([pinzonjulian](https://github.com/pinzonjulian))
96
+ - Avoid mismatching client and server versions [\#297](https://github.com/hopsoft/stimulus_reflex/pull/297) ([piotrwodz](https://github.com/piotrwodz))
97
+
98
+ ## [v3.3.0.pre4](https://github.com/hopsoft/stimulus_reflex/tree/v3.3.0.pre4) (2020-09-13)
99
+
100
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.3.0.pre3...v3.3.0.pre4)
101
+
102
+ **Fixed bugs:**
103
+
104
+ - Lifecycle callbacks do not work [\#281](https://github.com/hopsoft/stimulus_reflex/issues/281)
105
+ - Fix timing issues with post-Reflex lifecycle callbacks [\#299](https://github.com/hopsoft/stimulus_reflex/pull/299) ([leastbad](https://github.com/leastbad))
106
+
107
+ **Closed issues:**
108
+
109
+ - self-referential data-reflex-root [\#301](https://github.com/hopsoft/stimulus_reflex/issues/301)
110
+ - data-reflex-permanent not working when using slim templates [\#295](https://github.com/hopsoft/stimulus_reflex/issues/295)
111
+ - undefined method `rescue\_with\_handler' whit reflex action such as "click-\>…" or "change-\>…" [\#287](https://github.com/hopsoft/stimulus_reflex/issues/287)
112
+
113
+ **Merged pull requests:**
114
+
115
+ - Fixed typo in sample code. [\#296](https://github.com/hopsoft/stimulus_reflex/pull/296) ([jclarke](https://github.com/jclarke))
116
+
117
+ ## [v3.3.0.pre3](https://github.com/hopsoft/stimulus_reflex/tree/v3.3.0.pre3) (2020-08-31)
118
+
119
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.3.0.pre2...v3.3.0.pre3)
6
120
 
7
121
  **Fixed bugs:**
8
122
 
@@ -177,7 +291,7 @@
177
291
  - Loosen Rails requirement to 5.2 with instructions [\#205](https://github.com/hopsoft/stimulus_reflex/pull/205) ([jasoncharnes](https://github.com/jasoncharnes))
178
292
  - Fix undefined is not an object for Object.keys in log.js [\#201](https://github.com/hopsoft/stimulus_reflex/pull/201) ([marcoroth](https://github.com/marcoroth))
179
293
  - Small typo/grammar fix in quickstart doc. [\#198](https://github.com/hopsoft/stimulus_reflex/pull/198) ([acoffman](https://github.com/acoffman))
180
- - Add halted lifecycle event [\#193](https://github.com/hopsoft/stimulus_reflex/pull/193) ([seb1441](https://github.com/seb1441))
294
+ - Add halted lifecycle event [\#193](https://github.com/hopsoft/stimulus_reflex/pull/193) ([websebdev](https://github.com/websebdev))
181
295
  - 147 extract multiple checkbox values [\#175](https://github.com/hopsoft/stimulus_reflex/pull/175) ([julianrubisch](https://github.com/julianrubisch))
182
296
 
183
297
  ## [v3.2.1](https://github.com/hopsoft/stimulus_reflex/tree/v3.2.1) (2020-05-09)
@@ -216,11 +330,12 @@
216
330
  - Replace uuid4 dependency with function in repo [\#181](https://github.com/hopsoft/stimulus_reflex/pull/181) ([jonathan-s](https://github.com/jonathan-s))
217
331
  - Allow channel exceptions to be rescuable [\#180](https://github.com/hopsoft/stimulus_reflex/pull/180) ([dark-panda](https://github.com/dark-panda))
218
332
  - add console log messages for every reflex call [\#163](https://github.com/hopsoft/stimulus_reflex/pull/163) ([marcoroth](https://github.com/marcoroth))
219
- - add reflex callbacks [\#160](https://github.com/hopsoft/stimulus_reflex/pull/160) ([seb1441](https://github.com/seb1441))
333
+ - add reflex callbacks [\#160](https://github.com/hopsoft/stimulus_reflex/pull/160) ([websebdev](https://github.com/websebdev))
220
334
 
221
335
  **Fixed bugs:**
222
336
 
223
337
  - Pluralize the generated class name, so that will match with the file name [\#178](https://github.com/hopsoft/stimulus_reflex/pull/178) ([darkrubyist](https://github.com/darkrubyist))
338
+ - Remove unneeded registerConsumer logic [\#158](https://github.com/hopsoft/stimulus_reflex/pull/158) ([hopsoft](https://github.com/hopsoft))
224
339
 
225
340
  **Closed issues:**
226
341
 
@@ -274,7 +389,6 @@
274
389
  **Fixed bugs:**
275
390
 
276
391
  - Unable to register the ActionCable Consumer [\#156](https://github.com/hopsoft/stimulus_reflex/issues/156)
277
- - Remove unneeded registerConsumer logic [\#158](https://github.com/hopsoft/stimulus_reflex/pull/158) ([hopsoft](https://github.com/hopsoft))
278
392
 
279
393
  **Closed issues:**
280
394
 
@@ -1,65 +1,66 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stimulus_reflex (3.3.0.pre3)
5
- cable_ready (>= 4.1.2)
4
+ stimulus_reflex (3.4.0.pre0)
5
+ cable_ready (>= 4.3.0)
6
6
  nokogiri
7
7
  rack
8
8
  rails (>= 5.2)
9
+ redis
9
10
 
10
11
  GEM
11
12
  remote: https://rubygems.org/
12
13
  specs:
13
- actioncable (6.0.3.2)
14
- actionpack (= 6.0.3.2)
14
+ actioncable (6.0.3.4)
15
+ actionpack (= 6.0.3.4)
15
16
  nio4r (~> 2.0)
16
17
  websocket-driver (>= 0.6.1)
17
- actionmailbox (6.0.3.2)
18
- actionpack (= 6.0.3.2)
19
- activejob (= 6.0.3.2)
20
- activerecord (= 6.0.3.2)
21
- activestorage (= 6.0.3.2)
22
- activesupport (= 6.0.3.2)
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)
23
24
  mail (>= 2.7.1)
24
- actionmailer (6.0.3.2)
25
- actionpack (= 6.0.3.2)
26
- actionview (= 6.0.3.2)
27
- activejob (= 6.0.3.2)
25
+ actionmailer (6.0.3.4)
26
+ actionpack (= 6.0.3.4)
27
+ actionview (= 6.0.3.4)
28
+ activejob (= 6.0.3.4)
28
29
  mail (~> 2.5, >= 2.5.4)
29
30
  rails-dom-testing (~> 2.0)
30
- actionpack (6.0.3.2)
31
- actionview (= 6.0.3.2)
32
- activesupport (= 6.0.3.2)
31
+ actionpack (6.0.3.4)
32
+ actionview (= 6.0.3.4)
33
+ activesupport (= 6.0.3.4)
33
34
  rack (~> 2.0, >= 2.0.8)
34
35
  rack-test (>= 0.6.3)
35
36
  rails-dom-testing (~> 2.0)
36
37
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
37
- actiontext (6.0.3.2)
38
- actionpack (= 6.0.3.2)
39
- activerecord (= 6.0.3.2)
40
- activestorage (= 6.0.3.2)
41
- activesupport (= 6.0.3.2)
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)
42
43
  nokogiri (>= 1.8.5)
43
- actionview (6.0.3.2)
44
- activesupport (= 6.0.3.2)
44
+ actionview (6.0.3.4)
45
+ activesupport (= 6.0.3.4)
45
46
  builder (~> 3.1)
46
47
  erubi (~> 1.4)
47
48
  rails-dom-testing (~> 2.0)
48
49
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
49
- activejob (6.0.3.2)
50
- activesupport (= 6.0.3.2)
50
+ activejob (6.0.3.4)
51
+ activesupport (= 6.0.3.4)
51
52
  globalid (>= 0.3.6)
52
- activemodel (6.0.3.2)
53
- activesupport (= 6.0.3.2)
54
- activerecord (6.0.3.2)
55
- activemodel (= 6.0.3.2)
56
- activesupport (= 6.0.3.2)
57
- activestorage (6.0.3.2)
58
- actionpack (= 6.0.3.2)
59
- activejob (= 6.0.3.2)
60
- activerecord (= 6.0.3.2)
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)
61
62
  marcel (~> 0.3.1)
62
- activesupport (6.0.3.2)
63
+ activesupport (6.0.3.4)
63
64
  concurrent-ruby (~> 1.0, >= 1.0.2)
64
65
  i18n (>= 0.7, < 2)
65
66
  minitest (~> 5.1)
@@ -88,12 +89,12 @@ GEM
88
89
  mimemagic (0.3.5)
89
90
  mini_mime (1.0.2)
90
91
  mini_portile2 (2.4.0)
91
- minitest (5.14.1)
92
- nio4r (2.5.2)
92
+ minitest (5.14.2)
93
+ nio4r (2.5.4)
93
94
  nokogiri (1.10.10)
94
95
  mini_portile2 (~> 2.4.0)
95
96
  parallel (1.19.2)
96
- parser (2.7.1.4)
97
+ parser (2.7.2.0)
97
98
  ast (~> 2.4.1)
98
99
  pry (0.12.2)
99
100
  coderay (~> 1.1.0)
@@ -103,60 +104,62 @@ GEM
103
104
  rack (2.2.3)
104
105
  rack-test (1.1.0)
105
106
  rack (>= 1.0, < 3)
106
- rails (6.0.3.2)
107
- actioncable (= 6.0.3.2)
108
- actionmailbox (= 6.0.3.2)
109
- actionmailer (= 6.0.3.2)
110
- actionpack (= 6.0.3.2)
111
- actiontext (= 6.0.3.2)
112
- actionview (= 6.0.3.2)
113
- activejob (= 6.0.3.2)
114
- activemodel (= 6.0.3.2)
115
- activerecord (= 6.0.3.2)
116
- activestorage (= 6.0.3.2)
117
- activesupport (= 6.0.3.2)
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)
118
119
  bundler (>= 1.3.0)
119
- railties (= 6.0.3.2)
120
+ railties (= 6.0.3.4)
120
121
  sprockets-rails (>= 2.0.0)
121
122
  rails-dom-testing (2.0.3)
122
123
  activesupport (>= 4.2.0)
123
124
  nokogiri (>= 1.6)
124
125
  rails-html-sanitizer (1.3.0)
125
126
  loofah (~> 2.3)
126
- railties (6.0.3.2)
127
- actionpack (= 6.0.3.2)
128
- activesupport (= 6.0.3.2)
127
+ railties (6.0.3.4)
128
+ actionpack (= 6.0.3.4)
129
+ activesupport (= 6.0.3.4)
129
130
  method_source
130
131
  rake (>= 0.8.7)
131
132
  thor (>= 0.20.3, < 2.0)
132
133
  rainbow (3.0.0)
133
134
  rake (13.0.1)
134
- regexp_parser (1.7.1)
135
+ redis (4.2.2)
136
+ regexp_parser (1.8.2)
135
137
  rexml (3.2.4)
136
- rubocop (0.89.1)
138
+ rubocop (1.0.0)
137
139
  parallel (~> 1.10)
138
- parser (>= 2.7.1.1)
140
+ parser (>= 2.7.1.5)
139
141
  rainbow (>= 2.2.2, < 4.0)
140
- regexp_parser (>= 1.7)
142
+ regexp_parser (>= 1.8)
141
143
  rexml
142
- rubocop-ast (>= 0.3.0, < 1.0)
144
+ rubocop-ast (>= 0.6.0)
143
145
  ruby-progressbar (~> 1.7)
144
146
  unicode-display_width (>= 1.4.0, < 2.0)
145
- rubocop-ast (0.3.0)
146
- parser (>= 2.7.1.4)
147
- rubocop-performance (1.7.1)
148
- rubocop (>= 0.82.0)
147
+ rubocop-ast (1.1.0)
148
+ parser (>= 2.7.1.5)
149
+ rubocop-performance (1.8.1)
150
+ rubocop (>= 0.87.0)
151
+ rubocop-ast (>= 0.4.0)
149
152
  ruby-progressbar (1.10.1)
150
153
  sprockets (4.0.2)
151
154
  concurrent-ruby (~> 1.0)
152
155
  rack (> 1, < 3)
153
- sprockets-rails (3.2.1)
156
+ sprockets-rails (3.2.2)
154
157
  actionpack (>= 4.0)
155
158
  activesupport (>= 4.0)
156
159
  sprockets (>= 3.0.0)
157
- standard (0.5.2)
158
- rubocop (~> 0.89.1)
159
- rubocop-performance (~> 1.7.1)
160
+ standard (0.8.1)
161
+ rubocop (= 1.0.0)
162
+ rubocop-performance (= 1.8.1)
160
163
  standardrb (1.0.0)
161
164
  standard
162
165
  thor (1.0.1)
@@ -167,7 +170,7 @@ GEM
167
170
  websocket-driver (0.7.3)
168
171
  websocket-extensions (>= 0.1.0)
169
172
  websocket-extensions (0.1.5)
170
- zeitwerk (2.4.0)
173
+ zeitwerk (2.4.1)
171
174
 
172
175
  PLATFORMS
173
176
  ruby
data/README.md CHANGED
@@ -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-1098-brightgreen.svg?style=flat" />
14
+ <img alt="Lines of Code" src="https://img.shields.io/badge/lines_of_code-1322-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" />
@@ -27,6 +27,9 @@
27
27
  <img alt="JavaScript Code Style" src="https://img.shields.io/badge/JavaScript_Code_Style-prettier_standard-ff69b4.svg" />
28
28
  </a>
29
29
  <br />
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
+ <img alt="Code Quality" src="https://app.codacy.com/project/badge/Grade/d1d72a7060f5467b8696884351cf477f"/>
32
+ </a>
30
33
  <a href="https://codeclimate.com/github/hopsoft/stimulus_reflex/maintainability" target="_blank">
31
34
  <img alt="Maintainability" src="https://api.codeclimate.com/v1/badges/2b24fdbd1ae37a24bedb/maintainability" />
32
35
  </a>
@@ -74,7 +77,7 @@ This project strives to live up to the vision outlined in [The Rails Doctrine](h
74
77
 
75
78
  ## 👩‍👩‍👧 Discord Community
76
79
 
77
- Please join over 350 of us on [Discord](https://discord.gg/XveN625) for support getting started, as well as active discussions around Rails, StimulusJS and CableReady.
80
+ Please join over 600 of us on [Discord](https://discord.gg/XveN625) for support getting started, as well as active discussions around Rails, StimulusJS and CableReady.
78
81
 
79
82
  ![](https://img.shields.io/discord/629472241427415060)
80
83
 
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails/generators"
4
+
5
+ module StimulusReflex
6
+ class ConfigGenerator < Rails::Generators::Base
7
+ desc "Creates an StimulusReflex configuration file in config/initializers"
8
+ source_root File.expand_path("templates", __dir__)
9
+
10
+ def copy_config_file
11
+ copy_file "config/initializers/stimulus_reflex.rb"
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,89 @@
1
+ import ApplicationController from './application_controller'
2
+
3
+ /* This is the custom StimulusReflex controller for the <%= class_name %> Reflex.
4
+ * Learn more at: https://docs.stimulusreflex.com
5
+ */
6
+ export default class extends ApplicationController {
7
+ /*
8
+ * Regular Stimulus lifecycle methods
9
+ * Learn more at: https://stimulusjs.org/reference/lifecycle-callbacks
10
+ *
11
+ * If you intend to use this controller as a regular stimulus controller as well,
12
+ * make sure any Stimulus lifecycle methods overridden in ApplicationController call super.
13
+ *
14
+ * Important:
15
+ * By default, StimulusReflex overrides the -connect- method so make sure you
16
+ * call super if you intend to do anything else when this controller connects.
17
+ */
18
+
19
+ connect () {
20
+ super.connect()
21
+ // add your code here, if applicable
22
+ }
23
+
24
+ /* Reflex specific lifecycle methods.
25
+ *
26
+ * For every method defined in your Reflex class, a matching set of lifecycle methods become available
27
+ * in this javascript controller. These are optional, so feel free to delete these stubs if you don't
28
+ * need them.
29
+ *
30
+ * Important:
31
+ * Make sure to add data-controller="<%= class_name.underscore.dasherize %>" to your markup alongside
32
+ * data-reflex="<%= class_name %>#dance" for the lifecycle methods to fire properly.
33
+ *
34
+ * Example:
35
+ *
36
+ * <a href="#" data-reflex="click-><%= class_name %>#dance" data-controller="<%= class_name.underscore.dasherize %>">Dance!</a>
37
+ *
38
+ * Arguments:
39
+ *
40
+ * element - the element that triggered the reflex
41
+ * may be different than the Stimulus controller's this.element
42
+ *
43
+ * reflex - the name of the reflex e.g. "<%= class_name %>#dance"
44
+ *
45
+ * error/noop - the error message (for reflexError), otherwise null
46
+ *
47
+ * reflexId - a UUID4 or developer-provided unique identifier for each Reflex
48
+ */
49
+
50
+ <% if actions.empty? -%>
51
+ // Assuming you create a "<%= class_name %>#dance" action in your Reflex class
52
+ // you'll be able to use the following lifecycle methods:
53
+
54
+ // beforeDance(element, reflex, noop, reflexId) {
55
+ // element.innerText = 'Putting dance shoes on...'
56
+ // }
57
+
58
+ // danceSuccess(element, reflex, noop, reflexId) {
59
+ // element.innerText = 'Danced like no one was watching! Was someone watching?'
60
+ // }
61
+
62
+ // danceError(element, reflex, error, reflexId) {
63
+ // console.error('danceError', error);
64
+ // element.innerText = "Couldn't dance!"
65
+ // }
66
+ <% end -%>
67
+ <% actions.each do |action| -%>
68
+ // <%= "before_#{action}".camelize(:lower) %>(element, reflex, noop, reflexId) {
69
+ // console.log("before <%= action %>", element, reflex, reflexId)
70
+ // }
71
+
72
+ // <%= "#{action}_success".camelize(:lower) %>(element, reflex, noop, reflexId) {
73
+ // console.log("<%= action %> success", element, reflex, reflexId)
74
+ // }
75
+
76
+ // <%= "#{action}_error".camelize(:lower) %>(element, reflex, error, reflexId) {
77
+ // console.error("<%= action %> error", element, reflex, error, reflexId)
78
+ // }
79
+
80
+ // <%= "#{action}_halted".camelize(:lower) %>(element, reflex, noop, reflexId) {
81
+ // console.warn("<%= action %> halted", element, reflex, reflexId)
82
+ // }
83
+
84
+ // <%= "after_#{action}".camelize(:lower) %>(element, reflex, noop, reflexId) {
85
+ // console.log("after <%= action %>", element, reflex, reflexId)
86
+ // }
87
+ <%= "\n" unless action == actions.last -%>
88
+ <% end -%>
89
+ }