isorun 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/helpers/isorun/app_helper.rb +3 -2
- data/app/helpers/isorun/vite_app_helper.rb +3 -2
- data/ext/isorun/Cargo.toml +1 -1
- data/lib/isorun/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 724881750024f3660d4f7219113d5fe5a13bdb53c5e31edf8cad5bb4ef5bb5ff
|
4
|
+
data.tar.gz: 156a1e08ccf8613c5652c7414c305d2d55c3080de11a6414f07e72817dc48240
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09398ad2ec130ec4a559a3bf78d063c0b6a5c15cc0cf7ad6b745048598c6eb4b8f3add11e3c2e58f841d78f802ff13ebfd13b4017a50c8f14a8cd396a84161b9'
|
7
|
+
data.tar.gz: cc650db902d6c942ec49743f76543a1812b5ef3772f953796902a27919a4ffd4a375ab0d5fc7c48c2d0bdc06ec44a96ff47993a9ca7a5e321eb10432208deced
|
@@ -19,14 +19,15 @@ module Isorun
|
|
19
19
|
# convention, the target node (e.g. `<div id="my_app">`)
|
20
20
|
# @param [Hash] options All valid tag options can also passed as options
|
21
21
|
# to this method
|
22
|
+
# @param [Hash, nil] ctx Pass variables to render context
|
22
23
|
# @return [String]
|
23
|
-
def isorun_app(id, options = nil) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
24
|
+
def isorun_app(id, options = nil, ctx: nil) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
24
25
|
ActiveSupport::Notifications.instrument "start.render.isorun", { ts: Time.current }
|
25
26
|
|
26
27
|
module_path = Isorun.config.module_resolver.call(id)
|
27
28
|
|
28
29
|
ssr_html = Isorun::Context.create(receiver: Isorun.config.receiver) do |context|
|
29
|
-
render_context = { environment: Rails.env.to_s }
|
30
|
+
render_context = { environment: Rails.env.to_s }.merge(ctx)
|
30
31
|
render_function = context.import.from(module_path)
|
31
32
|
|
32
33
|
if render_function.blank?
|
@@ -20,8 +20,9 @@ module Isorun
|
|
20
20
|
# convention, the target node (e.g. `<div id="my_app">`)
|
21
21
|
# @param [Hash] options All valid tag options can also passed as options
|
22
22
|
# to this method
|
23
|
+
# @param [Hash, nil] ctx Pass variables to render context
|
23
24
|
# @return [String]
|
24
|
-
def isorun_vite_app(id, options = nil)
|
25
|
+
def isorun_vite_app(id, options = nil, ctx: nil)
|
25
26
|
ActiveSupport::Notifications.instrument "start.render.isorun", { ts: Time.current }
|
26
27
|
|
27
28
|
# if id has a file extension, we extract the extension and reduce the ID
|
@@ -32,7 +33,7 @@ module Isorun
|
|
32
33
|
module_path = Isorun.config.module_resolver.call(id)
|
33
34
|
|
34
35
|
ssr_html = Isorun::Context.create(receiver: Isorun.config.receiver) do |context|
|
35
|
-
render_context = { environment: Rails.env.to_s }
|
36
|
+
render_context = { environment: Rails.env.to_s }.merge(ctx)
|
36
37
|
render_function = context.import.from(module_path)
|
37
38
|
|
38
39
|
if render_function.blank?
|
data/ext/isorun/Cargo.toml
CHANGED
data/lib/isorun/version.rb
CHANGED