Skip to content

lutaml/opal-runtime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@lutaml/opal-runtime

Pure Opal runtime, extracted from a real Opal compile. Shared by @unitsml/unitsml and other Opal-compiled gems so a single Opal global exists across the dependency tree.

Why

Every Opal-compiled gem ships a copy of the Opal runtime. If a user installs two of them and loads both, two Opal globals fight for the same name — silent memory bloat in Node, undefined behavior in browsers.

A shared runtime package fixes this: each compiled gem declares @lutaml/opal-runtime as a peer dep, every consumer gets one Opal instance.

Usage (consumer)

// In an Opal-compiled gem's package.json
"peerDependencies": {
  "@lutaml/opal-runtime": "^1.0.0"
},
"peerDependenciesMeta": {
  "@lutaml/opal-runtime": { "optional": true }
}

The peer is optional: if absent, a self-contained bundle (with embedded Opal) still works for CDN users. Bundler users with shared runtime get the smaller external flavor.

Build

scripts/build.js runs Opal::Builder.build("opal/runtime-stub") and writes the resulting JS to dist/runtime.js. Single source of truth — the runtime here is what @unitsml/unitsml compiles against.

Source of truth

Built from the latest released opal gem. Maintained by the lutaml org.

About

Pure Opal runtime, extracted from real Opal compiles. Shared by @unitsml/unitsml and friends for browser/Node coexistence without double-loading.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors