turbo_reflex 0.0.16 → 0.0.17

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: 28c80e662c56938687ac7ce0f9cc14365eabed39d13ff93b6ad09e2e995f695a
4
- data.tar.gz: eebeee00a0b3b4a4626d4b8fbb55eb9373746618d153369c3865b37fc0c26317
3
+ metadata.gz: f86365a7b910db792f049c211974ba0122a5186270b3bc2632f7e6408f03b934
4
+ data.tar.gz: 4896492e546d071c8901fdfb278c6f13a579e1c1f1585b2bf3df6cd9a82bd41e
5
5
  SHA512:
6
- metadata.gz: 6d58af7eea4777ff40c88e5b04449553032b28c1a35c00bea803650acbccda273d259959f23ed9150cf90d498a802f37aad9cc23222f3a23b4b55c9d8356d988
7
- data.tar.gz: 2897fe8eff7eccb32fa633248f6b9d667e09c3b33d1ad404ff53debf0551516e1f1bc4f7ce58628d6bdb385fe4b41283f86013d6d5362c7543a4e0df1e57d7ab
6
+ metadata.gz: fde5b5005749dc16c67c02492b7f540b7d05cf9f44676a502ff16c0f5f508a6acfba4cdb5988b415483a09183a29af2d57b63efec69a1de2e29f67d229da0e2d
7
+ data.tar.gz: 0e163e916462a06fe9553a7c78e867140dc0e908587f65a817d18317593d17708a8ae42fb10f2f853e7c2b423c4853ead3a29e97970159b6989b2732033048ab
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- turbo_reflex (0.0.16)
4
+ turbo_reflex (0.0.17)
5
5
  rails (>= 6.1)
6
6
  turbo-rails (>= 1.1)
7
7
  turbo_ready (>= 0.1)
@@ -222,16 +222,15 @@ GEM
222
222
  actionpack (>= 5.2)
223
223
  activesupport (>= 5.2)
224
224
  sprockets (>= 3.0.0)
225
- sqlite3 (1.5.3-aarch64-linux)
226
225
  sqlite3 (1.5.3-arm64-darwin)
227
226
  standard (1.16.1)
228
227
  rubocop (= 1.35.1)
229
228
  rubocop-performance (= 1.14.3)
230
229
  standardrb (1.0.1)
231
230
  standard
232
- tailwindcss-rails (2.0.17-aarch64-linux)
231
+ tailwindcss-rails (2.0.18-aarch64-linux)
233
232
  railties (>= 6.0.0)
234
- tailwindcss-rails (2.0.17-arm64-darwin)
233
+ tailwindcss-rails (2.0.18-arm64-darwin)
235
234
  railties (>= 6.0.0)
236
235
  thor (1.2.1)
237
236
  timeout (0.3.0)
@@ -263,7 +262,7 @@ GEM
263
262
  nokogiri (~> 1.8)
264
263
  yard (0.9.28)
265
264
  webrick (~> 1.7.0)
266
- zeitwerk (2.6.4)
265
+ zeitwerk (2.6.5)
267
266
 
268
267
  PLATFORMS
269
268
  aarch64-linux
data/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
  </h1>
9
9
  <p align="center">
10
10
  <a href="http://blog.codinghorror.com/the-best-code-is-no-code-at-all/">
11
- <img alt="Lines of Code" src="https://img.shields.io/badge/loc-1134-47d299.svg" />
11
+ <img alt="Lines of Code" src="https://img.shields.io/badge/loc-1147-47d299.svg" />
12
12
  </a>
13
13
  <a href="https://codeclimate.com/github/hopsoft/turbo_reflex/maintainability">
14
14
  <img src="https://api.codeclimate.com/v1/badges/fe1162a742fe83a4fdfd/maintainability" />
@@ -150,6 +150,8 @@ class TurboReflex::Runner
150
150
  append_meta_tag_to_response_body # called before `write_cookie` so all state is emitted to the DOM
151
151
  state_manager.write_cookie # truncates state to stay within cookie size limits (4k)
152
152
  append_success_to_response if reflex_succeeded?
153
+ rescue => error
154
+ Rails.logger.error "TurboReflex::Runner failed to update the response! #{error.message}"
153
155
  end
154
156
 
155
157
  def render_response(html: "", status: nil, headers: {TurboReflex: :Append})
@@ -236,6 +238,8 @@ class TurboReflex::Runner
236
238
  def append_meta_tag_to_response_body
237
239
  cookies.encrypted["turbo_reflex.token"] = {value: new_token, path: "/"}
238
240
  append_to_response_body turbo_stream.invoke("morph", args: [meta_tag], selector: "#turbo-reflex")
241
+ rescue => error
242
+ Rails.logger.error "TurboReflex::Runner failed to append the meta tag to the response! #{error.message}"
239
243
  end
240
244
 
241
245
  def append_success_event_to_response_body
@@ -259,8 +263,8 @@ class TurboReflex::Runner
259
263
  end
260
264
 
261
265
  def append_to_response_body(content)
266
+ return unless %i[turbo_reflex turbo_stream html].any?(request.format)
262
267
  sanitized_content = content_sanitizer.sanitize(content).html_safe
263
-
264
268
  return if sanitized_content.blank?
265
269
 
266
270
  case response_type
@@ -268,5 +272,7 @@ class TurboReflex::Runner
268
272
  when :frame then response.body.sub!(/<\/\s*turbo-frame.*>/i, "#{sanitized_content}</turbo-frame>")
269
273
  else response_body << sanitized_content
270
274
  end
275
+ rescue => error
276
+ Rails.logger.error "TurboReflex::Runner failed to append to the response! #{error.message}"
271
277
  end
272
278
  end
@@ -59,8 +59,8 @@ class TurboReflex::StateManager
59
59
  # State the server used to render the page last time
60
60
  cookie_state_hash = state.to_h
61
61
 
62
- # State managed by the server on the backend (redis, postgres, msql, etc.)
63
- # App specific, SEE: `TurboReflex::StateManager.state_override_block`
62
+ # State managed by the server on the backend (redis cache etc.)
63
+ # SEE: `TurboReflex::StateManager.state_override_block`
64
64
  server_state_hash = {}
65
65
 
66
66
  # State the client expects... related to optimistic UI updates
@@ -92,6 +92,10 @@ class TurboReflex::StateManager
92
92
  @cookie_data = cookie_state_hash
93
93
  @header_data = header_state_hash
94
94
  @server_data = server_state_hash
95
+ rescue => error
96
+ Rails.logger.error "Failed to construct TurboReflex::State! #{error.message}"
97
+ ensure
98
+ @state ||= TurboReflex::State.new
95
99
  end
96
100
 
97
101
  delegate :cache_key, :payload, to: :state
@@ -111,6 +115,8 @@ class TurboReflex::StateManager
111
115
  state.prune! max_bytesize: TurboReflex::StateManager.cookie_max_bytesize
112
116
  cookies.signed["turbo_reflex.state"] = {value: state.ordinal_payload, path: "/", expires: 1.day.from_now}
113
117
  changes_applied
118
+ rescue => error
119
+ Rails.logger.error "Failed to write the TurboReflex::State cookie! #{error.message}"
114
120
  end
115
121
 
116
122
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TurboReflex
4
- VERSION = "0.0.16"
4
+ VERSION = "0.0.17"
5
5
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turbo_reflex",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "Reflexes for Turbo Frames that help you build robust reactive applications",
5
5
  "main": "app/javascript/index.js",
6
6
  "repository": "https://github.com/hopsoft/turbo_reflex",
data/tags CHANGED
@@ -216618,7 +216618,7 @@ VDash node_modules/parse-srcset/tests/he.js /^ var decodeMap = {'Aacute':'\\xC1'
216618
216618
  VDash node_modules/simple-html-tokenizer/dist/es6/index.js /^ Aacute: "Á", aacute: "á", Abreve: "Ă", abreve: "ă", ac: "∾", acd: "∿", acE: "∾̳",/;" p variable:namedCharRefs
216619
216619
  VDash node_modules/simple-html-tokenizer/dist/simple-html-tokenizer.js /^ Aacute: "Á", aacute: "á", Abreve: "Ă", abreve: "ă", ac: "∾", acd: "∿", acE: "∾/;" p variable:anonymousFunction3825d8d70300.namedCharRefs
216620
216620
  VDash node_modules/simple-html-tokenizer/dist/types/generated/html5-named-char-refs.d.ts /^ VDash: string;$/;" C
216621
- VERSION lib/turbo_reflex/version.rb /^ VERSION = "0.0.16"$/;" C module:TurboReflex
216621
+ VERSION lib/turbo_reflex/version.rb /^ VERSION = "0.0.17"$/;" C module:TurboReflex
216622
216622
  VERSION node_modules/@angular/compiler/esm2015/src/output/source_map.js /^const VERSION = 3;$/;" C
216623
216623
  VERSION node_modules/@angular/compiler/esm2015/src/version.js /^export const VERSION = new Version('8.2.14');$/;" C
216624
216624
  VERSION node_modules/@angular/compiler/esm5/src/output/source_map.js /^var VERSION = 3;$/;" v
@@ -448859,6 +448859,7 @@ trie node_modules/parse-srcset/tests/he.js /^ var decodeMap = {'Aacute':'\\xC1',
448859
448859
  trie node_modules/simple-html-tokenizer/dist/es6/index.js /^ Aacute: "Á", aacute: "á", Abreve: "Ă", abreve: "ă", ac: "∾", acd: "∿", acE: "∾̳",/;" p variable:namedCharRefs
448860
448860
  trie node_modules/simple-html-tokenizer/dist/simple-html-tokenizer.js /^ Aacute: "Á", aacute: "á", Abreve: "Ă", abreve: "ă", ac: "∾", acd: "∿", acE: "∾/;" p variable:anonymousFunction3825d8d70300.namedCharRefs
448861
448861
  trie node_modules/simple-html-tokenizer/dist/types/generated/html5-named-char-refs.d.ts /^ trie: string;$/;" C
448862
+ trigger test/dummy/app/javascript/activity.js /^ const trigger = event.target$/;" C
448862
448863
  triggerDatepickerEvent node_modules/flowbite/dist/datepicker.js /^function triggerDatepickerEvent(datepicker, type) {$/;" f
448863
448864
  triggerEl node_modules/flowbite/dist/flowbite.js /^ triggerEl: el,$/;" p variable:anonymousFunction1adc262711b00.tab
448864
448865
  triggerEl node_modules/flowbite/dist/flowbite.js /^ triggerEl: el,$/;" p variable:anonymousFunction1adc26271400.item
@@ -468403,7 +468404,7 @@ version node_modules/yaml/dist/index.js /^ version: '1.2'$/;" p variable:defaul
468403
468404
  version node_modules/yaml/dist/test-events.js /^ version: '1.2'$/;" p variable:testEvents.anonymousObjecta2b129440205
468404
468405
  version node_modules/yaml/package.json /^ "version": "1.8.3",$/;" s
468405
468406
  version node_modules/yocto-queue/package.json /^ "version": "0.1.0",$/;" s
468406
- version package.json /^ "version": "0.0.15",$/;" s
468407
+ version package.json /^ "version": "0.0.16",$/;" s
468407
468408
  versionIncluded node_modules/prettier-standard/src/vendor/node_modules/resolve/lib/core.js /^function versionIncluded(specifierValue) {$/;" f
468408
468409
  versionIncluded node_modules/resolve/lib/core.js /^function versionIncluded(specifierValue) {$/;" f
468409
468410
  versionInfo node_modules/graphql/version.d.ts /^export const versionInfo: {$/;" C
data/yarn-error.log CHANGED
@@ -14,22 +14,22 @@ Platform:
14
14
  darwin arm64
15
15
 
16
16
  Trace:
17
- Error: canceled
18
- at Interface.<anonymous> (/Users/nathan/.asdf/installs/nodejs/16.17.0/.npm/lib/node_modules/yarn/lib/cli.js:137150:13)
19
- at Interface.emit (node:events:513:28)
20
- at Interface._ttyWrite (node:readline:1085:16)
21
- at ReadStream.onkeypress (node:readline:291:10)
22
- at ReadStream.emit (node:events:513:28)
23
- at emitKeys (node:internal/readline/utils:357:14)
24
- at emitKeys.next (<anonymous>)
25
- at ReadStream.onData (node:internal/readline/emitKeypressEvents:61:36)
26
- at ReadStream.emit (node:events:513:28)
27
- at addChunk (node:internal/streams/readable:315:12)
17
+ Error: https://registry.yarnpkg.com/-/user/org.couchdb.user:hopsoft: failed to authenticate: Could not authenticate hopsoft: bad password
18
+ at Request.params.callback [as _callback] (/Users/nathan/.asdf/installs/nodejs/16.17.0/.npm/lib/node_modules/yarn/lib/cli.js:66145:18)
19
+ at Request.self.callback (/Users/nathan/.asdf/installs/nodejs/16.17.0/.npm/lib/node_modules/yarn/lib/cli.js:140890:22)
20
+ at Request.emit (node:events:513:28)
21
+ at Request.<anonymous> (/Users/nathan/.asdf/installs/nodejs/16.17.0/.npm/lib/node_modules/yarn/lib/cli.js:141862:10)
22
+ at Request.emit (node:events:513:28)
23
+ at IncomingMessage.<anonymous> (/Users/nathan/.asdf/installs/nodejs/16.17.0/.npm/lib/node_modules/yarn/lib/cli.js:141784:12)
24
+ at Object.onceWrapper (node:events:627:28)
25
+ at IncomingMessage.emit (node:events:525:35)
26
+ at endReadableNT (node:internal/streams/readable:1358:12)
27
+ at processTicksAndRejections (node:internal/process/task_queues:83:21)
28
28
 
29
29
  npm manifest:
30
30
  {
31
31
  "name": "turbo_reflex",
32
- "version": "0.0.14",
32
+ "version": "0.0.16",
33
33
  "description": "Reflexes for Turbo Frames that help you build robust reactive applications",
34
34
  "main": "app/javascript/index.js",
35
35
  "repository": "https://github.com/hopsoft/turbo_reflex",
data/yarn.lock CHANGED
@@ -909,9 +909,9 @@ eslint@^6.8.0:
909
909
  v8-compile-cache "^2.0.3"
910
910
 
911
911
  eslint@^8.19.0:
912
- version "8.26.0"
913
- resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.26.0.tgz#2bcc8836e6c424c4ac26a5674a70d44d84f2181d"
914
- integrity sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==
912
+ version "8.27.0"
913
+ resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.27.0.tgz#d547e2f7239994ad1faa4bb5d84e5d809db7cf64"
914
+ integrity sha512-0y1bfG2ho7mty+SiILVf9PfuRA49ek4Nc60Wmmu62QlobNR+CeXa4xXIJgcuwSQgZiWaPH+5BDsctpIW0PR/wQ==
915
915
  dependencies:
916
916
  "@eslint/eslintrc" "^1.3.3"
917
917
  "@humanwhocodes/config-array" "^0.11.6"
@@ -963,9 +963,9 @@ espree@^6.1.2:
963
963
  eslint-visitor-keys "^1.1.0"
964
964
 
965
965
  espree@^9.4.0:
966
- version "9.4.0"
967
- resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.0.tgz#cd4bc3d6e9336c433265fc0aa016fc1aaf182f8a"
968
- integrity sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==
966
+ version "9.4.1"
967
+ resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.1.tgz#51d6092615567a2c2cff7833445e37c28c0065bd"
968
+ integrity sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==
969
969
  dependencies:
970
970
  acorn "^8.8.0"
971
971
  acorn-jsx "^5.3.2"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo_reflex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Hopkins (hopsoft)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-05 00:00:00.000000000 Z
11
+ date: 2022-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails