homura-runtime 0.3.17 → 0.3.19

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f26380642ac1b8cd24ca3ec08727defe9f9030ccf7b6a6cf72186b4a4aa1a56
4
- data.tar.gz: 52d666f35e258daa99364ce209ad8cb7d314d3773f6ae0828ce973802d4f2580
3
+ metadata.gz: e2ec4413e68dc202a174622d8b3d1877363ed8eaf76d5420269395879b8f6a25
4
+ data.tar.gz: f6ca4025bd4fa017110f116db7afc743c4325c4daa2471ba1c8f5bb5df0eab52
5
5
  SHA512:
6
- metadata.gz: d5f0ac5a607b868ee964750a94a0b2c858e5ebc47c50aa9c8cb5ce2c55d3a2c158ef0fcc3fd7f788fa5866686720618b6cfff1cde4c0d5e6ec88c1e86be8dbbb
7
- data.tar.gz: 31e676bbe2a40a1c8c654be6f48d2f24db4ff43022d81977e321b20ef7449eb0679899efb80ea7a9d5f42493b2e3d911d832917196d6bf5fac9b70c3caf17ca1
6
+ metadata.gz: 70e34d8b4e75fd1caa28c4eb3964c7cd45d2f2b9a94b2fd0d44f2b58d306bbefb3d95dfb4719082257267fa5b723018ee8303f168774379951a74599ecb13cc7
7
+ data.tar.gz: 6aab77ff725e260081623242a035eb552e11d4840d59fb933790821065b7068beaf9668547306d3da099cc0e186c02a246c50eaa7c1414734e84878f298f2c59
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.19 (2026-06-25)
4
+
5
+ - Add an Opal `ERB::Escape.html_escape` shim before loading Phlex. Ruby 3.4
6
+ exposes this API, while Opal's ERB currently exposes the same behavior via
7
+ `ERB::Util.html_escape`.
8
+
9
+ ## 0.3.18 (2026-06-25)
10
+
11
+ - Return a no-op Zeitwerk loader for Phlex/Literal when the generated bundle
12
+ runs on Opal. The gem tree is already compiled into the Worker, so runtime
13
+ loader setup must not inspect the original RubyGems filesystem path.
14
+
3
15
  ## 0.3.17 (2026-06-25)
4
16
 
5
17
  - Add Ruby LSP addon no-op stubs for published Phlex builds. The Workers
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "erb"
4
+
5
+ unless
6
+ ERB.const_defined?(:Escape, false)
7
+ module ERB
8
+ module Escape
9
+ def self.html_escape(value)
10
+ ERB::Util.html_escape(value)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -253,6 +253,7 @@ module HomuraRuntime
253
253
  end
254
254
 
255
255
  lines << ""
256
+ lines << "require \"erb/opal_compat\""
256
257
  lines << "require \"zeitwerk/opal_compat\""
257
258
  entry_specs.each do |spec|
258
259
  compat = OPAL_ENTRY_COMPAT_REQUIRES[spec.name]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HomuraRuntime
4
- VERSION = "0.3.17"
4
+ VERSION = "0.3.19"
5
5
  end
@@ -3,6 +3,30 @@
3
3
  require "zeitwerk"
4
4
 
5
5
  module Zeitwerk
6
+ class HomuraOpalLoader
7
+ Inflector = Struct.new(:rules) do
8
+ def inflect(overrides)
9
+ rules.merge!(overrides)
10
+ end
11
+ end
12
+
13
+ attr_reader :inflector
14
+
15
+ def initialize
16
+ @inflector = Inflector.new({})
17
+ end
18
+
19
+ def ignore(*)
20
+ end
21
+
22
+ def collapse(*)
23
+ end
24
+
25
+ def setup
26
+ self
27
+ end
28
+ end
29
+
6
30
  class << self
7
31
  attr_accessor :__homura_next_gem_root
8
32
 
@@ -26,6 +50,8 @@ module Zeitwerk
26
50
  def for_gem(warn_on_extra_files: true)
27
51
  if (root_file = Zeitwerk.__homura_next_gem_root)
28
52
  Zeitwerk.__homura_next_gem_root = nil
53
+ return Zeitwerk::HomuraOpalLoader.new if RUBY_ENGINE == "opal"
54
+
29
55
  Registry.loader_for_gem(
30
56
  root_file,
31
57
  namespace: Object,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homura-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.17
4
+ version: 0.3.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuhiro Homma
@@ -53,6 +53,7 @@ files:
53
53
  - exe/compile-assets
54
54
  - exe/compile-erb
55
55
  - exe/homura-build
56
+ - lib/erb/opal_compat.rb
56
57
  - lib/homura/runtime.rb
57
58
  - lib/homura/runtime/ai.rb
58
59
  - lib/homura/runtime/async_registry.rb