proscenium 0.11.0.pre.10-aarch64-linux → 0.11.0.pre.11-aarch64-linux

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: '038f66f0d9d784307de6f1eb2b6ddfd90271a59c07378928e6a5884089c4de43'
4
- data.tar.gz: 2865311d5f4b94d10f6776973f2377fb5da27b8062f3cb9829c4a7439c902120
3
+ metadata.gz: 40875dbd593465f75a067738b21fd014699c0d5446a6909940482af9d1e0d5f4
4
+ data.tar.gz: 77236634b03b5297da87cd66dd59111f9625b08daea11ec833a9b4700387de62
5
5
  SHA512:
6
- metadata.gz: da34378a22b0e09fa417b67371ac644050dce9d714935598bec0dedfe7952c58c44eac8e1b06978682f4eb9ce35d36d23ecae096f39e8906db97a32946e3253b
7
- data.tar.gz: a1985af5d4b74b7e2d6bea34435ff7409f1d006534bd75fe044360d30ac676fa0c3ff1b452f119de36c9b0973a8b957b741591f42a83315c9a18c4d3e2fa18ba
6
+ metadata.gz: c04105e4fba44a79b0f1bf85d624e9f59e34678a966effab524ace2d5a44956c9355bd535e4e9faeea268acf14e1ec7640c91dc740d8be67e7ab3e049f738658
7
+ data.tar.gz: 88d4403b3490debccbf43dea69cd8895b987721f941a60e8adaec16090bf8198a21c3eb8c1e9317f0a13a276562a298694bec1eca8c53214033fd678a087afa6
Binary file
@@ -77,10 +77,14 @@ module Proscenium
77
77
 
78
78
  if extract_lazy_scripts
79
79
  content_for :proscenium_lazy_scripts do
80
- javascript_tag "window.prosceniumLazyScripts = #{scripts.to_json}"
80
+ tag.script type: 'application/json', id: 'prosceniumLazyScripts' do
81
+ raw scripts.to_json
82
+ end
81
83
  end
82
84
  else
83
- out << javascript_tag("window.prosceniumLazyScripts = #{scripts.to_json}")
85
+ out << tag.script(type: 'application/json', id: 'prosceniumLazyScripts') do
86
+ raw scripts.to_json
87
+ end
84
88
  end
85
89
  else
86
90
  Importer.each_javascript(delete: true) do |path, _|
@@ -1,7 +1,16 @@
1
- const elements = document.querySelectorAll("[data-proscenium-component-path]");
1
+ window.Proscenium = window.Proscenium || { lazyScripts: {} };
2
+
3
+ const element = document.querySelector("#prosceniumLazyScripts");
4
+ if (element) {
5
+ const scripts = JSON.parse(element.text);
6
+ window.Proscenium.lazyScripts = {
7
+ ...window.Proscenium.lazyScripts,
8
+ ...scripts,
9
+ };
10
+ }
2
11
 
3
- // Initialize only if there are components.
4
- elements.length > 0 && init();
12
+ const elements = document.querySelectorAll("[data-proscenium-component-path]");
13
+ elements.length > 0 && init(elements);
5
14
 
6
15
  function init() {
7
16
  /**
@@ -20,12 +29,12 @@ function init() {
20
29
  // For testing and simulation of slow connections.
21
30
  // const sim = new Promise((resolve) => setTimeout(resolve, 5000));
22
31
 
23
- if (!(path in window.prosceniumLazyScripts)) {
24
- throw `[proscenium/react/manager] Cannot load component ${path} (not found in prosceniumLazyScripts)`;
32
+ if (!window.Proscenium.lazyScripts[path]) {
33
+ throw `[proscenium/react/manager] Cannot load component ${path} (not found in Proscenium.lazyScripts)`;
25
34
  }
26
35
 
27
36
  const react = import("@proscenium/react-manager/react");
28
- const Component = import(window.prosceniumLazyScripts[path].outpath);
37
+ const Component = import(window.Proscenium.lazyScripts[path].outpath);
29
38
 
30
39
  const forwardChildren =
31
40
  "prosceniumComponentForwardChildren" in element.dataset &&
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Proscenium
4
- VERSION = '0.11.0.pre.10'
4
+ VERSION = '0.11.0.pre.11'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proscenium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0.pre.10
4
+ version: 0.11.0.pre.11
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Joel Moss
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-05 00:00:00.000000000 Z
11
+ date: 2023-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport