Skip to content

Serve JavaScript and WebAssembly modules by default - #72

Merged
ioquatix merged 4 commits into
mainfrom
serve-mjs-static-assets
Aug 14, 2026
Merged

Serve JavaScript and WebAssembly modules by default#72
ioquatix merged 4 commits into
mainfrom
serve-mjs-static-assets

Conversation

@samuel-williams-shopify

@samuel-williams-shopify samuel-williams-shopify commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • introduce a :scripts MIME group containing .js, .mjs, and .wasm
  • include :scripts in the default static extensions
  • serve JavaScript modules as text/javascript
  • serve WebAssembly modules as application/wasm
  • add MIME grouping and end-to-end static serving coverage

This fixes ESM dependencies such as Mermaid whose entry point and chunks use the .mjs extension, and supports packages which load WebAssembly modules. Previously these files could exist under the static root but fall through to the application and return 404.

Validation

  • bundle exec sus
  • bundle exec sus test/utopia/static.rb
  • bundle exec rubocop lib/utopia/static/mime_types.rb test/utopia/static.rb

@samuel-williams-shopify samuel-williams-shopify changed the title Serve JavaScript modules by default Serve JavaScript and WebAssembly modules by default Aug 14, 2026
@ioquatix
ioquatix merged commit 4a88f47 into main Aug 14, 2026
34 of 38 checks passed
@ioquatix
ioquatix deleted the serve-mjs-static-assets branch August 14, 2026 22:50
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.

2 participants