Skip to content

Allow custom Ruby WASM URLs in the browser script loader - #672

Draft
ledsun wants to merge 2 commits into
ruby:mainfrom
ledsun:add-data-ruby-wasm-url
Draft

ledsun wants to merge 2 commits into
ruby:mainfrom
ledsun:add-data-ruby-wasm-url

Conversation

@ledsun

@ledsun ledsun commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Allow users to run a custom Ruby WASM binary containing additional gems with the existing browser script loader:

<script
  src="./browser.script.iife.js"
  data-ruby-wasm-url="./ruby-with-custom-gems.wasm"
></script>

For WASI Preview 1, data-ruby-wasm-url replaces the default ruby+stdlib.wasm URL. Relative URLs resolve against the HTML page URL. Omitting the attribute preserves the existing CDN behavior. Empty values and surrounding whitespace are rejected, and load or compilation failures do not fall back to the CDN.

The attribute parsing is isolated in parseDataRubyWasmUrl(). The README includes a custom-gem example, and ten individual browser tests cover URL selection, Ruby startup, invalid values, and failures.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant