cable_ready 4.4.0.pre0 → 4.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9e80c88ee4b5f489f4dae10d4fa4928ec1f2fe122045e079edfb60b67671c17
4
- data.tar.gz: 1785e8a0e3e44eb48c07c8dd5d78de0e7ccce0de26578d8e1aec0a3145f32376
3
+ metadata.gz: e3abe83511c1ca40cd20ff9d24cdc3fd0fa6cd9581dba8bad69d65ee75531bd1
4
+ data.tar.gz: 6a5c2830efa380cd4c611ba9f5997aca05ba03da6bc26e54f7055bdb7963cfbf
5
5
  SHA512:
6
- metadata.gz: 99a851b96f1ec3165e690b3c8aba93a1ffb39776092bce8972164912ea65de51e8a0ce91043507ca1750259000afac3f1f099e190537362f5bcd8a859134d9a3
7
- data.tar.gz: 4cd74f4379d0e71ab516269df9cbd7804d673b77a5229f401c50cde36e2a4bed603db02e15b6487156f8e187510d8ed6dec76ee34691bd7bdb1c9b2b9f8eb595
6
+ metadata.gz: 8cc8f86a38a0c4bd000c5ea8d80a80f8c1ae0350f1644545d25416d63240364e0a4b70dde273eee9a01eb6691895e1477f748ef7253e45370b3ed00f1d9c2949
7
+ data.tar.gz: 6aa1554dd99a8131dd1de913b8675a735086121a7843f040bb820e57901fc12abb7b42d816ed90ac1ea4e8bf3c892c465964f288c4bd3d41687eac52c2b39575
@@ -1,8 +1,51 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased](https://github.com/hopsoft/cable_ready/tree/HEAD)
3
+ ## [v4.4.0.pre4](https://github.com/hopsoft/cable_ready/tree/v4.4.0.pre4) (2020-11-22)
4
4
 
5
- [Full Changelog](https://github.com/hopsoft/cable_ready/compare/v4.3.0...HEAD)
5
+ [Full Changelog](https://github.com/hopsoft/cable_ready/compare/v4.4.0.pre3...v4.4.0.pre4)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - only compare isEqualNode for non-inputs [\#80](https://github.com/hopsoft/cable_ready/pull/80) ([leastbad](https://github.com/leastbad))
10
+
11
+ ## [v4.4.0.pre3](https://github.com/hopsoft/cable_ready/tree/v4.4.0.pre3) (2020-11-13)
12
+
13
+ [Full Changelog](https://github.com/hopsoft/cable_ready/compare/v4.4.0.pre2...v4.4.0.pre3)
14
+
15
+ **Closed issues:**
16
+
17
+ - CableReady detected an error in insertAdjacentHtml. Object doesn't support this action - IE11 only [\#76](https://github.com/hopsoft/cable_ready/issues/76)
18
+ - shouldMorph doesn't work well with some form elements [\#70](https://github.com/hopsoft/cable_ready/issues/70)
19
+ - Operations go missing before broadcasting [\#64](https://github.com/hopsoft/cable_ready/issues/64)
20
+
21
+ **Merged pull requests:**
22
+
23
+ - Move package.json to root and prepare for v4.4.0.pre3 [\#79](https://github.com/hopsoft/cable_ready/pull/79) ([hopsoft](https://github.com/hopsoft))
24
+ - method chaining [\#78](https://github.com/hopsoft/cable_ready/pull/78) ([leastbad](https://github.com/leastbad))
25
+ - jquery support [\#75](https://github.com/hopsoft/cable_ready/pull/75) ([leastbad](https://github.com/leastbad))
26
+ - Removed isEqualNode comparison [\#71](https://github.com/hopsoft/cable_ready/pull/71) ([adank92](https://github.com/adank92))
27
+
28
+ ## [v4.4.0.pre2](https://github.com/hopsoft/cable_ready/tree/v4.4.0.pre2) (2020-11-02)
29
+
30
+ [Full Changelog](https://github.com/hopsoft/cable_ready/compare/v4.4.0.pre1...v4.4.0.pre2)
31
+
32
+ **Merged pull requests:**
33
+
34
+ - use CustomEvent to get IE11 working [\#74](https://github.com/hopsoft/cable_ready/pull/74) ([existentialmutt](https://github.com/existentialmutt))
35
+
36
+ ## [v4.4.0.pre1](https://github.com/hopsoft/cable_ready/tree/v4.4.0.pre1) (2020-09-25)
37
+
38
+ [Full Changelog](https://github.com/hopsoft/cable_ready/compare/v4.4.0.pre0...v4.4.0.pre1)
39
+
40
+ **Merged pull requests:**
41
+
42
+ - Add support for pushState [\#73](https://github.com/hopsoft/cable_ready/pull/73) ([hopsoft](https://github.com/hopsoft))
43
+ - Bump actionview from 6.0.3.2 to 6.0.3.3 [\#72](https://github.com/hopsoft/cable_ready/pull/72) ([dependabot[bot]](https://github.com/apps/dependabot))
44
+ - set\_focus operation [\#69](https://github.com/hopsoft/cable_ready/pull/69) ([leastbad](https://github.com/leastbad))
45
+
46
+ ## [v4.4.0.pre0](https://github.com/hopsoft/cable_ready/tree/v4.4.0.pre0) (2020-09-02)
47
+
48
+ [Full Changelog](https://github.com/hopsoft/cable_ready/compare/v4.3.0...v4.4.0.pre0)
6
49
 
7
50
  **Implemented enhancements:**
8
51
 
@@ -123,7 +166,7 @@
123
166
  - Set cookie support [\#28](https://github.com/hopsoft/cable_ready/pull/28) ([hopsoft](https://github.com/hopsoft))
124
167
  - README.md: Fix typo [\#27](https://github.com/hopsoft/cable_ready/pull/27) ([henrik](https://github.com/henrik))
125
168
  - Update event-dispatch.md [\#25](https://github.com/hopsoft/cable_ready/pull/25) ([leastbad](https://github.com/leastbad))
126
- - Fix typo on Remove Css Class methods [\#24](https://github.com/hopsoft/cable_ready/pull/24) ([darkrubyist](https://github.com/darkrubyist))
169
+ - Fix typo on Remove Css Class methods [\#24](https://github.com/hopsoft/cable_ready/pull/24) ([dark88888](https://github.com/dark88888))
127
170
 
128
171
  ## [v4.0.9](https://github.com/hopsoft/cable_ready/tree/v4.0.9) (2020-01-27)
129
172
 
@@ -1,62 +1,62 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cable_ready (4.4.0.pre0)
4
+ cable_ready (4.4.0)
5
5
  rails (>= 5.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (6.0.3.2)
11
- actionpack (= 6.0.3.2)
10
+ actioncable (6.0.3.4)
11
+ actionpack (= 6.0.3.4)
12
12
  nio4r (~> 2.0)
13
13
  websocket-driver (>= 0.6.1)
14
- actionmailbox (6.0.3.2)
15
- actionpack (= 6.0.3.2)
16
- activejob (= 6.0.3.2)
17
- activerecord (= 6.0.3.2)
18
- activestorage (= 6.0.3.2)
19
- activesupport (= 6.0.3.2)
14
+ actionmailbox (6.0.3.4)
15
+ actionpack (= 6.0.3.4)
16
+ activejob (= 6.0.3.4)
17
+ activerecord (= 6.0.3.4)
18
+ activestorage (= 6.0.3.4)
19
+ activesupport (= 6.0.3.4)
20
20
  mail (>= 2.7.1)
21
- actionmailer (6.0.3.2)
22
- actionpack (= 6.0.3.2)
23
- actionview (= 6.0.3.2)
24
- activejob (= 6.0.3.2)
21
+ actionmailer (6.0.3.4)
22
+ actionpack (= 6.0.3.4)
23
+ actionview (= 6.0.3.4)
24
+ activejob (= 6.0.3.4)
25
25
  mail (~> 2.5, >= 2.5.4)
26
26
  rails-dom-testing (~> 2.0)
27
- actionpack (6.0.3.2)
28
- actionview (= 6.0.3.2)
29
- activesupport (= 6.0.3.2)
27
+ actionpack (6.0.3.4)
28
+ actionview (= 6.0.3.4)
29
+ activesupport (= 6.0.3.4)
30
30
  rack (~> 2.0, >= 2.0.8)
31
31
  rack-test (>= 0.6.3)
32
32
  rails-dom-testing (~> 2.0)
33
33
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
34
- actiontext (6.0.3.2)
35
- actionpack (= 6.0.3.2)
36
- activerecord (= 6.0.3.2)
37
- activestorage (= 6.0.3.2)
38
- activesupport (= 6.0.3.2)
34
+ actiontext (6.0.3.4)
35
+ actionpack (= 6.0.3.4)
36
+ activerecord (= 6.0.3.4)
37
+ activestorage (= 6.0.3.4)
38
+ activesupport (= 6.0.3.4)
39
39
  nokogiri (>= 1.8.5)
40
- actionview (6.0.3.2)
41
- activesupport (= 6.0.3.2)
40
+ actionview (6.0.3.4)
41
+ activesupport (= 6.0.3.4)
42
42
  builder (~> 3.1)
43
43
  erubi (~> 1.4)
44
44
  rails-dom-testing (~> 2.0)
45
45
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
46
- activejob (6.0.3.2)
47
- activesupport (= 6.0.3.2)
46
+ activejob (6.0.3.4)
47
+ activesupport (= 6.0.3.4)
48
48
  globalid (>= 0.3.6)
49
- activemodel (6.0.3.2)
50
- activesupport (= 6.0.3.2)
51
- activerecord (6.0.3.2)
52
- activemodel (= 6.0.3.2)
53
- activesupport (= 6.0.3.2)
54
- activestorage (6.0.3.2)
55
- actionpack (= 6.0.3.2)
56
- activejob (= 6.0.3.2)
57
- activerecord (= 6.0.3.2)
49
+ activemodel (6.0.3.4)
50
+ activesupport (= 6.0.3.4)
51
+ activerecord (6.0.3.4)
52
+ activemodel (= 6.0.3.4)
53
+ activesupport (= 6.0.3.4)
54
+ activestorage (6.0.3.4)
55
+ actionpack (= 6.0.3.4)
56
+ activejob (= 6.0.3.4)
57
+ activerecord (= 6.0.3.4)
58
58
  marcel (~> 0.3.1)
59
- activesupport (6.0.3.2)
59
+ activesupport (6.0.3.4)
60
60
  concurrent-ruby (~> 1.0, >= 1.0.2)
61
61
  i18n (>= 0.7, < 2)
62
62
  minitest (~> 5.1)
@@ -69,9 +69,10 @@ GEM
69
69
  coderay (1.1.3)
70
70
  concurrent-ruby (1.1.7)
71
71
  crass (1.0.6)
72
- erubi (1.9.0)
73
- faraday (1.0.1)
72
+ erubi (1.10.0)
73
+ faraday (1.1.0)
74
74
  multipart-post (>= 1.2, < 3)
75
+ ruby2_keywords
75
76
  faraday-http-cache (2.2.0)
76
77
  faraday (>= 0.8)
77
78
  github_changelog_generator (1.15.2)
@@ -89,7 +90,7 @@ GEM
89
90
  loofah (2.7.0)
90
91
  crass (~> 1.0.2)
91
92
  nokogiri (>= 1.5.9)
92
- magic_frozen_string_literal (1.1.0)
93
+ magic_frozen_string_literal (1.2.0)
93
94
  mail (2.7.1)
94
95
  mini_mime (>= 0.1.1)
95
96
  marcel (0.3.3)
@@ -101,93 +102,95 @@ GEM
101
102
  minitest (5.14.2)
102
103
  multi_json (1.15.0)
103
104
  multipart-post (2.1.1)
104
- nio4r (2.5.2)
105
+ nio4r (2.5.4)
105
106
  nokogiri (1.10.10)
106
107
  mini_portile2 (~> 2.4.0)
107
- octokit (4.18.0)
108
+ octokit (4.19.0)
108
109
  faraday (>= 0.9)
109
110
  sawyer (~> 0.8.0, >= 0.5.3)
110
- parallel (1.19.2)
111
- parser (2.7.1.4)
111
+ parallel (1.20.1)
112
+ parser (2.7.2.0)
112
113
  ast (~> 2.4.1)
113
114
  pry (0.12.2)
114
115
  coderay (~> 1.1.0)
115
116
  method_source (~> 0.9.0)
116
117
  pry-nav (0.3.0)
117
118
  pry (>= 0.9.10, < 0.13.0)
118
- public_suffix (4.0.5)
119
+ public_suffix (4.0.6)
119
120
  rack (2.2.3)
120
121
  rack-test (1.1.0)
121
122
  rack (>= 1.0, < 3)
122
- rails (6.0.3.2)
123
- actioncable (= 6.0.3.2)
124
- actionmailbox (= 6.0.3.2)
125
- actionmailer (= 6.0.3.2)
126
- actionpack (= 6.0.3.2)
127
- actiontext (= 6.0.3.2)
128
- actionview (= 6.0.3.2)
129
- activejob (= 6.0.3.2)
130
- activemodel (= 6.0.3.2)
131
- activerecord (= 6.0.3.2)
132
- activestorage (= 6.0.3.2)
133
- activesupport (= 6.0.3.2)
123
+ rails (6.0.3.4)
124
+ actioncable (= 6.0.3.4)
125
+ actionmailbox (= 6.0.3.4)
126
+ actionmailer (= 6.0.3.4)
127
+ actionpack (= 6.0.3.4)
128
+ actiontext (= 6.0.3.4)
129
+ actionview (= 6.0.3.4)
130
+ activejob (= 6.0.3.4)
131
+ activemodel (= 6.0.3.4)
132
+ activerecord (= 6.0.3.4)
133
+ activestorage (= 6.0.3.4)
134
+ activesupport (= 6.0.3.4)
134
135
  bundler (>= 1.3.0)
135
- railties (= 6.0.3.2)
136
+ railties (= 6.0.3.4)
136
137
  sprockets-rails (>= 2.0.0)
137
138
  rails-dom-testing (2.0.3)
138
139
  activesupport (>= 4.2.0)
139
140
  nokogiri (>= 1.6)
140
141
  rails-html-sanitizer (1.3.0)
141
142
  loofah (~> 2.3)
142
- railties (6.0.3.2)
143
- actionpack (= 6.0.3.2)
144
- activesupport (= 6.0.3.2)
143
+ railties (6.0.3.4)
144
+ actionpack (= 6.0.3.4)
145
+ activesupport (= 6.0.3.4)
145
146
  method_source
146
147
  rake (>= 0.8.7)
147
148
  thor (>= 0.20.3, < 2.0)
148
149
  rainbow (3.0.0)
149
150
  rake (13.0.1)
150
- regexp_parser (1.7.1)
151
+ regexp_parser (1.8.2)
151
152
  retriable (3.1.2)
152
153
  rexml (3.2.4)
153
- rubocop (0.89.1)
154
+ rubocop (1.2.0)
154
155
  parallel (~> 1.10)
155
- parser (>= 2.7.1.1)
156
+ parser (>= 2.7.1.5)
156
157
  rainbow (>= 2.2.2, < 4.0)
157
- regexp_parser (>= 1.7)
158
+ regexp_parser (>= 1.8)
158
159
  rexml
159
- rubocop-ast (>= 0.3.0, < 1.0)
160
+ rubocop-ast (>= 1.0.1)
160
161
  ruby-progressbar (~> 1.7)
161
162
  unicode-display_width (>= 1.4.0, < 2.0)
162
- rubocop-ast (0.3.0)
163
- parser (>= 2.7.1.4)
164
- rubocop-performance (1.7.1)
165
- rubocop (>= 0.82.0)
163
+ rubocop-ast (1.1.1)
164
+ parser (>= 2.7.1.5)
165
+ rubocop-performance (1.8.1)
166
+ rubocop (>= 0.87.0)
167
+ rubocop-ast (>= 0.4.0)
166
168
  ruby-progressbar (1.10.1)
169
+ ruby2_keywords (0.0.2)
167
170
  sawyer (0.8.2)
168
171
  addressable (>= 2.3.5)
169
172
  faraday (> 0.8, < 2.0)
170
173
  sprockets (4.0.2)
171
174
  concurrent-ruby (~> 1.0)
172
175
  rack (> 1, < 3)
173
- sprockets-rails (3.2.1)
176
+ sprockets-rails (3.2.2)
174
177
  actionpack (>= 4.0)
175
178
  activesupport (>= 4.0)
176
179
  sprockets (>= 3.0.0)
177
- standard (0.5.2)
178
- rubocop (~> 0.89.1)
179
- rubocop-performance (~> 1.7.1)
180
+ standard (0.9.0)
181
+ rubocop (= 1.2.0)
182
+ rubocop-performance (= 1.8.1)
180
183
  standardrb (1.0.0)
181
184
  standard
182
185
  thor (1.0.1)
183
186
  thread_safe (0.3.6)
184
- tzinfo (1.2.7)
187
+ tzinfo (1.2.8)
185
188
  thread_safe (~> 0.1)
186
189
  unicode-display_width (1.7.0)
187
190
  websocket-driver (0.7.3)
188
191
  websocket-extensions (>= 0.1.0)
189
192
  websocket-extensions (0.1.5)
190
- zeitwerk (2.4.0)
193
+ zeitwerk (2.4.1)
191
194
 
192
195
  PLATFORMS
193
196
  ruby
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="assets/cable-ready-logo-with-copy.svg" width="360" />
2
+ <img src="https://gitcdn.link/repo/hopsoft/cable_ready/master/assets/cable-ready-logo-with-copy.svg" width="360" />
3
3
  <h1 align="center">Welcome to CableReady 👋</h1>
4
4
  <p align="center">
5
5
  <img src="https://img.shields.io/gem/v/cable_ready.svg?color=red" />
@@ -11,7 +11,7 @@
11
11
  <img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-brightgreen.svg" target="_blank" />
12
12
  </a>
13
13
  <a href="http://blog.codinghorror.com/the-best-code-is-no-code-at-all/" target="_blank">
14
- <img alt="Lines of Code" src="https://img.shields.io/badge/lines_of_code-375-brightgreen.svg?style=flat" />
14
+ <img alt="Lines of Code" src="https://img.shields.io/badge/lines_of_code-422-brightgreen.svg?style=flat" />
15
15
  </a>
16
16
  <a href="https://cableready.stimulusreflex.com" target="_blank">
17
17
  <img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
@@ -27,6 +27,9 @@
27
27
  <img alt="JavaScript Code Style" src="https://img.shields.io/badge/JavaScript_Code_Style-prettier_standard-ff69b4.svg" />
28
28
  </a>
29
29
  <br />
30
+ <a href="https://www.codacy.com/manual/hopsoft/cable_ready/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=hopsoft/cable_ready&amp;utm_campaign=Badge_Grade" target="_blank">
31
+ <img alt="Code Quality" src="https://app.codacy.com/project/badge/Grade/8e6971e3410347eaaa16be2555160b9c"/>
32
+ </a>
30
33
  <a href="https://codeclimate.com/github/hopsoft/cable_ready/maintainability" target="_blank">
31
34
  <img alt="Maintainability" src="https://api.codeclimate.com/v1/badges/83ddf1fee4af7e51a681/maintainability" />
32
35
  </a>
@@ -81,8 +84,8 @@ Please run `./bin/standardize` prior submitting pull requests.
81
84
  1. Bump version number at `lib/cable_ready/version.rb`
82
85
  1. Run `rake build`
83
86
  1. Run `rake release`
84
- 1. Change directories `cd ./javascript`
85
- 1. Run `yarn publish` - NOTE: this will throw a fatal error because the tag already exists but the package will still publish
87
+ 1. Run `yarn publish --no-git-tag-version`
88
+ 1. Commit and push changes to the `package.json` file
86
89
 
87
90
  ## 📝 License
88
91
 
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
+ bundle exec magic_frozen_string_literal
3
4
  bundle exec standardrb --fix
4
- cd ./javascript && yarn run prettier-standard cable_ready.js
5
+ yarn run prettier-standard ./javascript/*.js
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.expand_path("../lib/cable_ready/version", __FILE__)
2
4
 
3
5
  Gem::Specification.new do |gem|
@@ -13,24 +13,33 @@ module CableReady
13
13
  end
14
14
  end
15
15
 
16
- def broadcast(clear)
16
+ def channel_broadcast(clear)
17
17
  operations.select! { |_, list| list.present? }
18
18
  operations.deep_transform_keys! { |key| key.to_s.camelize(:lower) }
19
19
  ActionCable.server.broadcast identifier, {"cableReady" => true, "operations" => operations}
20
20
  reset if clear
21
21
  end
22
22
 
23
- def broadcast_to(model, clear)
23
+ def channel_broadcast_to(model, clear)
24
24
  operations.select! { |_, list| list.present? }
25
25
  operations.deep_transform_keys! { |key| key.to_s.camelize(:lower) }
26
26
  identifier.broadcast_to model, {"cableReady" => true, "operations" => operations}
27
27
  reset if clear
28
28
  end
29
29
 
30
+ def broadcast(clear = true)
31
+ CableReady::Channels.instance.broadcast(identifier, clear)
32
+ end
33
+
34
+ def broadcast_to(model, clear = true)
35
+ CableReady::Channels.instance.broadcast_to(model, identifier, clear)
36
+ end
37
+
30
38
  private
31
39
 
32
- def add_operation(key, options)
40
+ def enqueue_operation(key, options)
33
41
  operations[key] << options
42
+ self
34
43
  end
35
44
 
36
45
  def reset
@@ -24,12 +24,14 @@ module CableReady
24
24
  morph
25
25
  notification
26
26
  outer_html
27
+ push_state
27
28
  remove
28
29
  remove_attribute
29
30
  remove_css_class
30
31
  set_attribute
31
32
  set_cookie
32
33
  set_dataset_property
34
+ set_focus
33
35
  set_property
34
36
  set_style
35
37
  set_styles
@@ -41,7 +43,7 @@ module CableReady
41
43
  end
42
44
 
43
45
  def add_operation(operation, &implementation)
44
- @operations[operation] = implementation || ->(options = {}) { add_operation(operation, options) }
46
+ @operations[operation] = implementation || ->(options = {}) { enqueue_operation(operation, options) }
45
47
  end
46
48
 
47
49
  def [](identifier)
@@ -54,7 +56,7 @@ module CableReady
54
56
  .reject { |channel| identifiers.any? && identifiers.exclude?(channel.identifier) }
55
57
  .select { |channel| channel.identifier.is_a?(String) }
56
58
  .tap do |channels|
57
- channels.each { |channel| @channels[channel.identifier].broadcast(clear) }
59
+ channels.each { |channel| @channels[channel.identifier].channel_broadcast(clear) }
58
60
  channels.each { |channel| @channels.except!(channel.identifier) if clear }
59
61
  end
60
62
  end
@@ -66,7 +68,7 @@ module CableReady
66
68
  .reject { |channel| identifiers.any? && identifiers.exclude?(channel.identifier) }
67
69
  .reject { |channel| channel.identifier.is_a?(String) }
68
70
  .tap do |channels|
69
- channels.each { |channel| @channels[channel.identifier].broadcast_to(model, clear) }
71
+ channels.each { |channel| @channels[channel.identifier].channel_broadcast_to(model, clear) }
70
72
  channels.each { |channel| @channels.except!(channel.identifier) if clear }
71
73
  end
72
74
  end