stimulus_reflex 3.3.0.pre3 → 3.3.0.pre4
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 +19 -1
- data/lib/stimulus_reflex/broadcasters/broadcaster.rb +1 -0
- data/lib/stimulus_reflex/broadcasters/page_broadcaster.rb +0 -1
- data/lib/stimulus_reflex/broadcasters/selector_broadcaster.rb +0 -3
- data/lib/stimulus_reflex/version.rb +1 -1
- metadata +21 -13
- data/stimulus_reflex.gemspec +0 -39
- data/tags +0 -76
- data/test/tmp/app/reflexes/application_reflex.rb +0 -12
- data/test/tmp/app/reflexes/user_reflex.rb +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c9b7c733ac621d7a767be4d2674f3fc93ba082fd49b2b97bae28f1af426c3a2
|
4
|
+
data.tar.gz: 2a8c9b669f1b3ae3ca05061fb56fc04ab68c4617d9c90228ce66ea6af929101e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32827f948085f06d9980c806f2392ca59f4c32b39e5512ee8ef69c89c45192abc4de4824a216c2544e49c816ae345bbbf2713d496f6cd07fbefd1f45e94a9ea1
|
7
|
+
data.tar.gz: b1033c190f6794f2480436ab45da9ba78339dda1cfda7fa2ca724b88186158434dfe36710187bcc36b8fb91433a044ff4585f9deef65178318c95a6e969cf091
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,25 @@
|
|
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.
|
5
|
+
[Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.3.0.pre3...HEAD)
|
6
|
+
|
7
|
+
**Fixed bugs:**
|
8
|
+
|
9
|
+
- Lifecycle callbacks do not work [\#281](https://github.com/hopsoft/stimulus_reflex/issues/281)
|
10
|
+
|
11
|
+
**Closed issues:**
|
12
|
+
|
13
|
+
- self-referential data-reflex-root [\#301](https://github.com/hopsoft/stimulus_reflex/issues/301)
|
14
|
+
- data-reflex-permanent not working when using slim templates [\#295](https://github.com/hopsoft/stimulus_reflex/issues/295)
|
15
|
+
- undefined method `rescue\_with\_handler' whit reflex action such as "click-\>…" or "change-\>…" [\#287](https://github.com/hopsoft/stimulus_reflex/issues/287)
|
16
|
+
|
17
|
+
**Merged pull requests:**
|
18
|
+
|
19
|
+
- Fixed typo in sample code. [\#296](https://github.com/hopsoft/stimulus_reflex/pull/296) ([jclarke](https://github.com/jclarke))
|
20
|
+
|
21
|
+
## [v3.3.0.pre3](https://github.com/hopsoft/stimulus_reflex/tree/v3.3.0.pre3) (2020-08-31)
|
22
|
+
|
23
|
+
[Full Changelog](https://github.com/hopsoft/stimulus_reflex/compare/v3.3.0.pre2...v3.3.0.pre3)
|
6
24
|
|
7
25
|
**Fixed bugs:**
|
8
26
|
|
@@ -7,7 +7,6 @@ module StimulusReflex
|
|
7
7
|
selectors, html = morph
|
8
8
|
updates = selectors.is_a?(Hash) ? selectors : Hash[selectors, html]
|
9
9
|
updates.each do |selector, html|
|
10
|
-
last = morph == morphs.last && selector == updates.keys.last
|
11
10
|
html = html.to_s
|
12
11
|
fragment = Nokogiri::HTML.fragment(html)
|
13
12
|
match = fragment.at_css(selector)
|
@@ -18,7 +17,6 @@ module StimulusReflex
|
|
18
17
|
children_only: true,
|
19
18
|
permanent_attribute_name: permanent_attribute_name,
|
20
19
|
stimulus_reflex: data.merge({
|
21
|
-
last: last,
|
22
20
|
broadast_type: to_sym
|
23
21
|
})
|
24
22
|
)
|
@@ -27,7 +25,6 @@ module StimulusReflex
|
|
27
25
|
selector: selector,
|
28
26
|
html: fragment.to_html,
|
29
27
|
stimulus_reflex: data.merge({
|
30
|
-
last: last,
|
31
28
|
broadast_type: to_sym
|
32
29
|
})
|
33
30
|
)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stimulus_reflex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.0.
|
4
|
+
version: 3.3.0.pre4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Hopkins
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 4.1.2
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: redis
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: bundler
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,7 +150,7 @@ dependencies:
|
|
136
150
|
- - ">="
|
137
151
|
- !ruby/object:Gem::Version
|
138
152
|
version: '0'
|
139
|
-
description:
|
153
|
+
description:
|
140
154
|
email:
|
141
155
|
- natehop@gmail.com
|
142
156
|
executables: []
|
@@ -171,12 +185,8 @@ files:
|
|
171
185
|
- lib/stimulus_reflex/reflex.rb
|
172
186
|
- lib/stimulus_reflex/version.rb
|
173
187
|
- lib/tasks/stimulus_reflex/install.rake
|
174
|
-
- stimulus_reflex.gemspec
|
175
|
-
- tags
|
176
188
|
- test/generators/stimulus_reflex_generator_test.rb
|
177
189
|
- test/test_helper.rb
|
178
|
-
- test/tmp/app/reflexes/application_reflex.rb
|
179
|
-
- test/tmp/app/reflexes/user_reflex.rb
|
180
190
|
homepage: https://github.com/hopsoft/stimulus_reflex
|
181
191
|
licenses:
|
182
192
|
- MIT
|
@@ -205,12 +215,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
215
|
- !ruby/object:Gem::Version
|
206
216
|
version: 1.3.1
|
207
217
|
requirements: []
|
208
|
-
rubygems_version: 3.0.
|
209
|
-
signing_key:
|
218
|
+
rubygems_version: 3.0.6
|
219
|
+
signing_key:
|
210
220
|
specification_version: 4
|
211
221
|
summary: Build reactive applications with the Rails tooling you already know and love.
|
212
222
|
test_files:
|
213
|
-
- test/test_helper.rb
|
214
223
|
- test/generators/stimulus_reflex_generator_test.rb
|
215
|
-
- test/
|
216
|
-
- test/tmp/app/reflexes/user_reflex.rb
|
224
|
+
- test/test_helper.rb
|
data/stimulus_reflex.gemspec
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
require File.expand_path("../lib/stimulus_reflex/version", __FILE__)
|
2
|
-
|
3
|
-
Gem::Specification.new do |gem|
|
4
|
-
gem.name = "stimulus_reflex"
|
5
|
-
gem.license = "MIT"
|
6
|
-
gem.version = StimulusReflex::VERSION
|
7
|
-
gem.authors = ["Nathan Hopkins"]
|
8
|
-
gem.email = ["natehop@gmail.com"]
|
9
|
-
gem.homepage = "https://github.com/hopsoft/stimulus_reflex"
|
10
|
-
gem.summary = "Build reactive applications with the Rails tooling you already know and love."
|
11
|
-
gem.post_install_message = <<~MESSAGE
|
12
|
-
Friendly reminder: When updating the stimulus_reflex gem,
|
13
|
-
don't forget to update your npm package as well.
|
14
|
-
|
15
|
-
See https://www.npmjs.com/package/stimulus_reflex
|
16
|
-
MESSAGE
|
17
|
-
|
18
|
-
gem.metadata = {
|
19
|
-
"bug_tracker_uri" => "https://github.com/hopsoft/stimulus_reflex/issues",
|
20
|
-
"changelog_uri" => "https://github.com/hopsoft/stimulus_reflex/CHANGELOG.md",
|
21
|
-
"documentation_uri" => "https://docs.stimulusreflex.com",
|
22
|
-
"homepage_uri" => gem.homepage,
|
23
|
-
"source_code_uri" => gem.homepage
|
24
|
-
}
|
25
|
-
|
26
|
-
gem.files = Dir["lib/**/*", "bin/*", "[A-Z]*"]
|
27
|
-
gem.test_files = Dir["test/**/*.rb"]
|
28
|
-
|
29
|
-
gem.add_dependency "rack"
|
30
|
-
gem.add_dependency "nokogiri"
|
31
|
-
gem.add_dependency "rails", ">= 5.2"
|
32
|
-
gem.add_dependency "cable_ready", ">= 4.1.2"
|
33
|
-
|
34
|
-
gem.add_development_dependency "bundler", "~> 2.0"
|
35
|
-
gem.add_development_dependency "pry-nav"
|
36
|
-
gem.add_development_dependency "pry"
|
37
|
-
gem.add_development_dependency "rake"
|
38
|
-
gem.add_development_dependency "standardrb"
|
39
|
-
end
|
data/tags
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
|
2
|
-
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
|
3
|
-
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
|
4
|
-
!_TAG_PROGRAM_NAME Exuberant Ctags //
|
5
|
-
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
|
6
|
-
!_TAG_PROGRAM_VERSION 5.8 //
|
7
|
-
ApplicationReflex test/tmp/app/reflexes/application_reflex.rb /^class ApplicationReflex < StimulusReflex::Reflex$/;" c
|
8
|
-
Broadcaster lib/stimulus_reflex/broadcasters/broadcaster.rb /^ class Broadcaster$/;" c class:StimulusReflex
|
9
|
-
DemoReflex test/tmp/app/reflexes/demo_reflex.rb /^class DemoReflex < ApplicationReflex$/;" c
|
10
|
-
Engine lib/stimulus_reflex.rb /^ class Engine < Rails::Engine$/;" c class:StimulusReflex
|
11
|
-
NothingBroadcaster lib/stimulus_reflex/broadcasters/nothing_broadcaster.rb /^ class NothingBroadcaster < Broadcaster$/;" c class:StimulusReflex
|
12
|
-
PageBroadcaster lib/stimulus_reflex/broadcasters/page_broadcaster.rb /^ class PageBroadcaster < Broadcaster$/;" c class:StimulusReflex
|
13
|
-
SelectorBroadcaster lib/stimulus_reflex/broadcasters/selector_broadcaster.rb /^ class SelectorBroadcaster < Broadcaster$/;" c class:StimulusReflex
|
14
|
-
StimulusReflex lib/stimulus_reflex.rb /^module StimulusReflex$/;" m
|
15
|
-
StimulusReflex lib/stimulus_reflex/broadcasters/broadcaster.rb /^module StimulusReflex$/;" m
|
16
|
-
StimulusReflex lib/stimulus_reflex/broadcasters/nothing_broadcaster.rb /^module StimulusReflex$/;" m
|
17
|
-
StimulusReflex lib/stimulus_reflex/broadcasters/page_broadcaster.rb /^module StimulusReflex$/;" m
|
18
|
-
StimulusReflex lib/stimulus_reflex/broadcasters/selector_broadcaster.rb /^module StimulusReflex$/;" m
|
19
|
-
StimulusReflex lib/stimulus_reflex/channel.rb /^class StimulusReflex::Channel < ActionCable::Channel::Base$/;" c
|
20
|
-
StimulusReflex lib/stimulus_reflex/element.rb /^class StimulusReflex::Element < OpenStruct$/;" c
|
21
|
-
StimulusReflex lib/stimulus_reflex/reflex.rb /^class StimulusReflex::Reflex$/;" c
|
22
|
-
StimulusReflex lib/stimulus_reflex/version.rb /^module StimulusReflex$/;" m
|
23
|
-
StimulusReflexGenerator lib/generators/stimulus_reflex_generator.rb /^class StimulusReflexGenerator < Rails::Generators::NamedBase$/;" c
|
24
|
-
StimulusReflexGeneratorTest test/generators/stimulus_reflex_generator_test.rb /^class StimulusReflexGeneratorTest < Rails::Generators::TestCase$/;" c
|
25
|
-
add_callback lib/stimulus_reflex/reflex.rb /^ def add_callback(kind, *args, &block)$/;" f class:StimulusReflex
|
26
|
-
after_reflex lib/stimulus_reflex/reflex.rb /^ def after_reflex(*args, &block)$/;" f class:StimulusReflex
|
27
|
-
around_reflex lib/stimulus_reflex/reflex.rb /^ def around_reflex(*args, &block)$/;" f class:StimulusReflex
|
28
|
-
before_reflex lib/stimulus_reflex/reflex.rb /^ def before_reflex(*args, &block)$/;" f class:StimulusReflex
|
29
|
-
broadcast lib/stimulus_reflex/broadcasters/broadcaster.rb /^ def broadcast(*args)$/;" f class:StimulusReflex.Broadcaster
|
30
|
-
broadcast lib/stimulus_reflex/broadcasters/nothing_broadcaster.rb /^ def broadcast(_, data)$/;" f class:StimulusReflex.NothingBroadcaster
|
31
|
-
broadcast lib/stimulus_reflex/broadcasters/page_broadcaster.rb /^ def broadcast(selectors, data)$/;" f class:StimulusReflex.PageBroadcaster
|
32
|
-
broadcast lib/stimulus_reflex/broadcasters/selector_broadcaster.rb /^ def broadcast(_, data = {})$/;" f class:StimulusReflex.SelectorBroadcaster
|
33
|
-
broadcast_message lib/stimulus_reflex/broadcasters/broadcaster.rb /^ def broadcast_message(subject:, body: nil, data: {})$/;" f class:StimulusReflex.Broadcaster
|
34
|
-
commit_session lib/stimulus_reflex/channel.rb /^ def commit_session(reflex)$/;" f class:StimulusReflex
|
35
|
-
controller lib/stimulus_reflex/reflex.rb /^ def controller$/;" f
|
36
|
-
copy_application_files lib/generators/stimulus_reflex_generator.rb /^ def copy_application_files$/;" f class:StimulusReflexGenerator
|
37
|
-
dataset lib/stimulus_reflex/element.rb /^ def dataset$/;" f class:StimulusReflex
|
38
|
-
default_reflex lib/stimulus_reflex/reflex.rb /^ def default_reflex$/;" f
|
39
|
-
delegate_call_to_reflex lib/stimulus_reflex/channel.rb /^ def delegate_call_to_reflex(reflex, method_name, arguments = [])$/;" f class:StimulusReflex
|
40
|
-
enqueue_message lib/stimulus_reflex/broadcasters/broadcaster.rb /^ def enqueue_message(subject:, body: nil, data: {})$/;" f class:StimulusReflex.Broadcaster
|
41
|
-
error javascript/log.js /^function error (response) {$/;" f
|
42
|
-
exception_message_with_backtrace lib/stimulus_reflex/channel.rb /^ def exception_message_with_backtrace(exception)$/;" f class:StimulusReflex
|
43
|
-
execute lib/generators/stimulus_reflex_generator.rb /^ def execute$/;" f class:StimulusReflexGenerator
|
44
|
-
export.reflexAttribute javascript/schema.js /^ reflexAttribute: 'data-reflex',$/;" p
|
45
|
-
export.reflexDatasetAttribute javascript/schema.js /^ reflexDatasetAttribute: 'data-reflex-dataset'$/;" p
|
46
|
-
export.reflexPermanentAttribute javascript/schema.js /^ reflexPermanentAttribute: 'data-reflex-permanent',$/;" p
|
47
|
-
export.reflexRootAttribute javascript/schema.js /^ reflexRootAttribute: 'data-reflex-root',$/;" p
|
48
|
-
findConsumer javascript/consumer.js /^function findConsumer (object, depth = 0) {$/;" f
|
49
|
-
function.success javascript/log.js /^function success (response, options = { halted: false }) {$/;" f
|
50
|
-
halted? lib/stimulus_reflex/reflex.rb /^ def halted?$/;" f
|
51
|
-
initialize lib/stimulus_reflex/broadcasters/broadcaster.rb /^ def initialize(reflex)$/;" f class:StimulusReflex.Broadcaster
|
52
|
-
initialize lib/stimulus_reflex/element.rb /^ def initialize(data = {})$/;" f class:StimulusReflex
|
53
|
-
initialize lib/stimulus_reflex/reflex.rb /^ def initialize(channel, url: nil, element: nil, selectors: [], method_name: nil, permanent_attribute_name: nil, params: {})$/;" f
|
54
|
-
is_reflex? lib/stimulus_reflex/channel.rb /^ def is_reflex?(reflex_class)$/;" f class:StimulusReflex
|
55
|
-
morph lib/stimulus_reflex/reflex.rb /^ def morph(selectors, html = "")$/;" f
|
56
|
-
morphs lib/stimulus_reflex/broadcasters/selector_broadcaster.rb /^ def morphs$/;" f class:StimulusReflex.SelectorBroadcaster
|
57
|
-
normalize_callback_option! lib/stimulus_reflex/reflex.rb /^ def normalize_callback_option!(options, from, to)$/;" f class:StimulusReflex
|
58
|
-
normalize_callback_options! lib/stimulus_reflex/reflex.rb /^ def normalize_callback_options!(options)$/;" f class:StimulusReflex
|
59
|
-
nothing? lib/stimulus_reflex/broadcasters/broadcaster.rb /^ def nothing?$/;" f class:StimulusReflex.Broadcaster
|
60
|
-
nothing? lib/stimulus_reflex/broadcasters/nothing_broadcaster.rb /^ def nothing?$/;" f class:StimulusReflex.NothingBroadcaster
|
61
|
-
object_with_indifferent_access lib/stimulus_reflex/channel.rb /^ def object_with_indifferent_access(object)$/;" f class:StimulusReflex
|
62
|
-
page? lib/stimulus_reflex/broadcasters/broadcaster.rb /^ def page?$/;" f class:StimulusReflex.Broadcaster
|
63
|
-
page? lib/stimulus_reflex/broadcasters/page_broadcaster.rb /^ def page?$/;" f class:StimulusReflex.PageBroadcaster
|
64
|
-
params lib/stimulus_reflex/reflex.rb /^ def params$/;" f
|
65
|
-
process lib/stimulus_reflex/reflex.rb /^ def process(name, *args)$/;" f
|
66
|
-
receive lib/stimulus_reflex/channel.rb /^ def receive(data)$/;" f class:StimulusReflex
|
67
|
-
request lib/stimulus_reflex/reflex.rb /^ def request$/;" f
|
68
|
-
selector? lib/stimulus_reflex/broadcasters/broadcaster.rb /^ def selector?$/;" f class:StimulusReflex.Broadcaster
|
69
|
-
selector? lib/stimulus_reflex/broadcasters/selector_broadcaster.rb /^ def selector?$/;" f class:StimulusReflex.SelectorBroadcaster
|
70
|
-
stream_name lib/stimulus_reflex/channel.rb /^ def stream_name$/;" f class:StimulusReflex
|
71
|
-
subscribed lib/stimulus_reflex/channel.rb /^ def subscribed$/;" f class:StimulusReflex
|
72
|
-
to_sym lib/stimulus_reflex/broadcasters/broadcaster.rb /^ def to_sym$/;" f class:StimulusReflex.Broadcaster
|
73
|
-
to_sym lib/stimulus_reflex/broadcasters/nothing_broadcaster.rb /^ def to_sym$/;" f class:StimulusReflex.NothingBroadcaster
|
74
|
-
to_sym lib/stimulus_reflex/broadcasters/page_broadcaster.rb /^ def to_sym$/;" f class:StimulusReflex.PageBroadcaster
|
75
|
-
to_sym lib/stimulus_reflex/broadcasters/selector_broadcaster.rb /^ def to_sym$/;" f class:StimulusReflex.SelectorBroadcaster
|
76
|
-
url_params lib/stimulus_reflex/reflex.rb /^ def url_params$/;" f
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class ApplicationReflex < StimulusReflex::Reflex
|
4
|
-
# Put application wide Reflex behavior in this file.
|
5
|
-
#
|
6
|
-
# Example:
|
7
|
-
#
|
8
|
-
# # If your ActionCable connection is: `identified_by :current_user`
|
9
|
-
# delegate :current_user, to: :connection
|
10
|
-
#
|
11
|
-
# Learn more at: https://docs.stimulusreflex.com
|
12
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class UserReflex < ApplicationReflex
|
4
|
-
# Add Reflex methods in this file.
|
5
|
-
#
|
6
|
-
# All Reflex instances expose the following properties:
|
7
|
-
#
|
8
|
-
# - connection - the ActionCable connection
|
9
|
-
# - channel - the ActionCable channel
|
10
|
-
# - request - an ActionDispatch::Request proxy for the socket connection
|
11
|
-
# - session - the ActionDispatch::Session store for the current visitor
|
12
|
-
# - url - the URL of the page that triggered the reflex
|
13
|
-
# - element - a Hash like object that represents the HTML element that triggered the reflex
|
14
|
-
# - params - parameters from the element's closest form (if any)
|
15
|
-
#
|
16
|
-
# Example:
|
17
|
-
#
|
18
|
-
# def example(argument=true)
|
19
|
-
# # Your logic here...
|
20
|
-
# # Any declared instance variables will be made available to the Rails controller and view.
|
21
|
-
# end
|
22
|
-
#
|
23
|
-
# Learn more at: https://docs.stimulusreflex.com
|
24
|
-
|
25
|
-
def update
|
26
|
-
end
|
27
|
-
|
28
|
-
def do_stuff
|
29
|
-
end
|
30
|
-
|
31
|
-
def do_more_stuff
|
32
|
-
end
|
33
|
-
end
|