Status: current policy · Applies to: JS globals, 'morph' exports, and built-in components
A borrowed name is a promise. Morph only borrows a name when it can keep the promise.
Morph deliberately looks familiar. fetch is fetch, setTimeout is setTimeout, and morphState has the same call shape as React's useState. That familiarity is useful only when it is honest. This page is the rule that keeps it honest.
Name follows behavior.
A Morph API may reuse a name from the browser, Node.js, or another framework only when the observable contract is identical for every input Morph accepts. If Morph's contract differs in any way a user could notice — even one they might report as a bug — the API gets a distinct name.
When the contract is identical, the shared name is the default: it is what lets browser and Node.js code move into Morph unchanged. A different name is still allowed, but it gives up that portability for no honesty gain.
The default distinct name is the morph prefix: localStorage becomes morphStorage. The prefix is a disambiguator, not a branding requirement. A different name is allowed when it describes the concept better, as long as it does not imply the external contract. What is not allowed is the same name with a different promise.
A shared name does not require implementing every input. It requires that every input Morph accepts behaves the same.
Accepting fewer inputs is not a behavior difference, provided every rejected input fails
morph checkwith a precise error. Accepting an input and doing something different is a behavior difference.
This is why fetch, Map, Set, RegExp, Date, and URL keep their names: Morph accepts a documented subset and rejects the rest at check time. It is also why localStorage cannot: its property syntax, storage event, origin scope, and failure modes are part of the contract users rely on, and Morph cannot reproduce them.
A subset must be enforced, not aspirational. If an unsupported member slips through morph check and compiles to something else, the name is already lying.
| Counts | Does not count |
|---|---|
| Argument coercion and accepted types | Internal implementation |
| Return values and types | Performance characteristics |
| Side effects visible to the program | Storage format on disk |
| Ordering, timing, and scheduling | Debug-output destination |
| Failure behavior for accepted inputs | Log formatting details, unless documented |
| Persistence scope and cross-window behavior | Source-level code shape |
The left column is what users build on. The right column is what Morph is free to choose.
When the comparison is close, ask:
If a user who knows the original API saw Morph's behavior, could they reasonably file it as a bug?
If yes, the name is wrong. This is the test that turned useState into morphState: the call shape is similar, but the machine underneath — native signals instead of a VDOM — produces different performance instincts and different effect semantics. A user would have blamed Morph for behavior React never promised.
The morph prefix is not required for APIs Morph invents. When there is no external counterpart, there is no promise to break, so the name can be anything that describes the concept:
useWindow and Window manage native OS windows. No browser or framework has this API, so they keep their plain names. morphWindow would add noise without adding information.windowConfig is Morph's app-entry convention, not a browser object.morphShared and morphEvent are Morph-native too. They carry the prefix for family consistency with morphState and to avoid confusion with DOM events — a valid style choice, but not a requirement.Prefixing a Morph-native API is allowed. Requiring it is not the law. The law only forbids borrowing a name whose promise Morph cannot keep.
The register records every public name that mirrors an external API, plus the Morph-native names that are easy to mistake for one. It is a decision log, not a wish list, and it is updated in the same change that adds the API:
same — the observable contract is identical.subset — the name is shared; unsupported inputs are rejected by morph check.different — the contract differs, so the name changed.native — Morph invented the capability; no external counterpart.pending — the comparison is not decided yet.| External API | Origin | Morph name | Verdict | Why |
|---|---|---|---|---|
fetch |
Web | fetch |
subset | Request and response shapes match for accepted options; the rest is rejected |
setTimeout / setInterval / clearTimeout / clearInterval |
Web | same | subset | Accepted callback shapes, timing, and extra-argument forwarding match; other shapes are rejected |
requestAnimationFrame / cancelAnimationFrame |
Web | same | subset | Next-frame scheduling, timestamps, handles, one-shot callbacks, and cancellation match; multi-parameter callbacks and first-class uses are rejected (Shipped) |
isNaN, isFinite, encodeURI*, decodeURI*, atob, btoa, structuredClone, queueMicrotask |
JS / Web | same | subset | Coercion, return values, errors, clone graph semantics, and microtask FIFO order match; unsupported arities, spreads, first-class uses, and callback shapes are rejected (Shipped) |
crypto.randomUUID |
Web Crypto | same | subset | UUID v4 shape and format match; crypto is method-only and getRandomValues is rejected because typed arrays are unsupported (Shipped) |
Date, Map, Set, RegExp, URL, URLSearchParams |
JS / Web | same | subset | Documented members match; unsupported flags, shapes, and members are rejected |
localStorage |
Web | morphStorage |
different | Method-only, per-app file, no storage event, no origin scope (Shipped) |
useState |
React | morphState |
different | Native signals, no VDOM; setter and render behavior differ |
useEffect |
React | morphEffect |
different | Signal-tracked dependencies; no stale-closure model |
navigator.clipboard |
Web | morphClipboard |
different | Synchronous OS text access, no permissions or Promises, no ClipboardItem MIME types (Shipped) |
alert / confirm / prompt |
Web | morphDialog |
different | Native OS dialogs with separate title/message options, synchronous blocking, and empty-string cancellation; not page-owned browser modals (Shipped) |
| — | Morph-native | morphShared, morphEvent, useWindow, Window, windowConfig |
native | No external counterpart; names are chosen freely |
Two shipped names predate this law and are tracked as exceptions, not precedents:
CSS was a stylesheet loader, not the browser CSS namespace. CSS.load() is deprecated; the collision is being retired.console is a supported subset of the browser console. log, warn, error, info, debug, and assert ship; the remaining methods (table, dir, group, trace, count, timing) are rejected, and those gaps are audit items, not a license for new divergences.Neither justifies a new collision. A new API that mirrors one of these capabilities must follow the law.
When you add or change a public API:
same row with the fixture that proves it.morph check. Add a subset row and fail fixtures for the rejections.morph* is the default; any distinct name that does not imply the external contract is allowed. Add a different row and a "Differences from ..." section to the API page.localStorage as a second name for morphStorage. The alias recreates the promise the law exists to prevent.