stimulus_reflex 3.3.0.pre5 → 3.4.0.pre2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +93 -6
  3. data/Gemfile.lock +67 -66
  4. data/README.md +5 -2
  5. data/{lib → app/channels}/stimulus_reflex/channel.rb +17 -7
  6. data/lib/generators/stimulus_reflex/config_generator.rb +14 -0
  7. data/lib/generators/{stimulus_reflex_generator.rb → stimulus_reflex/stimulus_reflex_generator.rb} +0 -0
  8. data/lib/generators/{templates → stimulus_reflex/templates}/app/javascript/controllers/%file_name%_controller.js.tt +0 -0
  9. data/lib/generators/{templates → stimulus_reflex/templates}/app/javascript/controllers/application_controller.js.tt +0 -0
  10. data/lib/generators/{templates → stimulus_reflex/templates}/app/reflexes/%file_name%_reflex.rb.tt +0 -0
  11. data/lib/generators/{templates → stimulus_reflex/templates}/app/reflexes/application_reflex.rb.tt +0 -0
  12. data/lib/generators/stimulus_reflex/templates/config/initializers/stimulus_reflex.rb +9 -0
  13. data/lib/stimulus_reflex.rb +4 -64
  14. data/lib/stimulus_reflex/broadcasters/broadcaster.rb +3 -7
  15. data/lib/stimulus_reflex/broadcasters/page_broadcaster.rb +2 -2
  16. data/lib/stimulus_reflex/broadcasters/selector_broadcaster.rb +2 -2
  17. data/lib/stimulus_reflex/configuration.rb +24 -0
  18. data/lib/stimulus_reflex/element.rb +8 -0
  19. data/lib/stimulus_reflex/reflex.rb +21 -18
  20. data/lib/stimulus_reflex/sanity_checker.rb +98 -0
  21. data/lib/stimulus_reflex/version.rb +1 -1
  22. data/lib/tasks/stimulus_reflex/install.rake +12 -8
  23. data/package.json +63 -0
  24. data/stimulus_reflex.gemspec +40 -0
  25. data/tags +98 -0
  26. data/test/generators/stimulus_reflex_generator_test.rb +3 -2
  27. data/test/tmp/app/reflexes/application_reflex.rb +12 -0
  28. data/test/tmp/app/reflexes/user_reflex.rb +33 -0
  29. data/yarn.lock +6261 -0
  30. metadata +39 -27
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc5d928ba770cb4cb0e167431b216953d3d024f60797ceeba8cb1e941c321f2f
4
- data.tar.gz: 21ecfef7c3b45524547905728b8dffe13317f76e07685f1c41e9eb59ad20f1aa
3
+ metadata.gz: 1b151dbe96ba7014f31215a419b430c62dd44887dbd3d5c6cce93f32c738523c
4
+ data.tar.gz: f1279d2c57eaf8be1be8915b00e476be06958ad5a8b57b8f8f996517ad49c68e
5
5
  SHA512:
6
- metadata.gz: d89100f1ae64da55040f3ed0435832f593b67ff78631def4bfbf2a02c6eb577b6803ad9ae84760d123e2b5e85a9e52a1d1923a5949b4c76ccdcb82489671d0e4
7
- data.tar.gz: 7d1c3c338457b2f7c8895726cc381c273aec9c7b65158409dc6e2d7d146cd8d1c51102783dda302e241a207a8c09fd0ebd92b850d96f3bbf0c2e884700bf55e7
6
+ metadata.gz: 53bc87673b0019845548f6f5c41f741154a64ced9314d6799c9725faea5a03d1b2d1e55a6d9f812d96dc7fa72b0a8b89c51bbe9547da29b9680483bf689754c7
7
+ data.tar.gz: b7b5bff6e3d19d9eb1557a55dc2924986fcc125c14b54c25e2737d9513ea2bd22cdcf63282b25139f1081ff097d3a45e5fbeb9c476d291f2d9ee2715cecf7d26
@@ -2,7 +2,94 @@
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.pre4...HEAD)
5
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.4.0.pre1...HEAD)
6
+
7
+ **Closed issues:**
8
+
9
+ - Regression in version 3.4.0-pre1: Cannot find module `cable\_ready` [\#350](https://github.com/hopsoft/stimulus_reflex/issues/350)
10
+
11
+ **Merged pull requests:**
12
+
13
+ - move `cable\_ready` to development dependencies [\#351](https://github.com/hopsoft/stimulus_reflex/pull/351) ([marcoroth](https://github.com/marcoroth))
14
+ - Fix serializeForm initialization [\#349](https://github.com/hopsoft/stimulus_reflex/pull/349) ([marcoroth](https://github.com/marcoroth))
15
+
16
+ ## [v3.4.0.pre1](https://github.com/hopsoft/stimulus_reflex/tree/v3.4.0.pre1) (2020-11-03)
17
+
18
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.4.0.pre0...v3.4.0.pre1)
19
+
20
+ ## [v3.4.0.pre0](https://github.com/hopsoft/stimulus_reflex/tree/v3.4.0.pre0) (2020-11-02)
21
+
22
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.3.0...v3.4.0.pre0)
23
+
24
+ **Implemented enhancements:**
25
+
26
+ - 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))
27
+ - tab isolation mode v2 [\#335](https://github.com/hopsoft/stimulus_reflex/pull/335) ([leastbad](https://github.com/leastbad))
28
+ - Delegate flash to the request [\#334](https://github.com/hopsoft/stimulus_reflex/pull/334) ([hopsoft](https://github.com/hopsoft))
29
+ - Opt-in form serialization & params overriding [\#325](https://github.com/hopsoft/stimulus_reflex/pull/325) ([s-s](https://github.com/s-s))
30
+ - Exit on failed sanity check, provide config to skip exit [\#318](https://github.com/hopsoft/stimulus_reflex/pull/318) ([RolandStuder](https://github.com/RolandStuder))
31
+
32
+ **Fixed bugs:**
33
+
34
+ - Console exception when reflex updates a page that didn't trigger the update [\#336](https://github.com/hopsoft/stimulus_reflex/issues/336)
35
+ - AlpineJS components not reinitalised after reflex [\#329](https://github.com/hopsoft/stimulus_reflex/issues/329)
36
+ - Encoding changes from UTF-8 to ASCII-8BIT [\#202](https://github.com/hopsoft/stimulus_reflex/issues/202)
37
+
38
+ **Closed issues:**
39
+
40
+ - ActionController::RoutingError with Rails 6 Engines [\#342](https://github.com/hopsoft/stimulus_reflex/issues/342)
41
+ - Wrong input name parsing [\#321](https://github.com/hopsoft/stimulus_reflex/issues/321)
42
+ - Stimulus' controllers are not reconnecting after reflex, why? [\#314](https://github.com/hopsoft/stimulus_reflex/issues/314)
43
+ - Rendering issue [\#289](https://github.com/hopsoft/stimulus_reflex/issues/289)
44
+ - Documentation Request for a Rails 6.x app with 5.2 defaults [\#265](https://github.com/hopsoft/stimulus_reflex/issues/265)
45
+
46
+ **Merged pull requests:**
47
+
48
+ - \[docs\] StimulusReflex.debug= on left hand side [\#348](https://github.com/hopsoft/stimulus_reflex/pull/348) ([drnic](https://github.com/drnic))
49
+ - Fix page morphs inside Rails engines [\#344](https://github.com/hopsoft/stimulus_reflex/pull/344) ([leastbad](https://github.com/leastbad))
50
+ - Use Webpacker folder if available [\#343](https://github.com/hopsoft/stimulus_reflex/pull/343) ([coorasse](https://github.com/coorasse))
51
+ - feat: create a more robust package.json [\#340](https://github.com/hopsoft/stimulus_reflex/pull/340) ([ParamagicDev](https://github.com/ParamagicDev))
52
+ - Make StimulusReflex configurable and add an initializer [\#339](https://github.com/hopsoft/stimulus_reflex/pull/339) ([RolandStuder](https://github.com/RolandStuder))
53
+ - Aliases method\_name to action\_name [\#338](https://github.com/hopsoft/stimulus_reflex/pull/338) ([obie](https://github.com/obie))
54
+ - remove isolate concept and make behavior default [\#332](https://github.com/hopsoft/stimulus_reflex/pull/332) ([leastbad](https://github.com/leastbad))
55
+ - add signed/unsigned accessors to element [\#330](https://github.com/hopsoft/stimulus_reflex/pull/330) ([joshleblanc](https://github.com/joshleblanc))
56
+ - merge environment into ApplicationController and descendants [\#328](https://github.com/hopsoft/stimulus_reflex/pull/328) ([leastbad](https://github.com/leastbad))
57
+ - Move form-data merge logic to the server-side [\#327](https://github.com/hopsoft/stimulus_reflex/pull/327) ([marcoroth](https://github.com/marcoroth))
58
+ - fix for PR\#317 which was preventing server messages [\#326](https://github.com/hopsoft/stimulus_reflex/pull/326) ([leastbad](https://github.com/leastbad))
59
+ - introduce tab isolation mode [\#324](https://github.com/hopsoft/stimulus_reflex/pull/324) ([leastbad](https://github.com/leastbad))
60
+ - 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))
61
+ - Append short section about resetting a form [\#319](https://github.com/hopsoft/stimulus_reflex/pull/319) ([julianrubisch](https://github.com/julianrubisch))
62
+ - lifecycle refactor: introduce new finalize stage, global reflexes dictionary [\#317](https://github.com/hopsoft/stimulus_reflex/pull/317) ([leastbad](https://github.com/leastbad))
63
+ - Update events.md [\#316](https://github.com/hopsoft/stimulus_reflex/pull/316) ([gahia](https://github.com/gahia))
64
+ - 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))
65
+
66
+ ## [v3.3.0](https://github.com/hopsoft/stimulus_reflex/tree/v3.3.0) (2020-09-22)
67
+
68
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.3.0.pre6...v3.3.0)
69
+
70
+ ## [v3.3.0.pre6](https://github.com/hopsoft/stimulus_reflex/tree/v3.3.0.pre6) (2020-09-20)
71
+
72
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.3.0.pre5...v3.3.0.pre6)
73
+
74
+ **Implemented enhancements:**
75
+
76
+ - Support for token-based authentication [\#243](https://github.com/hopsoft/stimulus_reflex/pull/243) ([leastbad](https://github.com/leastbad))
77
+
78
+ **Closed issues:**
79
+
80
+ - Authorization [\#292](https://github.com/hopsoft/stimulus_reflex/issues/292)
81
+ - Params incorrect for form submitted for nested resource [\#290](https://github.com/hopsoft/stimulus_reflex/issues/290)
82
+ - Use set I18n.locale in Reflexes with Selector Morphs [\#280](https://github.com/hopsoft/stimulus_reflex/issues/280)
83
+
84
+ **Merged pull requests:**
85
+
86
+ - fixes and tweaks to client logging subsystem [\#313](https://github.com/hopsoft/stimulus_reflex/pull/313) ([leastbad](https://github.com/leastbad))
87
+ - add ready event after setupDeclarativeReflexes [\#312](https://github.com/hopsoft/stimulus_reflex/pull/312) ([leastbad](https://github.com/leastbad))
88
+ - Refactor sanity checks on boot [\#311](https://github.com/hopsoft/stimulus_reflex/pull/311) ([excid3](https://github.com/excid3))
89
+
90
+ ## [v3.3.0.pre5](https://github.com/hopsoft/stimulus_reflex/tree/v3.3.0.pre5) (2020-09-18)
91
+
92
+ [Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.3.0.pre4...v3.3.0.pre5)
6
93
 
7
94
  **Implemented enhancements:**
8
95
 
@@ -221,7 +308,7 @@
221
308
  - Loosen Rails requirement to 5.2 with instructions [\#205](https://github.com/hopsoft/stimulus_reflex/pull/205) ([jasoncharnes](https://github.com/jasoncharnes))
222
309
  - 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))
223
310
  - Small typo/grammar fix in quickstart doc. [\#198](https://github.com/hopsoft/stimulus_reflex/pull/198) ([acoffman](https://github.com/acoffman))
224
- - Add halted lifecycle event [\#193](https://github.com/hopsoft/stimulus_reflex/pull/193) ([seb1441](https://github.com/seb1441))
311
+ - Add halted lifecycle event [\#193](https://github.com/hopsoft/stimulus_reflex/pull/193) ([websebdev](https://github.com/websebdev))
225
312
  - 147 extract multiple checkbox values [\#175](https://github.com/hopsoft/stimulus_reflex/pull/175) ([julianrubisch](https://github.com/julianrubisch))
226
313
 
227
314
  ## [v3.2.1](https://github.com/hopsoft/stimulus_reflex/tree/v3.2.1) (2020-05-09)
@@ -260,7 +347,7 @@
260
347
  - Replace uuid4 dependency with function in repo [\#181](https://github.com/hopsoft/stimulus_reflex/pull/181) ([jonathan-s](https://github.com/jonathan-s))
261
348
  - Allow channel exceptions to be rescuable [\#180](https://github.com/hopsoft/stimulus_reflex/pull/180) ([dark-panda](https://github.com/dark-panda))
262
349
  - add console log messages for every reflex call [\#163](https://github.com/hopsoft/stimulus_reflex/pull/163) ([marcoroth](https://github.com/marcoroth))
263
- - add reflex callbacks [\#160](https://github.com/hopsoft/stimulus_reflex/pull/160) ([seb1441](https://github.com/seb1441))
350
+ - add reflex callbacks [\#160](https://github.com/hopsoft/stimulus_reflex/pull/160) ([websebdev](https://github.com/websebdev))
264
351
 
265
352
  **Fixed bugs:**
266
353
 
@@ -486,7 +573,9 @@
486
573
  **Implemented enhancements:**
487
574
 
488
575
  - Custom Stimulus schema breaks Reflex [\#91](https://github.com/hopsoft/stimulus_reflex/issues/91)
576
+ - Add schema support [\#94](https://github.com/hopsoft/stimulus_reflex/pull/94) ([hopsoft](https://github.com/hopsoft))
489
577
  - inherit stimulus schema [\#92](https://github.com/hopsoft/stimulus_reflex/pull/92) ([nickyvanurk](https://github.com/nickyvanurk))
578
+ - Single source of truth [\#76](https://github.com/hopsoft/stimulus_reflex/pull/76) ([leastbad](https://github.com/leastbad))
490
579
 
491
580
  **Fixed bugs:**
492
581
 
@@ -505,7 +594,6 @@
505
594
 
506
595
  **Implemented enhancements:**
507
596
 
508
- - Single source of truth [\#76](https://github.com/hopsoft/stimulus_reflex/pull/76) ([leastbad](https://github.com/leastbad))
509
597
  - Add CodeFund sponsorship [\#75](https://github.com/hopsoft/stimulus_reflex/pull/75) ([coderberry](https://github.com/coderberry))
510
598
 
511
599
  **Fixed bugs:**
@@ -519,11 +607,9 @@
519
607
  **Implemented enhancements:**
520
608
 
521
609
  - Create Rails generators [\#3](https://github.com/hopsoft/stimulus_reflex/issues/3)
522
- - Add schema support [\#94](https://github.com/hopsoft/stimulus_reflex/pull/94) ([hopsoft](https://github.com/hopsoft))
523
610
  - Update installer [\#71](https://github.com/hopsoft/stimulus_reflex/pull/71) ([hopsoft](https://github.com/hopsoft))
524
611
  - Tweak generators [\#69](https://github.com/hopsoft/stimulus_reflex/pull/69) ([hopsoft](https://github.com/hopsoft))
525
612
  - add generators [\#67](https://github.com/hopsoft/stimulus_reflex/pull/67) ([andrewmcodes](https://github.com/andrewmcodes))
526
- - Add reflex name to the lifecycle args [\#62](https://github.com/hopsoft/stimulus_reflex/pull/62) ([hopsoft](https://github.com/hopsoft))
527
613
 
528
614
  **Fixed bugs:**
529
615
 
@@ -552,6 +638,7 @@
552
638
  - Client side call-backs? [\#34](https://github.com/hopsoft/stimulus_reflex/issues/34)
553
639
  - Scoped register\(\)? [\#26](https://github.com/hopsoft/stimulus_reflex/issues/26)
554
640
  - Add guard to verify same URL prior to morph [\#63](https://github.com/hopsoft/stimulus_reflex/pull/63) ([hopsoft](https://github.com/hopsoft))
641
+ - Add reflex name to the lifecycle args [\#62](https://github.com/hopsoft/stimulus_reflex/pull/62) ([hopsoft](https://github.com/hopsoft))
555
642
  - Refactor some helper methods out of main file [\#61](https://github.com/hopsoft/stimulus_reflex/pull/61) ([hopsoft](https://github.com/hopsoft))
556
643
  - Documentation update [\#58](https://github.com/hopsoft/stimulus_reflex/pull/58) ([leastbad](https://github.com/leastbad))
557
644
  - \# Support for data-reflex-permanent [\#57](https://github.com/hopsoft/stimulus_reflex/pull/57) ([hopsoft](https://github.com/hopsoft))
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stimulus_reflex (3.3.0.pre4)
5
- cable_ready (>= 4.1.2)
4
+ stimulus_reflex (3.4.0.pre2)
6
5
  nokogiri
7
6
  rack
8
7
  rails (>= 5.2)
@@ -11,56 +10,56 @@ PATH
11
10
  GEM
12
11
  remote: https://rubygems.org/
13
12
  specs:
14
- actioncable (6.0.3.3)
15
- actionpack (= 6.0.3.3)
13
+ actioncable (6.0.3.4)
14
+ actionpack (= 6.0.3.4)
16
15
  nio4r (~> 2.0)
17
16
  websocket-driver (>= 0.6.1)
18
- actionmailbox (6.0.3.3)
19
- actionpack (= 6.0.3.3)
20
- activejob (= 6.0.3.3)
21
- activerecord (= 6.0.3.3)
22
- activestorage (= 6.0.3.3)
23
- activesupport (= 6.0.3.3)
17
+ actionmailbox (6.0.3.4)
18
+ actionpack (= 6.0.3.4)
19
+ activejob (= 6.0.3.4)
20
+ activerecord (= 6.0.3.4)
21
+ activestorage (= 6.0.3.4)
22
+ activesupport (= 6.0.3.4)
24
23
  mail (>= 2.7.1)
25
- actionmailer (6.0.3.3)
26
- actionpack (= 6.0.3.3)
27
- actionview (= 6.0.3.3)
28
- activejob (= 6.0.3.3)
24
+ actionmailer (6.0.3.4)
25
+ actionpack (= 6.0.3.4)
26
+ actionview (= 6.0.3.4)
27
+ activejob (= 6.0.3.4)
29
28
  mail (~> 2.5, >= 2.5.4)
30
29
  rails-dom-testing (~> 2.0)
31
- actionpack (6.0.3.3)
32
- actionview (= 6.0.3.3)
33
- activesupport (= 6.0.3.3)
30
+ actionpack (6.0.3.4)
31
+ actionview (= 6.0.3.4)
32
+ activesupport (= 6.0.3.4)
34
33
  rack (~> 2.0, >= 2.0.8)
35
34
  rack-test (>= 0.6.3)
36
35
  rails-dom-testing (~> 2.0)
37
36
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
38
- actiontext (6.0.3.3)
39
- actionpack (= 6.0.3.3)
40
- activerecord (= 6.0.3.3)
41
- activestorage (= 6.0.3.3)
42
- activesupport (= 6.0.3.3)
37
+ actiontext (6.0.3.4)
38
+ actionpack (= 6.0.3.4)
39
+ activerecord (= 6.0.3.4)
40
+ activestorage (= 6.0.3.4)
41
+ activesupport (= 6.0.3.4)
43
42
  nokogiri (>= 1.8.5)
44
- actionview (6.0.3.3)
45
- activesupport (= 6.0.3.3)
43
+ actionview (6.0.3.4)
44
+ activesupport (= 6.0.3.4)
46
45
  builder (~> 3.1)
47
46
  erubi (~> 1.4)
48
47
  rails-dom-testing (~> 2.0)
49
48
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
50
- activejob (6.0.3.3)
51
- activesupport (= 6.0.3.3)
49
+ activejob (6.0.3.4)
50
+ activesupport (= 6.0.3.4)
52
51
  globalid (>= 0.3.6)
53
- activemodel (6.0.3.3)
54
- activesupport (= 6.0.3.3)
55
- activerecord (6.0.3.3)
56
- activemodel (= 6.0.3.3)
57
- activesupport (= 6.0.3.3)
58
- activestorage (6.0.3.3)
59
- actionpack (= 6.0.3.3)
60
- activejob (= 6.0.3.3)
61
- activerecord (= 6.0.3.3)
52
+ activemodel (6.0.3.4)
53
+ activesupport (= 6.0.3.4)
54
+ activerecord (6.0.3.4)
55
+ activemodel (= 6.0.3.4)
56
+ activesupport (= 6.0.3.4)
57
+ activestorage (6.0.3.4)
58
+ actionpack (= 6.0.3.4)
59
+ activejob (= 6.0.3.4)
60
+ activerecord (= 6.0.3.4)
62
61
  marcel (~> 0.3.1)
63
- activesupport (6.0.3.3)
62
+ activesupport (6.0.3.4)
64
63
  concurrent-ruby (~> 1.0, >= 1.0.2)
65
64
  i18n (>= 0.7, < 2)
66
65
  minitest (~> 5.1)
@@ -94,7 +93,7 @@ GEM
94
93
  nokogiri (1.10.10)
95
94
  mini_portile2 (~> 2.4.0)
96
95
  parallel (1.19.2)
97
- parser (2.7.1.4)
96
+ parser (2.7.2.0)
98
97
  ast (~> 2.4.1)
99
98
  pry (0.12.2)
100
99
  coderay (~> 1.1.0)
@@ -104,50 +103,51 @@ GEM
104
103
  rack (2.2.3)
105
104
  rack-test (1.1.0)
106
105
  rack (>= 1.0, < 3)
107
- rails (6.0.3.3)
108
- actioncable (= 6.0.3.3)
109
- actionmailbox (= 6.0.3.3)
110
- actionmailer (= 6.0.3.3)
111
- actionpack (= 6.0.3.3)
112
- actiontext (= 6.0.3.3)
113
- actionview (= 6.0.3.3)
114
- activejob (= 6.0.3.3)
115
- activemodel (= 6.0.3.3)
116
- activerecord (= 6.0.3.3)
117
- activestorage (= 6.0.3.3)
118
- activesupport (= 6.0.3.3)
106
+ rails (6.0.3.4)
107
+ actioncable (= 6.0.3.4)
108
+ actionmailbox (= 6.0.3.4)
109
+ actionmailer (= 6.0.3.4)
110
+ actionpack (= 6.0.3.4)
111
+ actiontext (= 6.0.3.4)
112
+ actionview (= 6.0.3.4)
113
+ activejob (= 6.0.3.4)
114
+ activemodel (= 6.0.3.4)
115
+ activerecord (= 6.0.3.4)
116
+ activestorage (= 6.0.3.4)
117
+ activesupport (= 6.0.3.4)
119
118
  bundler (>= 1.3.0)
120
- railties (= 6.0.3.3)
119
+ railties (= 6.0.3.4)
121
120
  sprockets-rails (>= 2.0.0)
122
121
  rails-dom-testing (2.0.3)
123
122
  activesupport (>= 4.2.0)
124
123
  nokogiri (>= 1.6)
125
124
  rails-html-sanitizer (1.3.0)
126
125
  loofah (~> 2.3)
127
- railties (6.0.3.3)
128
- actionpack (= 6.0.3.3)
129
- activesupport (= 6.0.3.3)
126
+ railties (6.0.3.4)
127
+ actionpack (= 6.0.3.4)
128
+ activesupport (= 6.0.3.4)
130
129
  method_source
131
130
  rake (>= 0.8.7)
132
131
  thor (>= 0.20.3, < 2.0)
133
132
  rainbow (3.0.0)
134
133
  rake (13.0.1)
135
134
  redis (4.2.2)
136
- regexp_parser (1.7.1)
135
+ regexp_parser (1.8.2)
137
136
  rexml (3.2.4)
138
- rubocop (0.89.1)
137
+ rubocop (1.0.0)
139
138
  parallel (~> 1.10)
140
- parser (>= 2.7.1.1)
139
+ parser (>= 2.7.1.5)
141
140
  rainbow (>= 2.2.2, < 4.0)
142
- regexp_parser (>= 1.7)
141
+ regexp_parser (>= 1.8)
143
142
  rexml
144
- rubocop-ast (>= 0.3.0, < 1.0)
143
+ rubocop-ast (>= 0.6.0)
145
144
  ruby-progressbar (~> 1.7)
146
145
  unicode-display_width (>= 1.4.0, < 2.0)
147
- rubocop-ast (0.3.0)
148
- parser (>= 2.7.1.4)
149
- rubocop-performance (1.7.1)
150
- rubocop (>= 0.82.0)
146
+ rubocop-ast (1.1.1)
147
+ parser (>= 2.7.1.5)
148
+ rubocop-performance (1.8.1)
149
+ rubocop (>= 0.87.0)
150
+ rubocop-ast (>= 0.4.0)
151
151
  ruby-progressbar (1.10.1)
152
152
  sprockets (4.0.2)
153
153
  concurrent-ruby (~> 1.0)
@@ -156,9 +156,9 @@ GEM
156
156
  actionpack (>= 4.0)
157
157
  activesupport (>= 4.0)
158
158
  sprockets (>= 3.0.0)
159
- standard (0.5.2)
160
- rubocop (~> 0.89.1)
161
- rubocop-performance (~> 1.7.1)
159
+ standard (0.8.1)
160
+ rubocop (= 1.0.0)
161
+ rubocop-performance (= 1.8.1)
162
162
  standardrb (1.0.0)
163
163
  standard
164
164
  thor (1.0.1)
@@ -169,13 +169,14 @@ GEM
169
169
  websocket-driver (0.7.3)
170
170
  websocket-extensions (>= 0.1.0)
171
171
  websocket-extensions (0.1.5)
172
- zeitwerk (2.4.0)
172
+ zeitwerk (2.4.1)
173
173
 
174
174
  PLATFORMS
175
175
  ruby
176
176
 
177
177
  DEPENDENCIES
178
178
  bundler (~> 2.0)
179
+ cable_ready (>= 4.3.0)
179
180
  pry
180
181
  pry-nav
181
182
  rake
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 500 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 700 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
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class StimulusReflex::Channel < ActionCable::Channel::Base
3
+ class StimulusReflex::Channel < StimulusReflex.configuration.parent_channel.constantize
4
4
  def stream_name
5
5
  ids = connection.identifiers.map { |identifier| send(identifier).try(:id) || send(identifier) }
6
6
  [
@@ -10,6 +10,8 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
10
10
  end
11
11
 
12
12
  def subscribed
13
+ super
14
+ fix_environment!
13
15
  stream_from stream_name
14
16
  end
15
17
 
@@ -23,8 +25,9 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
23
25
  reflex_name = reflex_name.end_with?("Reflex") ? reflex_name : "#{reflex_name}Reflex"
24
26
  arguments = (data["args"] || []).map { |arg| object_with_indifferent_access arg }
25
27
  element = StimulusReflex::Element.new(data)
26
- permanent_attribute_name = data["permanent_attribute_name"]
27
- params = data["params"] || {}
28
+ permanent_attribute_name = data["permanentAttributeName"]
29
+ form_data = Rack::Utils.parse_nested_query(data["formData"])
30
+ params = form_data.deep_merge(data["params"] || {})
28
31
 
29
32
  begin
30
33
  begin
@@ -33,10 +36,10 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
33
36
  delegate_call_to_reflex reflex, method_name, arguments
34
37
  rescue => invoke_error
35
38
  message = exception_message_with_backtrace(invoke_error)
36
- body = "StimulusReflex::Channel Failed to invoke #{target}! #{url} #{message}"
39
+ body = "Reflex #{target} failed: #{message} [#{url}]"
37
40
  if reflex
38
41
  reflex.rescue_with_handler(invoke_error)
39
- reflex.broadcast_message subject: "error", body: body, data: data
42
+ reflex.broadcast_message subject: "error", body: body, data: data, error: invoke_error
40
43
  else
41
44
  logger.error "\e[31m#{body}\e[0m"
42
45
  end
@@ -51,7 +54,8 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
51
54
  rescue => render_error
52
55
  reflex.rescue_with_handler(render_error)
53
56
  message = exception_message_with_backtrace(render_error)
54
- reflex.broadcast_message subject: "error", body: "StimulusReflex::Channel Failed to re-render #{url} #{message}", data: data
57
+ body = "Reflex failed to re-render: #{message} [#{url}]"
58
+ reflex.broadcast_message subject: "error", body: body, data: data, error: render_error
55
59
  end
56
60
  end
57
61
  ensure
@@ -94,6 +98,12 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
94
98
  end
95
99
 
96
100
  def exception_message_with_backtrace(exception)
97
- "#{exception} #{exception.backtrace.first}"
101
+ "#{exception}\n#{exception.backtrace.first}"
102
+ end
103
+
104
+ def fix_environment!
105
+ ([ApplicationController] + ApplicationController.descendants).each do |controller|
106
+ controller.renderer.instance_variable_set(:@env, connection.env.merge(controller.renderer.instance_variable_get(:@env)))
107
+ end
98
108
  end
99
109
  end