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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8544fe68bac22a31e14a433b4306f8f461af53a6962b0d882f96d5f457ccf284
4
- data.tar.gz: f78fa38dfe275df2a6e8db37285abae01787877a408141f204ec6d22cc98e605
3
+ metadata.gz: 30d492728542c5c0c0da875d8cb78a89996df90b5602bc9b5574ccf6c63dfbe3
4
+ data.tar.gz: 3676356138fd7a19f1e1c072c035ab84633a384e003e4394440b77617e857dfc
5
5
  SHA512:
6
- metadata.gz: cc7cc420fa4b6783b6446964eae9d07905bc0c261683710c3d67db4378bd947f5a8acbde4bf047d242155ba3d25ea6fc971675c47de4364bf69f62001ff98cb5
7
- data.tar.gz: e18ac0934a7d2b4a7914662a1364f1a9cdc5cb42c87043fd2a6cea88292aed02e03474f391de359325d13db86dfb524434c9b4e6e3c6c37e4a10e0c50092bab4
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.0)
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.13.0)
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.1)
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.30)
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://img.shields.io/codeclimate/maintainability/hopsoft/stimulus_reflex.svg)](https://codeclimate.com/github/hopsoft/stimulus_reflex)
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
- #### Server side reactive behavior for Stimulus
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 magic happens after the `StimulusReflex::Reflex` method call finishes.
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. The client side DOM diffs the existing page's HTML with the fresh HTML and applies DOM updates for the change delta
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
- Rack::PATH_INFO => "",
82
- Rack::QUERY_STRING => uri.query,
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))
@@ -1,3 +1,3 @@
1
1
  module StimulusReflex
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
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.0
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-02-20 00:00:00.000000000 Z
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: Server side reactive behavior for Stimulus
170
+ summary: Build rich interactive UIs with standard Rails
171
171
  test_files: []