Skip to content

Add native ESM entry points and runtime shims#106

Open
jasperan wants to merge 8 commits intooracle:masterfrom
jasperan:issue-93-esm-support
Open

Add native ESM entry points and runtime shims#106
jasperan wants to merge 8 commits intooracle:masterfrom
jasperan:issue-93-esm-support

Conversation

@jasperan
Copy link
Member

@jasperan jasperan commented Mar 15, 2026

Summary

Addresses #93 by making the shipped debug_esm runtime self-contained enough for native ESM loading and by exposing representative package-level ESM subpath imports.

Problem

Oracle JET already shipped a debug_esm tree, but it was not directly usable under native ESM because:

  • modules still used bare ojs/* specifiers
  • parts of the runtime still assumed AMD-style resource loading
  • package subpath imports like @oracle/oraclejet/ojkeyset were not exported
  • parts of the older converter stack still referenced the wrong namespace alias under ESM
  • theme-derived defaults could crash in non-browser hosts by touching window unconditionally

Changes

  • rewrite debug_esm imports from bare ojs/* specifiers to relative ./*.js imports
  • add dist/js/libs/oj/debug_esm/package.json with type: module
  • add package-level exports so representative installed-package ESM subpath imports resolve cleanly
  • replace AMD-plugin assumptions in config, locale, and timezone resource loading with a small runtime AMD-object loader that reads the already-shipped resource bundles
  • fix legacy oj alias references in the older converter stack so number/date converters and date validators import cleanly under ESM
  • guard theme-derived font-family parsing so non-browser hosts fall back cleanly instead of crashing

Verification

  • direct-file ESM smoke passes for representative debug_esm imports
  • installed-package Node ESM smoke checks pass across 20 representative imports covering utilities, data providers, converters, locale switching, validators, URL adapters, locale data, time utilities, and timezone utilities
  • package smoke still passes with npm pack --dry-run

Scope / Caveats

  • this PR focuses on making representative JET ESM entry points usable under native ESM without external aliasing
  • the validation matrix is broad, but still representative rather than exhaustive for every possible entry in the package
  • AMD debug and minified bundles are intentionally left untouched

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant