Skip to content

TS => MJS. Iteration 6 - #1460

Merged
sergey-shandar merged 5 commits into
mainfrom
bit-vec
Aug 9, 2026
Merged

TS => MJS. Iteration 6#1460
sergey-shandar merged 5 commits into
mainfrom
bit-vec

Conversation

@sergey-shandar

Copy link
Copy Markdown
Contributor

Continues the .ts => .mjs migration.

Converted modules

  • fjs/types/bit_vec/module.f.ts => fjs/types/bit_vec/module.f.mjs

TypeScript type declarations are replaced by JSDoc (@typedef, @template, @import, @type), and all importers across the repo are updated to point at the new .mjs path.

🤖 Generated with Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
functionalscript 43ff84f Commit Preview URL

Branch Preview URL
Aug 09 2026, 01:45 AM

Comment thread fjs/ci/proof.f.ts Fixed
Comment thread fjs/types/uint8array/proof.f.ts Fixed
@sergey-shandar
sergey-shandar marked this pull request as draft August 9, 2026 01:42
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@o2alexanderfedin o2alexanderfedin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. Clean single-module migration: fjs/types/bit_vec as a proper rename (no stray add-without-delete), CHANGELOG entry present, npx tsc clean, npm testpass: 2354, fail: 0, total: 2354.

No export loss. I checked this the reliable way rather than by pattern-matching the source — importing all 24 names that main exports, from the new .mjs, compiles clean. (A regex comparison suggested BitOrder, PopFront, Reduce, Unpacked and Vec had gone missing; they hadn't — the typedef form just doesn't match the same pattern. Worth saying explicitly so it isn't mistaken for a finding.)

Type visibility — the largest instance so far

Six types declared without export in the .ts are public as JSDoc typedefs:

Norm  NormOp  Base  UnpackConcat  ListToVecState  ListToVecOp

Verified both directions — 6 errors importing them from module.f.ts on main, 0 errors importing them from module.f.mjs here.

Same non-blocking observation as Fn (#1453), X (#1454) and NotLazy/Empty/Concat (#1458), and I'm not asking you to change anything in this PR. But the running total is now 11 previously-private types promoted to public API across four iterations, and this batch is the least comfortable: Base, Norm and ListToVecState are internal implementation vocabulary — Base especially is a name you'd want available for something else later.

Since these are genuinely invisible in review (nothing errors, nothing fails, the diff looks like a faithful translation), they'll keep accruing silently for the rest of stage 1. A line in the migration doc settling it once — "unexported type aliases become public on migration; accepted" or "audit and re-privatize before stage 1 closes" — would cost less than deciding it per module, and would give a later cleanup pass something concrete to work from.

CI was still mid-run when I checked (15 pending, 1 neutral, 3 green); I'd expect it to settle, given the local suite is green.

@sergey-shandar

Copy link
Copy Markdown
Contributor Author

Approving. Clean single-module migration: fjs/types/bit_vec as a proper rename (no stray add-without-delete), CHANGELOG entry present, npx tsc clean, npm testpass: 2354, fail: 0, total: 2354.

No export loss. I checked this the reliable way rather than by pattern-matching the source — importing all 24 names that main exports, from the new .mjs, compiles clean. (A regex comparison suggested BitOrder, PopFront, Reduce, Unpacked and Vec had gone missing; they hadn't — the typedef form just doesn't match the same pattern. Worth saying explicitly so it isn't mistaken for a finding.)

Type visibility — the largest instance so far

Six types declared without export in the .ts are public as JSDoc typedefs:

Norm  NormOp  Base  UnpackConcat  ListToVecState  ListToVecOp

Verified both directions — 6 errors importing them from module.f.ts on main, 0 errors importing them from module.f.mjs here.

Same non-blocking observation as Fn (#1453), X (#1454) and NotLazy/Empty/Concat (#1458), and I'm not asking you to change anything in this PR. But the running total is now 11 previously-private types promoted to public API across four iterations, and this batch is the least comfortable: Base, Norm and ListToVecState are internal implementation vocabulary — Base especially is a name you'd want available for something else later.

Since these are genuinely invisible in review (nothing errors, nothing fails, the diff looks like a faithful translation), they'll keep accruing silently for the rest of stage 1. A line in the migration doc settling it once — "unexported type aliases become public on migration; accepted" or "audit and re-privatize before stage 1 closes" — would cost less than deciding it per module, and would give a later cleanup pass something concrete to work from.

CI was still mid-run when I checked (15 pending, 1 neutral, 3 green); I'd expect it to settle, given the local suite is green.

What if we agree on conventions: if a type has the _ prefix, then we can consider it a private type, and changing such a type shouldn't be considered a breaking change?

@sergey-shandar
sergey-shandar marked this pull request as ready for review August 9, 2026 01:52
@sergey-shandar
sergey-shandar added this pull request to the merge queue Aug 9, 2026
Merged via the queue into main with commit 2fa1f6d Aug 9, 2026
19 checks passed
@sergey-shandar
sergey-shandar deleted the bit-vec branch August 9, 2026 01:55
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