homura-runtime 0.2.26 → 0.2.27
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/CHANGELOG.md +10 -0
- data/lib/cloudflare_workers/version.rb +1 -1
- data/lib/cloudflare_workers.rb +7 -12
- 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: 17f9647265dd18252adf1bcfc4f73951db2b8c3300bf8e8fceb2e4a28d18ddd0
|
|
4
|
+
data.tar.gz: 0af103cb85483f3d2ecc3164579c0d8b784c2c0ece8cc8d584dd50735796cbb2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 911fee8fad91bdf26588b4f926c2edcae0d6f523dd43dfc571c8767a53acfc9b03214041e8f840d248072e16888cf3841dcb6ab67ae1d10d10b7d6f31772219d
|
|
7
|
+
data.tar.gz: 6c39b38063e532c3206ab0ebe027c234654908161d7e25934f618e26ebcd3efacd4b15a5baf2642e9f7d11cfec50d2e9ad40979c9b5ea0a89511d88547cb341e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.27 (2026-04-29)
|
|
4
|
+
|
|
5
|
+
- `Rack::Handler::CloudflareWorkers.run` now goes through
|
|
6
|
+
`ensure_dispatcher_installed!` instead of duplicating the JS
|
|
7
|
+
install snippet. Single source of truth for the dispatcher
|
|
8
|
+
installation; `@dispatcher_installed` correctly tracks the state
|
|
9
|
+
even when `run` is the first caller. Functionally identical from
|
|
10
|
+
the user's point of view (dispatcher ends up in `globalThis`
|
|
11
|
+
either way) — Copilot review on PR #34 spotted the duplication.
|
|
12
|
+
|
|
3
13
|
## 0.2.26 (2026-04-29)
|
|
4
14
|
|
|
5
15
|
- `Rack::Handler::CloudflareWorkers#call`: when `@app` is nil, fall
|
data/lib/cloudflare_workers.rb
CHANGED
|
@@ -126,7 +126,7 @@ module Rack
|
|
|
126
126
|
|
|
127
127
|
def self.run(app, **_options)
|
|
128
128
|
@app = app
|
|
129
|
-
|
|
129
|
+
ensure_dispatcher_installed!
|
|
130
130
|
app
|
|
131
131
|
end
|
|
132
132
|
|
|
@@ -190,18 +190,13 @@ module Rack
|
|
|
190
190
|
class << self
|
|
191
191
|
private
|
|
192
192
|
|
|
193
|
+
# Legacy alias, kept so out-of-tree code calling
|
|
194
|
+
# `Rack::Handler::CloudflareWorkers.send(:install_dispatcher)`
|
|
195
|
+
# keeps working. New code should go through
|
|
196
|
+
# `ensure_dispatcher_installed!` (it's idempotent and tracks
|
|
197
|
+
# state via `@dispatcher_installed`).
|
|
193
198
|
def install_dispatcher
|
|
194
|
-
|
|
195
|
-
`
|
|
196
|
-
globalThis.__HOMURA_RACK_DISPATCH__ = async function(req, env, ctx, body_text) {
|
|
197
|
-
return await #{handler}.$call(req, env, ctx, body_text == null ? "" : body_text);
|
|
198
|
-
};
|
|
199
|
-
(function () {
|
|
200
|
-
var g = globalThis;
|
|
201
|
-
g.__OPAL_WORKERS__ = g.__OPAL_WORKERS__ || {};
|
|
202
|
-
g.__OPAL_WORKERS__.rack = g.__HOMURA_RACK_DISPATCH__;
|
|
203
|
-
})();
|
|
204
|
-
`
|
|
199
|
+
ensure_dispatcher_installed!
|
|
205
200
|
end
|
|
206
201
|
|
|
207
202
|
# Build a Rack-compliant env Hash from a Cloudflare Workers Request.
|