stimulus_reflex 0.3.0 → 0.3.1
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/Gemfile.lock +4 -4
- data/README.md +9 -5
- data/lib/stimulus_reflex/channel.rb +5 -3
- data/lib/stimulus_reflex/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30d492728542c5c0c0da875d8cb78a89996df90b5602bc9b5574ccf6c63dfbe3
|
4
|
+
data.tar.gz: 3676356138fd7a19f1e1c072c035ab84633a384e003e4394440b77617e857dfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7449b0c3e6d03516741034d265e626dab875b10c5ab73056dcc843569e2b268f3a8d5eee0f6829956532311885d39b492bbb08fe86d4451d58b22a058a6ac410
|
7
|
+
data.tar.gz: 67ffad00aa7e06bca0062d9f61362f08f909471cba2bc1c1429fd3ad6d41b214cb736d5b84a21284bce9210140b431eb76fdd1a68bc5028252fa1bd3bc2ea97e
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
stimulus_reflex (0.3.
|
4
|
+
stimulus_reflex (0.3.1)
|
5
5
|
actioncable (>= 5.2.1)
|
6
6
|
actionpack (>= 5.2.1)
|
7
7
|
cable_ready (>= 2.0.7)
|
@@ -51,7 +51,7 @@ GEM
|
|
51
51
|
nio4r (2.3.1)
|
52
52
|
nokogiri (1.10.1)
|
53
53
|
mini_portile2 (~> 2.4.0)
|
54
|
-
parallel (1.
|
54
|
+
parallel (1.14.0)
|
55
55
|
parser (2.6.0.0)
|
56
56
|
ast (~> 2.4.0)
|
57
57
|
powerpack (0.1.2)
|
@@ -65,7 +65,7 @@ GEM
|
|
65
65
|
rails-html-sanitizer (1.0.4)
|
66
66
|
loofah (~> 2.2, >= 2.2.2)
|
67
67
|
rainbow (3.0.0)
|
68
|
-
rake (12.3.
|
68
|
+
rake (12.3.2)
|
69
69
|
rubocop (0.65.0)
|
70
70
|
jaro_winkler (~> 1.5.1)
|
71
71
|
parallel (~> 1.10)
|
@@ -76,7 +76,7 @@ GEM
|
|
76
76
|
ruby-progressbar (~> 1.7)
|
77
77
|
unicode-display_width (~> 1.4.0)
|
78
78
|
ruby-progressbar (1.10.0)
|
79
|
-
standard (0.0.
|
79
|
+
standard (0.0.32)
|
80
80
|
rubocop (>= 0.63)
|
81
81
|
standardrb (1.0.0)
|
82
82
|
standard
|
data/README.md
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
[![Lines of Code](http://img.shields.io/badge/lines_of_code-160-brightgreen.svg?style=flat)](http://blog.codinghorror.com/the-best-code-is-no-code-at-all/)
|
2
|
-
[![Maintainability](https://
|
2
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/2b24fdbd1ae37a24bedb/maintainability)](https://codeclimate.com/github/hopsoft/stimulus_reflex/maintainability)
|
3
3
|
|
4
4
|
# StimulusReflex
|
5
5
|
|
6
|
-
####
|
6
|
+
#### Build rich interactive UIs with standard Rails... no need for a complex frontend framework
|
7
7
|
|
8
8
|
Add the benefits of single page apps (SPA) to server rendered Rails/Stimulus projects with a minimal investment of time, resources, and complexity.
|
9
9
|
_The goal is to provide 80% of the benefits of SPAs with 20% of the typical effort._
|
10
10
|
|
11
|
+
1. Use [ActionCable](https://edgeguides.rubyonrails.org/action_cable_overview.html) to invoke a method on the server
|
12
|
+
1. Watch the page automatically render updates via fast [DOM diffing](https://github.com/patrick-steele-idem/morphdom)
|
13
|
+
1. That's it
|
14
|
+
|
11
15
|
> This library provides functionality similar to [Phoenix LiveView](https://youtu.be/Z2DU0qLfPIY?t=670) for Rails applications.
|
12
16
|
|
13
17
|
## Usage
|
@@ -81,11 +85,11 @@ class ExampleReflex < StimulusReflex::Reflex
|
|
81
85
|
end
|
82
86
|
```
|
83
87
|
|
84
|
-
The
|
88
|
+
The following happens after the `StimulusReflex::Reflex` method call finishes.
|
85
89
|
|
86
90
|
1. The page that triggered the reflex is re-rerendered
|
87
|
-
1. The re-rendered HTML is sent over the ActionCable socket
|
88
|
-
1.
|
91
|
+
1. The re-rendered HTML is sent to the client over the ActionCable socket
|
92
|
+
1. JavaScript on the client updates the page with any changes via fast DOM diffing
|
89
93
|
|
90
94
|
### ActionCable Defaults Expected
|
91
95
|
|
@@ -78,10 +78,12 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
|
|
78
78
|
"action_dispatch.request.query_parameters" => query_hash,
|
79
79
|
"rack.request.query_hash" => query_hash,
|
80
80
|
"rack.request.query_string" => uri.query,
|
81
|
-
|
82
|
-
|
83
|
-
Rack::REQUEST_PATH => uri.path,
|
81
|
+
"ORIGINAL_SCRIPT_NAME" => "",
|
82
|
+
"ORIGINAL_FULLPATH" => uri.path,
|
84
83
|
Rack::SCRIPT_NAME => "",
|
84
|
+
Rack::PATH_INFO => uri.path,
|
85
|
+
Rack::REQUEST_PATH => uri.path,
|
86
|
+
Rack::QUERY_STRING => uri.query,
|
85
87
|
}
|
86
88
|
|
87
89
|
request = ActionDispatch::Request.new(connection.env.merge(env))
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stimulus_reflex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Hopkins
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-03-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -167,5 +167,5 @@ requirements: []
|
|
167
167
|
rubygems_version: 3.0.1
|
168
168
|
signing_key:
|
169
169
|
specification_version: 4
|
170
|
-
summary:
|
170
|
+
summary: Build rich interactive UIs with standard Rails
|
171
171
|
test_files: []
|