isorun 0.1.10-arm64-darwin → 0.1.11-arm64-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: 8500ad6077f9dd90991581e56e19f00b4ec5c7b740342d88e84f3a5f77587ef5
4
- data.tar.gz: 44e38cf5a0eaffeeeec54852e1af7600d63af31e2f89f3828362de87c797e326
3
+ metadata.gz: 57a2fe37753e1790049da7e7b825d1fb791bbb08665083c44a6e30f8bb7df7d8
4
+ data.tar.gz: 77d4571726320582a113aee3babc43a43b4b4a02e70ad534527f391a9efa4c6e
5
5
  SHA512:
6
- metadata.gz: 9595bdc80fcfa5ddb881110c0be58745c8e2cf1dc02ca696972ad99f98062c2a9af0824ea43bc73cff0093046bd6c53406ccf498c68051be5e33caca8ed008ff
7
- data.tar.gz: d75c541a4253bf22b6326b9978e972f7aaa8d18fbb734caaa53271c4da9347e24ec99fe7e294dfd5954aa2de927fd938fdcdcd95cd635bfc2efc116bc18a78f2
6
+ metadata.gz: 3142c360ab0001e088b8124a8139ff2812215b3755988d819fa2a327f5a436be5ddacea1165d4e332153a6e0c680b1db6beccb53532c1f1c5cc575ef38510028
7
+ data.tar.gz: baa2bbc03f9183f18dd966ae7e14bad63d20c37233110cbd78f7e2b09c340898ec0d0735edad4bc5809b2d2ff98883116cb447b7f20706526bae374e2d91c776
@@ -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: {}) # 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: {})
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: arm64-darwin
6
6
  authors:
7
7
  - Hannes Moser