Skip to content

refactor: move the bundle entry points to TypeScript - #702

Closed
mrholek wants to merge 1 commit into
v6-devfrom
refactor/typescript-entry-points-v6
Closed

refactor: move the bundle entry points to TypeScript#702
mrholek wants to merge 1 commit into
v6-devfrom
refactor/typescript-entry-points-v6

Conversation

@mrholek

@mrholek mrholek commented Aug 5, 2026

Copy link
Copy Markdown
Member

js/src has been fully TypeScript for a while; js/index.esm.js and js/index.umd.js were the last JavaScript left in the library sources. This converts both.

Proof it changes nothing for consumers

Rolldown reads the entry by extension, so the only build change is its input path. Built from v6-dev and from this branch, all six bundles are byte-identical:

identical: coreui.js
identical: coreui.esm.js
identical: coreui.bundle.js
identical: bootstrap.js
identical: bootstrap.esm.js
identical: bootstrap.bundle.js

The UMD global keeps its exact shape, including the OffCanvas spelling the UMD list uses (js/src/index.ts exports it as Offcanvas — untouched here, changing it would be breaking).

Typechecking

The entries get their own project (build/tsconfig.entries.json) that inherits the root config but drops declaration / isolatedDeclarations, and js-typecheck now runs both:

js-typecheck         = npm-run-all --parallel js-typecheck-src js-typecheck-entries
js-typecheck-src     = tsc --noEmit
js-typecheck-entries = tsc --project build/tsconfig.entries.json

Why the exemption: the entries are rolldown inputs, not part of the published type surface (build/tsconfig.dts.json emits from js/src only), and the UMD entry cannot satisfy those flags anyway — a default-exported object of 36 component classes is not inferable under isolatedDeclarations (TS9016), and the documented explicit-value workaround (Alert: Alert) both still fails (TS9013) and collides with object-shorthand. The eslint TypeScript block now also covers the two entries.

Also fixes the UMD banner, which named index.esm.js and repeated "Licensed under MIT (".

Verification

js-typecheck (both projects) · js-lint (0 errors) · js-test-types · js-test-integration-bundle + -modularity · js-test-unit (2978 passing, coverage 95.38 / 88.52 / 93.92 / 95.43 — unchanged) · bundles diffed against a v6-dev baseline as above.

Still JavaScript, deliberately out of scope here: the 59 unit specs (they target the Jasmine shim), build/*.mjs, eslint.config.mjs, and package.js (Meteor requires that name).

`js/src` is already fully TypeScript; `js/index.esm.js` and
`js/index.umd.js` were the last JavaScript files in the library sources.
Rolldown reads them by extension, so only its input path changes — the
six built bundles (coreui, coreui.esm, coreui.bundle and the bootstrap
counterparts) are byte-identical to v6-dev.

The entries typecheck in their own project. They are rolldown inputs,
not part of the published type surface (build/tsconfig.dts.json emits
from js/src only), so the per-file declaration constraints that keep
js/src emittable do not apply — and the UMD entry cannot satisfy them
anyway: a default-exported object of component classes is not inferable
under isolatedDeclarations, and the explicit-value workaround collides
with object-shorthand. `js-typecheck` now runs both projects.

Also fixes the UMD banner, which named the wrong file and repeated the
licence phrase.
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 31030815885

Coverage decreased (-0.007%) to 92.968%

Details

  • Coverage decreased (-0.007%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 1 coverage regression across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
js/src/navigation.ts 1 64.63%

Coverage Stats

Coverage Status
Relevant Lines: 8674
Covered Lines: 8278
Line Coverage: 95.43%
Relevant Branches: 4821
Covered Branches: 4268
Branch Coverage: 88.53%
Branches in Coverage %: Yes
Coverage Strength: 362.82 hits per line

💛 - Coveralls

@mrholek mrholek closed this Aug 5, 2026
@mrholek
mrholek deleted the refactor/typescript-entry-points-v6 branch August 5, 2026 17:41
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