stimulus_reflex 3.5.0.pre8 → 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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -1218
- data/Gemfile.lock +109 -152
- data/README.md +39 -5
- data/Rakefile +0 -8
- data/app/assets/javascripts/stimulus_reflex.js +969 -0
- data/app/assets/javascripts/stimulus_reflex.min.js +2 -0
- data/app/assets/javascripts/stimulus_reflex.min.js.map +1 -0
- data/app/assets/javascripts/stimulus_reflex.umd.js +904 -0
- data/app/assets/javascripts/stimulus_reflex.umd.min.js +905 -0
- data/app/assets/javascripts/stimulus_reflex.umd.min.js.map +1 -0
- data/app/channels/stimulus_reflex/channel.rb +20 -1
- data/lib/stimulus_reflex/engine.rb +29 -0
- data/lib/stimulus_reflex/importmap.rb +4 -0
- data/lib/stimulus_reflex/open_struct_fix.rb +29 -0
- data/lib/stimulus_reflex/reflex.rb +9 -2
- data/lib/stimulus_reflex/reflex_data.rb +4 -0
- data/lib/stimulus_reflex/reflex_factory.rb +2 -1
- data/lib/stimulus_reflex/utils/logger.rb +2 -0
- data/lib/stimulus_reflex/utils/sanity_checker.rb +0 -58
- data/lib/stimulus_reflex/version.rb +1 -1
- data/lib/stimulus_reflex.rb +2 -6
- data/package.json +67 -0
- data/rollup.config.js +85 -0
- data/stimulus_reflex.gemspec +63 -0
- data/test/broadcasters/broadcaster_test_case.rb +1 -1
- data/test/broadcasters/nothing_broadcaster_test.rb +2 -1
- data/test/broadcasters/page_broadcaster_test.rb +4 -2
- data/test/broadcasters/selector_broadcaster_test.rb +12 -6
- data/test/callbacks_test.rb +23 -23
- data/test/reflex_test.rb +2 -2
- data/test/tmp/app/reflexes/application_reflex.rb +3 -10
- data/test/tmp/app/reflexes/{demo_reflex.rb → user_reflex.rb} +10 -2
- data/web-test-runner.config.mjs +12 -0
- data/yarn-error.log +4964 -0
- data/yarn.lock +4520 -0
- metadata +107 -41
- data/lib/generators/USAGE +0 -14
- data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/%file_name%_controller.js.tt +0 -101
- data/lib/generators/stimulus_reflex/templates/app/javascript/controllers/application_controller.js.tt +0 -60
- data/lib/generators/stimulus_reflex/templates/app/reflexes/%file_name%_reflex.rb.tt +0 -41
- data/lib/generators/stimulus_reflex/templates/app/reflexes/application_reflex.rb.tt +0 -19
- data/lib/tasks/stimulus_reflex/install.rake +0 -116
data/Gemfile.lock
CHANGED
@@ -1,142 +1,105 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
stimulus_reflex (3.5.0.
|
5
|
-
|
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
|
-
|
12
|
+
railties (>= 5.2)
|
9
13
|
redis
|
10
14
|
|
11
15
|
GEM
|
12
16
|
remote: https://rubygems.org/
|
13
17
|
specs:
|
14
|
-
actioncable (
|
15
|
-
actionpack (=
|
16
|
-
activesupport (=
|
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 (
|
20
|
-
actionpack (=
|
21
|
-
activejob (=
|
22
|
-
activerecord (=
|
23
|
-
activestorage (=
|
24
|
-
activesupport (=
|
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
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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 (
|
34
|
-
actionview (=
|
35
|
-
activesupport (=
|
36
|
-
rack (~> 2.0, >= 2.0
|
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 (
|
41
|
-
actionpack (=
|
42
|
-
activerecord (=
|
43
|
-
activestorage (=
|
44
|
-
activesupport (=
|
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 (
|
47
|
-
activesupport (=
|
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 (
|
53
|
-
activesupport (=
|
63
|
+
activejob (7.0.2.3)
|
64
|
+
activesupport (= 7.0.2.3)
|
54
65
|
globalid (>= 0.3.6)
|
55
|
-
activemodel (
|
56
|
-
activesupport (=
|
57
|
-
activerecord (
|
58
|
-
activemodel (=
|
59
|
-
activesupport (=
|
60
|
-
activestorage (
|
61
|
-
actionpack (=
|
62
|
-
activejob (=
|
63
|
-
activerecord (=
|
64
|
-
activesupport (=
|
65
|
-
marcel (~> 1.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 (
|
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
|
-
addressable (2.8.0)
|
74
|
-
public_suffix (>= 2.0.2, < 5.0)
|
75
83
|
ast (2.4.2)
|
76
|
-
async (1.30.1)
|
77
|
-
console (~> 1.10)
|
78
|
-
nio4r (~> 2.3)
|
79
|
-
timers (~> 4.1)
|
80
|
-
async-http (0.56.5)
|
81
|
-
async (>= 1.25)
|
82
|
-
async-io (>= 1.28)
|
83
|
-
async-pool (>= 0.2)
|
84
|
-
protocol-http (~> 0.22.0)
|
85
|
-
protocol-http1 (~> 0.14.0)
|
86
|
-
protocol-http2 (~> 0.14.0)
|
87
|
-
async-http-faraday (0.11.0)
|
88
|
-
async-http (~> 0.42)
|
89
|
-
faraday
|
90
|
-
async-io (1.32.2)
|
91
|
-
async
|
92
|
-
async-pool (0.3.9)
|
93
|
-
async (>= 1.25)
|
94
84
|
builder (3.2.4)
|
95
|
-
cable_ready (5.0.0.
|
96
|
-
|
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)
|
97
92
|
thread-local (>= 1.1.0)
|
98
93
|
coderay (1.1.3)
|
99
|
-
concurrent-ruby (1.1.
|
100
|
-
console (1.14.0)
|
101
|
-
fiber-local
|
94
|
+
concurrent-ruby (1.1.10)
|
102
95
|
crass (1.0.6)
|
96
|
+
digest (3.1.0)
|
103
97
|
erubi (1.10.0)
|
104
|
-
|
105
|
-
faraday-em_http (~> 1.0)
|
106
|
-
faraday-em_synchrony (~> 1.0)
|
107
|
-
faraday-excon (~> 1.1)
|
108
|
-
faraday-httpclient (~> 1.0.1)
|
109
|
-
faraday-net_http (~> 1.0)
|
110
|
-
faraday-net_http_persistent (~> 1.1)
|
111
|
-
faraday-patron (~> 1.0)
|
112
|
-
faraday-rack (~> 1.0)
|
113
|
-
multipart-post (>= 1.2, < 3)
|
114
|
-
ruby2_keywords (>= 0.0.4)
|
115
|
-
faraday-em_http (1.0.0)
|
116
|
-
faraday-em_synchrony (1.0.0)
|
117
|
-
faraday-excon (1.1.0)
|
118
|
-
faraday-http-cache (2.2.0)
|
119
|
-
faraday (>= 0.8)
|
120
|
-
faraday-httpclient (1.0.1)
|
121
|
-
faraday-net_http (1.0.1)
|
122
|
-
faraday-net_http_persistent (1.2.0)
|
123
|
-
faraday-patron (1.0.0)
|
124
|
-
faraday-rack (1.0.0)
|
125
|
-
fiber-local (1.0.0)
|
126
|
-
github_changelog_generator (1.16.4)
|
127
|
-
activesupport
|
128
|
-
async (>= 1.25.0)
|
129
|
-
async-http-faraday
|
130
|
-
faraday-http-cache
|
131
|
-
multi_json
|
132
|
-
octokit (~> 4.6)
|
133
|
-
rainbow (>= 2.2.1)
|
134
|
-
rake (>= 10.0)
|
135
|
-
globalid (0.5.2)
|
98
|
+
globalid (1.0.0)
|
136
99
|
activesupport (>= 5.0)
|
137
|
-
i18n (1.
|
100
|
+
i18n (1.10.0)
|
138
101
|
concurrent-ruby (~> 1.0)
|
139
|
-
loofah (2.
|
102
|
+
loofah (2.15.0)
|
140
103
|
crass (~> 1.0.2)
|
141
104
|
nokogiri (>= 1.5.9)
|
142
105
|
mail (2.7.1)
|
@@ -144,65 +107,68 @@ GEM
|
|
144
107
|
marcel (1.0.2)
|
145
108
|
method_source (1.0.0)
|
146
109
|
mini_mime (1.1.2)
|
147
|
-
minitest (5.
|
110
|
+
minitest (5.15.0)
|
148
111
|
mocha (1.13.0)
|
149
|
-
|
150
|
-
|
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
|
151
126
|
nio4r (2.5.8)
|
152
|
-
nokogiri (1.
|
127
|
+
nokogiri (1.13.3-x86_64-darwin)
|
128
|
+
racc (~> 1.4)
|
129
|
+
nokogiri (1.13.3-x86_64-linux)
|
153
130
|
racc (~> 1.4)
|
154
|
-
octokit (4.21.0)
|
155
|
-
faraday (>= 0.9)
|
156
|
-
sawyer (~> 0.8.0, >= 0.5.3)
|
157
131
|
parallel (1.21.0)
|
158
132
|
parser (3.0.2.0)
|
159
133
|
ast (~> 2.4.1)
|
160
|
-
protocol-hpack (1.4.2)
|
161
|
-
protocol-http (0.22.5)
|
162
|
-
protocol-http1 (0.14.2)
|
163
|
-
protocol-http (~> 0.22)
|
164
|
-
protocol-http2 (0.14.2)
|
165
|
-
protocol-hpack (~> 1.4)
|
166
|
-
protocol-http (~> 0.18)
|
167
134
|
pry (0.14.1)
|
168
135
|
coderay (~> 1.1)
|
169
136
|
method_source (~> 1.0)
|
170
137
|
pry-nav (1.0.0)
|
171
138
|
pry (>= 0.9.10, < 0.15)
|
172
|
-
public_suffix (4.0.6)
|
173
139
|
racc (1.6.0)
|
174
140
|
rack (2.2.3)
|
175
141
|
rack-test (1.1.0)
|
176
142
|
rack (>= 1.0, < 3)
|
177
|
-
rails (
|
178
|
-
actioncable (=
|
179
|
-
actionmailbox (=
|
180
|
-
actionmailer (=
|
181
|
-
actionpack (=
|
182
|
-
actiontext (=
|
183
|
-
actionview (=
|
184
|
-
activejob (=
|
185
|
-
activemodel (=
|
186
|
-
activerecord (=
|
187
|
-
activestorage (=
|
188
|
-
activesupport (=
|
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)
|
189
155
|
bundler (>= 1.15.0)
|
190
|
-
railties (=
|
191
|
-
sprockets-rails (>= 2.0.0)
|
156
|
+
railties (= 7.0.2.3)
|
192
157
|
rails-dom-testing (2.0.3)
|
193
158
|
activesupport (>= 4.2.0)
|
194
159
|
nokogiri (>= 1.6)
|
195
160
|
rails-html-sanitizer (1.4.2)
|
196
161
|
loofah (~> 2.3)
|
197
|
-
railties (
|
198
|
-
actionpack (=
|
199
|
-
activesupport (=
|
162
|
+
railties (7.0.2.3)
|
163
|
+
actionpack (= 7.0.2.3)
|
164
|
+
activesupport (= 7.0.2.3)
|
200
165
|
method_source
|
201
|
-
rake (>=
|
166
|
+
rake (>= 12.2)
|
202
167
|
thor (~> 1.0)
|
168
|
+
zeitwerk (~> 2.5)
|
203
169
|
rainbow (3.0.0)
|
204
170
|
rake (13.0.6)
|
205
|
-
redis (4.
|
171
|
+
redis (4.6.0)
|
206
172
|
regexp_parser (2.1.1)
|
207
173
|
rexml (3.2.5)
|
208
174
|
rubocop (1.22.3)
|
@@ -220,45 +186,36 @@ GEM
|
|
220
186
|
rubocop (>= 1.7.0, < 2.0)
|
221
187
|
rubocop-ast (>= 0.4.0)
|
222
188
|
ruby-progressbar (1.11.0)
|
223
|
-
ruby2_keywords (0.0.5)
|
224
|
-
sawyer (0.8.2)
|
225
|
-
addressable (>= 2.3.5)
|
226
|
-
faraday (> 0.8, < 2.0)
|
227
|
-
sprockets (4.0.2)
|
228
|
-
concurrent-ruby (~> 1.0)
|
229
|
-
rack (> 1, < 3)
|
230
|
-
sprockets-rails (3.4.0)
|
231
|
-
actionpack (>= 5.2)
|
232
|
-
activesupport (>= 5.2)
|
233
|
-
sprockets (>= 3.0.0)
|
234
189
|
standard (1.4.0)
|
235
190
|
rubocop (= 1.22.3)
|
236
191
|
rubocop-performance (= 1.11.5)
|
237
192
|
standardrb (1.0.0)
|
238
193
|
standard
|
239
|
-
|
194
|
+
strscan (3.0.1)
|
195
|
+
thor (1.2.1)
|
240
196
|
thread-local (1.1.0)
|
241
|
-
|
197
|
+
timeout (0.2.0)
|
242
198
|
tzinfo (2.0.4)
|
243
199
|
concurrent-ruby (~> 1.0)
|
244
200
|
unicode-display_width (2.1.0)
|
245
201
|
websocket-driver (0.7.5)
|
246
202
|
websocket-extensions (>= 0.1.0)
|
247
203
|
websocket-extensions (0.1.5)
|
248
|
-
zeitwerk (2.5.
|
204
|
+
zeitwerk (2.5.4)
|
249
205
|
|
250
206
|
PLATFORMS
|
207
|
+
x86_64-darwin-19
|
251
208
|
x86_64-linux
|
252
209
|
|
253
210
|
DEPENDENCIES
|
254
211
|
bundler (~> 2.0)
|
255
|
-
github_changelog_generator
|
256
212
|
mocha
|
257
213
|
pry
|
258
214
|
pry-nav
|
215
|
+
rails (>= 5.2)
|
259
216
|
rake
|
260
217
|
standardrb (~> 1.0)
|
261
218
|
stimulus_reflex!
|
262
219
|
|
263
220
|
BUNDLED WITH
|
264
|
-
2.2.
|
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).
|
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
|
|
@@ -113,14 +147,14 @@ View the [wiki](https://github.com/stimulusreflex/stimulus_reflex/wiki/Editor-Co
|
|
113
147
|
1. Update the `cable_ready` dependency version in `stimulus_reflex.gemspec` and `package.json`
|
114
148
|
1. Make sure that you run `yarn` and `bundle` to pick up the latest.
|
115
149
|
1. Bump version number at `lib/stimulus_reflex/version.rb`. Pre-release versions use `.preN`
|
116
|
-
1. Run `rake build`
|
150
|
+
1. Run `rake build` and `yarn build`
|
117
151
|
1. Run `bin/standardize`
|
118
|
-
1. Commit and push changes to
|
152
|
+
1. Commit and push changes to GitHub
|
119
153
|
1. Run `rake release`
|
120
154
|
1. Run `yarn publish --no-git-tag-version`
|
121
155
|
1. Yarn will prompt you for the new version. Pre-release versions use `-preN`
|
122
|
-
1.
|
123
|
-
1.
|
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
|
124
158
|
|
125
159
|
## 📝 License
|
126
160
|
|
data/Rakefile
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
require "bundler/gem_tasks"
|
4
4
|
require "rails/test_unit/runner"
|
5
|
-
require "github_changelog_generator/task"
|
6
5
|
|
7
6
|
task :test_javascript do |task|
|
8
7
|
system "yarn run test"
|
@@ -14,10 +13,3 @@ end
|
|
14
13
|
|
15
14
|
task test: [:test_javascript, :test_ruby]
|
16
15
|
task default: [:test]
|
17
|
-
|
18
|
-
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
19
|
-
config.user = "stimulusreflex"
|
20
|
-
config.project = "stimulus_reflex"
|
21
|
-
config.exclude_labels = %w[duplicate question invalid wontfix nodoc]
|
22
|
-
config.token = ENV["GITHUB_CHANGELOG_GENERATOR_TOKEN"]
|
23
|
-
end
|