mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 21:03:47 -10:00
QuickJS has no Intl, so toLocaleString or Intl.NumberFormat threw "Intl is not defined" off a Mac. FormatJS's polyfills (MIT) and the CLDR data they carry (Unicode-3.0) are packed in runtime/jsengine/js/intl.pack (2.2 MB, deflate; js/intl build.ts, versions pinned), and js/intl/loader.js runs the core the first time anything reads Intl or calls a toLocale* method, and a locale's data the first time something asks for it, so a script that never formats pays nothing. A small Collator (letters, then accents, then case) backs localeCompare. quickjs_formats_as_javascriptcore_does: fourteen cases give JavaScriptCore's answers, and on a Mac it asks JavaScriptCore too. Apple builds are unchanged.
31 lines
1.1 KiB
TOML
31 lines
1.1 KiB
TOML
[package]
|
|
name = "raea-runtime-jsengine"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
license = "FSL-1.1-ALv2"
|
|
publish = false
|
|
description = "raea's one JS engine seam (docs/ports.feature PT0b): JavaScriptCore on Apple, QuickJS elsewhere, behind one trait every host uses"
|
|
|
|
[lib]
|
|
name = "raea_runtime_jsengine"
|
|
|
|
[features]
|
|
# QuickJS on Apple too, beside JavaScriptCore: how the portable path is tested on a Mac
|
|
portable = ["dep:rquickjs", "dep:miniz_oxide", "dep:iana-time-zone"]
|
|
|
|
[dependencies]
|
|
raea-io-home = { path = "../../io/home" }
|
|
rquickjs = { version = "0.14", optional = true, features = ["loader"] }
|
|
# QuickJS's Intl (js/intl): its pack's chunks are raw deflate, and the date polyfill's default zone is the system's
|
|
miniz_oxide = { version = "0.8", optional = true }
|
|
iana-time-zone = { version = "0.1", optional = true }
|
|
|
|
[target.'cfg(target_vendor = "apple")'.dependencies]
|
|
# JavaScriptCore's Objective-C module loader (JSScript, JSModuleLoaderDelegate): ES modules on the system engine
|
|
objc2 = "0.6"
|
|
|
|
[target.'cfg(not(target_vendor = "apple"))'.dependencies]
|
|
rquickjs = { version = "0.14", features = ["loader"] }
|
|
miniz_oxide = "0.8"
|
|
iana-time-zone = "0.1"
|