isorun 0.1.10-x86_64-darwin → 0.1.11-x86_64-darwin

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: b10388064f0cdc9a8c10a6d921ef1b52f1150c98f4341ebc347110643a74bee2
4
- data.tar.gz: 2d28a5e195cc18b77e8fba3cad8373575eda620742670573f863ef7aa9bffe21
3
+ metadata.gz: 9d6862deb0b2c6aaa169054ece3dff2a1d76c27b0ecbabc0fb2f337c0210148f
4
+ data.tar.gz: f9816807a82dd1af1e2686d7e5644fbbce115240350d1e7253dc52acd0a9f423
5
5
  SHA512:
6
- metadata.gz: f886b4a0529f427c4aabfbc15c61add93d123b2d2793e748bd1cb6a69c86291c820b62959b406448dd63d0a709d5132bcf3c0a73955a940644a7458fe5e1a9c0
7
- data.tar.gz: bd80d25c4dd896f04f1edc837971535c3cf562238747cafa18a134bd092e2f2123c03fb61b7597bd2638c520abf398cbe02817ed1eca964056a039dc8b23c189
6
+ metadata.gz: 53ca71b6f83d3aeb0a90dabbf2a011fb3c1fadad821a3fabf14937c52982722b2767c4329270f30ad7e26f1397957f0371c92508ac3002bd49f70c6b29fc59d5
7
+ data.tar.gz: adf35205d4454c0e4efe0ee099719babccc10d7950d0772f9eb8b9247898843f2a4b90a919e21d94ec8d8eae21202970c8c6398b22d3fdcbb26f05405a7ea4d8
@@ -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?
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "isorun"
3
- version = "0.1.10"
3
+ version = "0.1.11"
4
4
  edition = "2021"
5
5
  authors = ["Hannes Moser <box@hannesmoser.at>"]
6
6
  homepage = "https://github.com/eliias/isorun"
Binary file
Binary file
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Isorun
4
- VERSION = "0.1.10"
4
+ VERSION = "0.1.11"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isorun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: x86_64-darwin
6
6
  authors:
7
7
  - Hannes Moser