stimulus_reflex 3.5.0.pre6 → 3.5.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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +2 -1177
  3. data/Gemfile.lock +123 -100
  4. data/README.md +47 -6
  5. data/app/assets/javascripts/stimulus_reflex.js +969 -0
  6. data/app/assets/javascripts/stimulus_reflex.min.js +2 -0
  7. data/app/assets/javascripts/stimulus_reflex.min.js.map +1 -0
  8. data/app/assets/javascripts/stimulus_reflex.umd.js +904 -0
  9. data/app/assets/javascripts/stimulus_reflex.umd.min.js +905 -0
  10. data/app/assets/javascripts/stimulus_reflex.umd.min.js.map +1 -0
  11. data/app/channels/stimulus_reflex/channel.rb +21 -2
  12. data/lib/stimulus_reflex/broadcasters/nothing_broadcaster.rb +1 -0
  13. data/lib/stimulus_reflex/engine.rb +29 -0
  14. data/lib/stimulus_reflex/importmap.rb +4 -0
  15. data/lib/stimulus_reflex/open_struct_fix.rb +29 -0
  16. data/lib/stimulus_reflex/reflex.rb +10 -3
  17. data/lib/stimulus_reflex/reflex_data.rb +8 -0
  18. data/lib/stimulus_reflex/reflex_factory.rb +3 -1
  19. data/lib/stimulus_reflex/utils/logger.rb +2 -0
  20. data/lib/stimulus_reflex/utils/sanity_checker.rb +0 -58
  21. data/lib/stimulus_reflex/version.rb +1 -1
  22. data/lib/stimulus_reflex.rb +2 -6
  23. data/package.json +67 -0
  24. data/rollup.config.js +85 -0
  25. data/stimulus_reflex.gemspec +63 -0
  26. data/test/broadcasters/broadcaster_test_case.rb +1 -1
  27. data/test/broadcasters/nothing_broadcaster_test.rb +3 -1
  28. data/test/broadcasters/page_broadcaster_test.rb +4 -2
  29. data/test/broadcasters/selector_broadcaster_test.rb +12 -6
  30. data/test/callbacks_test.rb +23 -23
  31. data/test/reflex_test.rb +2 -2
  32. data/test/tmp/app/reflexes/application_reflex.rb +3 -10
  33. data/test/tmp/app/reflexes/{demo_reflex.rb → user_reflex.rb} +10 -2
  34. data/web-test-runner.config.mjs +12 -0
  35. data/yarn-error.log +4964 -0
  36. data/yarn.lock +4520 -0
  37. metadata +118 -38
  38. data/lib/generators/USAGE +0 -14
  39. data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/%file_name%_controller.js.tt +0 -101
  40. data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/application_controller.js.tt +0 -60
  41. data/lib/generators/stimulus_reflex/templates/app/reflexes/%file_name%_reflex.rb.tt +0 -41
  42. data/lib/generators/stimulus_reflex/templates/app/reflexes/application_reflex.rb.tt +0 -19
  43. data/lib/tasks/stimulus_reflex/install.rake +0 -116
data/Gemfile.lock CHANGED
@@ -1,187 +1,209 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stimulus_reflex (3.5.0.pre6)
5
- cable_ready (= 5.0.0.pre6)
4
+ stimulus_reflex (3.5.0.pre9)
5
+ actioncable (>= 5.2)
6
+ actionpack (>= 5.2)
7
+ actionview (>= 5.2)
8
+ activesupport (>= 5.2)
9
+ cable_ready (>= 5.0.0.pre9)
6
10
  nokogiri
7
11
  rack
8
- rails (>= 5.2)
12
+ railties (>= 5.2)
9
13
  redis
10
14
 
11
15
  GEM
12
16
  remote: https://rubygems.org/
13
17
  specs:
14
- actioncable (6.1.4.1)
15
- actionpack (= 6.1.4.1)
16
- activesupport (= 6.1.4.1)
18
+ actioncable (7.0.2.3)
19
+ actionpack (= 7.0.2.3)
20
+ activesupport (= 7.0.2.3)
17
21
  nio4r (~> 2.0)
18
22
  websocket-driver (>= 0.6.1)
19
- actionmailbox (6.1.4.1)
20
- actionpack (= 6.1.4.1)
21
- activejob (= 6.1.4.1)
22
- activerecord (= 6.1.4.1)
23
- activestorage (= 6.1.4.1)
24
- activesupport (= 6.1.4.1)
23
+ actionmailbox (7.0.2.3)
24
+ actionpack (= 7.0.2.3)
25
+ activejob (= 7.0.2.3)
26
+ activerecord (= 7.0.2.3)
27
+ activestorage (= 7.0.2.3)
28
+ activesupport (= 7.0.2.3)
25
29
  mail (>= 2.7.1)
26
- actionmailer (6.1.4.1)
27
- actionpack (= 6.1.4.1)
28
- actionview (= 6.1.4.1)
29
- activejob (= 6.1.4.1)
30
- activesupport (= 6.1.4.1)
30
+ net-imap
31
+ net-pop
32
+ net-smtp
33
+ actionmailer (7.0.2.3)
34
+ actionpack (= 7.0.2.3)
35
+ actionview (= 7.0.2.3)
36
+ activejob (= 7.0.2.3)
37
+ activesupport (= 7.0.2.3)
31
38
  mail (~> 2.5, >= 2.5.4)
39
+ net-imap
40
+ net-pop
41
+ net-smtp
32
42
  rails-dom-testing (~> 2.0)
33
- actionpack (6.1.4.1)
34
- actionview (= 6.1.4.1)
35
- activesupport (= 6.1.4.1)
36
- rack (~> 2.0, >= 2.0.9)
43
+ actionpack (7.0.2.3)
44
+ actionview (= 7.0.2.3)
45
+ activesupport (= 7.0.2.3)
46
+ rack (~> 2.0, >= 2.2.0)
37
47
  rack-test (>= 0.6.3)
38
48
  rails-dom-testing (~> 2.0)
39
49
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
40
- actiontext (6.1.4.1)
41
- actionpack (= 6.1.4.1)
42
- activerecord (= 6.1.4.1)
43
- activestorage (= 6.1.4.1)
44
- activesupport (= 6.1.4.1)
50
+ actiontext (7.0.2.3)
51
+ actionpack (= 7.0.2.3)
52
+ activerecord (= 7.0.2.3)
53
+ activestorage (= 7.0.2.3)
54
+ activesupport (= 7.0.2.3)
55
+ globalid (>= 0.6.0)
45
56
  nokogiri (>= 1.8.5)
46
- actionview (6.1.4.1)
47
- activesupport (= 6.1.4.1)
57
+ actionview (7.0.2.3)
58
+ activesupport (= 7.0.2.3)
48
59
  builder (~> 3.1)
49
60
  erubi (~> 1.4)
50
61
  rails-dom-testing (~> 2.0)
51
62
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
52
- activejob (6.1.4.1)
53
- activesupport (= 6.1.4.1)
63
+ activejob (7.0.2.3)
64
+ activesupport (= 7.0.2.3)
54
65
  globalid (>= 0.3.6)
55
- activemodel (6.1.4.1)
56
- activesupport (= 6.1.4.1)
57
- activerecord (6.1.4.1)
58
- activemodel (= 6.1.4.1)
59
- activesupport (= 6.1.4.1)
60
- activestorage (6.1.4.1)
61
- actionpack (= 6.1.4.1)
62
- activejob (= 6.1.4.1)
63
- activerecord (= 6.1.4.1)
64
- activesupport (= 6.1.4.1)
65
- marcel (~> 1.0.0)
66
+ activemodel (7.0.2.3)
67
+ activesupport (= 7.0.2.3)
68
+ activerecord (7.0.2.3)
69
+ activemodel (= 7.0.2.3)
70
+ activesupport (= 7.0.2.3)
71
+ activestorage (7.0.2.3)
72
+ actionpack (= 7.0.2.3)
73
+ activejob (= 7.0.2.3)
74
+ activerecord (= 7.0.2.3)
75
+ activesupport (= 7.0.2.3)
76
+ marcel (~> 1.0)
66
77
  mini_mime (>= 1.1.0)
67
- activesupport (6.1.4.1)
78
+ activesupport (7.0.2.3)
68
79
  concurrent-ruby (~> 1.0, >= 1.0.2)
69
80
  i18n (>= 1.6, < 2)
70
81
  minitest (>= 5.1)
71
82
  tzinfo (~> 2.0)
72
- zeitwerk (~> 2.3)
73
83
  ast (2.4.2)
74
84
  builder (3.2.4)
75
- cable_ready (5.0.0.pre6)
76
- rails (>= 5.2)
85
+ cable_ready (5.0.0.pre9)
86
+ actioncable (>= 5.2)
87
+ actionpack (>= 5.2)
88
+ actionview (>= 5.2)
89
+ activerecord (>= 5.2)
90
+ activesupport (>= 5.2)
91
+ railties (>= 5.2)
77
92
  thread-local (>= 1.1.0)
78
93
  coderay (1.1.3)
79
- concurrent-ruby (1.1.9)
94
+ concurrent-ruby (1.1.10)
80
95
  crass (1.0.6)
96
+ digest (3.1.0)
81
97
  erubi (1.10.0)
82
- globalid (0.5.2)
98
+ globalid (1.0.0)
83
99
  activesupport (>= 5.0)
84
- i18n (1.8.10)
100
+ i18n (1.10.0)
85
101
  concurrent-ruby (~> 1.0)
86
- loofah (2.12.0)
102
+ loofah (2.15.0)
87
103
  crass (~> 1.0.2)
88
104
  nokogiri (>= 1.5.9)
89
105
  mail (2.7.1)
90
106
  mini_mime (>= 0.1.1)
91
107
  marcel (1.0.2)
92
- method_source (0.9.2)
108
+ method_source (1.0.0)
93
109
  mini_mime (1.1.2)
94
- minitest (5.14.4)
110
+ minitest (5.15.0)
95
111
  mocha (1.13.0)
112
+ net-imap (0.2.3)
113
+ digest
114
+ net-protocol
115
+ strscan
116
+ net-pop (0.1.1)
117
+ digest
118
+ net-protocol
119
+ timeout
120
+ net-protocol (0.1.3)
121
+ timeout
122
+ net-smtp (0.3.1)
123
+ digest
124
+ net-protocol
125
+ timeout
96
126
  nio4r (2.5.8)
97
- nokogiri (1.12.5-arm64-darwin)
127
+ nokogiri (1.13.3-x86_64-darwin)
98
128
  racc (~> 1.4)
99
- nokogiri (1.12.5-x86_64-darwin)
129
+ nokogiri (1.13.3-x86_64-linux)
100
130
  racc (~> 1.4)
101
- nokogiri (1.12.5-x86_64-linux)
102
- racc (~> 1.4)
103
- parallel (1.20.1)
131
+ parallel (1.21.0)
104
132
  parser (3.0.2.0)
105
133
  ast (~> 2.4.1)
106
- pry (0.12.2)
107
- coderay (~> 1.1.0)
108
- method_source (~> 0.9.0)
109
- pry-nav (0.3.0)
110
- pry (>= 0.9.10, < 0.13.0)
111
- racc (1.5.2)
134
+ pry (0.14.1)
135
+ coderay (~> 1.1)
136
+ method_source (~> 1.0)
137
+ pry-nav (1.0.0)
138
+ pry (>= 0.9.10, < 0.15)
139
+ racc (1.6.0)
112
140
  rack (2.2.3)
113
141
  rack-test (1.1.0)
114
142
  rack (>= 1.0, < 3)
115
- rails (6.1.4.1)
116
- actioncable (= 6.1.4.1)
117
- actionmailbox (= 6.1.4.1)
118
- actionmailer (= 6.1.4.1)
119
- actionpack (= 6.1.4.1)
120
- actiontext (= 6.1.4.1)
121
- actionview (= 6.1.4.1)
122
- activejob (= 6.1.4.1)
123
- activemodel (= 6.1.4.1)
124
- activerecord (= 6.1.4.1)
125
- activestorage (= 6.1.4.1)
126
- activesupport (= 6.1.4.1)
143
+ rails (7.0.2.3)
144
+ actioncable (= 7.0.2.3)
145
+ actionmailbox (= 7.0.2.3)
146
+ actionmailer (= 7.0.2.3)
147
+ actionpack (= 7.0.2.3)
148
+ actiontext (= 7.0.2.3)
149
+ actionview (= 7.0.2.3)
150
+ activejob (= 7.0.2.3)
151
+ activemodel (= 7.0.2.3)
152
+ activerecord (= 7.0.2.3)
153
+ activestorage (= 7.0.2.3)
154
+ activesupport (= 7.0.2.3)
127
155
  bundler (>= 1.15.0)
128
- railties (= 6.1.4.1)
129
- sprockets-rails (>= 2.0.0)
156
+ railties (= 7.0.2.3)
130
157
  rails-dom-testing (2.0.3)
131
158
  activesupport (>= 4.2.0)
132
159
  nokogiri (>= 1.6)
133
160
  rails-html-sanitizer (1.4.2)
134
161
  loofah (~> 2.3)
135
- railties (6.1.4.1)
136
- actionpack (= 6.1.4.1)
137
- activesupport (= 6.1.4.1)
162
+ railties (7.0.2.3)
163
+ actionpack (= 7.0.2.3)
164
+ activesupport (= 7.0.2.3)
138
165
  method_source
139
- rake (>= 0.13)
166
+ rake (>= 12.2)
140
167
  thor (~> 1.0)
168
+ zeitwerk (~> 2.5)
141
169
  rainbow (3.0.0)
142
170
  rake (13.0.6)
143
- redis (4.4.0)
171
+ redis (4.6.0)
144
172
  regexp_parser (2.1.1)
145
173
  rexml (3.2.5)
146
- rubocop (1.18.3)
174
+ rubocop (1.22.3)
147
175
  parallel (~> 1.10)
148
176
  parser (>= 3.0.0.0)
149
177
  rainbow (>= 2.2.2, < 4.0)
150
178
  regexp_parser (>= 1.8, < 3.0)
151
179
  rexml
152
- rubocop-ast (>= 1.7.0, < 2.0)
180
+ rubocop-ast (>= 1.12.0, < 2.0)
153
181
  ruby-progressbar (~> 1.7)
154
182
  unicode-display_width (>= 1.4.0, < 3.0)
155
- rubocop-ast (1.8.0)
183
+ rubocop-ast (1.13.0)
156
184
  parser (>= 3.0.1.1)
157
- rubocop-performance (1.11.4)
185
+ rubocop-performance (1.11.5)
158
186
  rubocop (>= 1.7.0, < 2.0)
159
187
  rubocop-ast (>= 0.4.0)
160
188
  ruby-progressbar (1.11.0)
161
- sprockets (4.0.2)
162
- concurrent-ruby (~> 1.0)
163
- rack (> 1, < 3)
164
- sprockets-rails (3.2.2)
165
- actionpack (>= 4.0)
166
- activesupport (>= 4.0)
167
- sprockets (>= 3.0.0)
168
- standard (1.1.5)
169
- rubocop (= 1.18.3)
170
- rubocop-performance (= 1.11.4)
189
+ standard (1.4.0)
190
+ rubocop (= 1.22.3)
191
+ rubocop-performance (= 1.11.5)
171
192
  standardrb (1.0.0)
172
193
  standard
173
- thor (1.1.0)
194
+ strscan (3.0.1)
195
+ thor (1.2.1)
174
196
  thread-local (1.1.0)
197
+ timeout (0.2.0)
175
198
  tzinfo (2.0.4)
176
199
  concurrent-ruby (~> 1.0)
177
- unicode-display_width (2.0.0)
200
+ unicode-display_width (2.1.0)
178
201
  websocket-driver (0.7.5)
179
202
  websocket-extensions (>= 0.1.0)
180
203
  websocket-extensions (0.1.5)
181
- zeitwerk (2.4.2)
204
+ zeitwerk (2.5.4)
182
205
 
183
206
  PLATFORMS
184
- arm64-darwin-20
185
207
  x86_64-darwin-19
186
208
  x86_64-linux
187
209
 
@@ -190,9 +212,10 @@ DEPENDENCIES
190
212
  mocha
191
213
  pry
192
214
  pry-nav
215
+ rails (>= 5.2)
193
216
  rake
194
217
  standardrb (~> 1.0)
195
218
  stimulus_reflex!
196
219
 
197
220
  BUNDLED WITH
198
- 2.2.4
221
+ 2.2.33
data/README.md CHANGED
@@ -90,7 +90,41 @@ Please note that we are not actively providing support on Stack Overflow. If you
90
90
 
91
91
  ## 🚀 Installation and upgrading
92
92
 
93
- CLI and manual setup procedures are fully detailed in the [official docs](https://docs.stimulusreflex.com/setup). For information on upgrading existing projects to v3.4, read [this](https://docs.stimulusreflex.com/hello-world/setup#upgrading-to-v-3-4-0).
93
+ CLI and manual setup procedures are fully detailed in the [official docs](https://docs.stimulusreflex.com/setup).
94
+
95
+ ### Rubygem
96
+
97
+ ```sh
98
+ bundle add cable_ready
99
+ ```
100
+
101
+ ### JavaScript
102
+
103
+ There are a few ways to install the StimulusReflex JavaScript client, depending on your application setup.
104
+
105
+ #### ESBuild / Webpacker
106
+
107
+ ```sh
108
+ yarn add stimulus_reflex
109
+ ```
110
+
111
+ #### Importmaps
112
+
113
+ ```ruby
114
+ # config/importmap.rb
115
+
116
+ # ...
117
+
118
+ pin 'stimulus_reflex', to: 'stimulus_reflex.min.js', preload: true
119
+ ```
120
+
121
+ #### Rails Asset pipeline (Sprockets):
122
+
123
+ ```html+erb
124
+ <!-- app/views/layouts/application.html.erb -->
125
+
126
+ <%= javascript_include_tag "stimulus_reflex.umd.min.js", "data-turbo-track": "reload" %>
127
+ ```
94
128
 
95
129
  ## 🙏 Contributing
96
130
 
@@ -109,11 +143,18 @@ View the [wiki](https://github.com/stimulusreflex/stimulus_reflex/wiki/Editor-Co
109
143
 
110
144
  ## 📦 Releasing
111
145
 
112
- 1. Bump version number at `lib/stimulus_reflex/version.rb`
113
- 2. Run `rake build`
114
- 3. Run `rake release`
115
- 4. Run `yarn publish --no-git-tag-version`
116
- 5. Commit and push changes to the `package.json` file
146
+ 1. Always publish CableReady first!
147
+ 1. Update the `cable_ready` dependency version in `stimulus_reflex.gemspec` and `package.json`
148
+ 1. Make sure that you run `yarn` and `bundle` to pick up the latest.
149
+ 1. Bump version number at `lib/stimulus_reflex/version.rb`. Pre-release versions use `.preN`
150
+ 1. Run `rake build` and `yarn build`
151
+ 1. Run `bin/standardize`
152
+ 1. Commit and push changes to GitHub
153
+ 1. Run `rake release`
154
+ 1. Run `yarn publish --no-git-tag-version`
155
+ 1. Yarn will prompt you for the new version. Pre-release versions use `-preN`
156
+ 1. Commit and push changes to GitHub
157
+ 1. Create a new release on GitHub ([here](https://github.com/stimulusreflex/stimulus_reflex/releases)) and generate the changelog for the stable release for it
117
158
 
118
159
  ## 📝 License
119
160