TS => MJS. Iteration 4 - #1456
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
functionalscript | d002dc1 | Commit Preview URL Branch Preview URL |
Aug 08 2026, 08:47 PM |
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
o2alexanderfedin
left a comment
There was a problem hiding this comment.
Approving at 0d28a42f. Clean iteration, and the CHANGELOG entry is there this time.
All five exported types (Sign, Compare, Cmp, Cmp1, Cmp2) were already export type in the .ts, so the typedef-visibility issue from #1453/#1454 doesn't arise here — nothing goes from private to public.
Verified rather than eyeballed:
- Every type is unchanged under a strict
Equal<A,B>check, including the conditionalCmp2<A,B>(Cmp2<number,number>→number,Cmp2<string,number>→never). - The self-referential constraint
<A extends Cmp1>(a: A) => <B extends Cmp2<A, B>>(b: B) => …survives translation, which was the part most likely to break. The rejection the docstring promises still happens:min(1)("a"),max(1)("a"),cmp(1)("a"),cmp(1)(2n)all fail withTS2345: … not assignable to parameter of type 'never', andcmp({})fails againstCmp1. index3/index5still returnIndex<3>/Index<5>—index3(...)assigned to3correctly errors withType '0 | 1 | 2' is not assignable to type '3'.npm test→pass: 2354, fail: 0, total: 2354;npx tscclean.
Follow-up: stale .f.ts paths are accumulating across the series
Not from this PR, and not blocking it — but it's now big enough to be worth one sweep. On main, 30 lines across 13 files still reference the old .f.ts path of a module that has already migrated:
AGENTS.md 2
fjs/types/object/todo/structurally-same.md 2
fjs/types/ordered_map/todo/at-nullable-map.md 2
… 10 more todo files 1 each
The two in AGENTS.md are the ones I'd fix first, since agents act on that file:
AGENTS.md:205tells you to importAssertfromfjs/asserts/module.f.tsandEqualfromfjs/types/ts/module.f.ts. Both are now.f.mjs, so following that snippet literally produces a broken import — and it's exactly the snippet someone copies when writing a type-level proof.AGENTS.md:183usesfjs/asserts/module.f.tsas its example of an unmigrated helper, which is now the opposite of true —assertsmigrated first, in #1452.
Each iteration adds a few more, so a single grep-and-fix pass at the end of stage 1 would probably be cheaper than doing it per-PR. Might be worth a line in the migration todo so it isn't forgotten.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9076ca8ef1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| `fjs/types/function/operator` migrate from authored TypeScript (`.f.ts`) to | ||
| JSDoc-typed JavaScript (`.f.mjs`) under the stage-1 TypeScript-to-mjs | ||
| migration — importers must use the `.f.mjs` specifier |
There was a problem hiding this comment.
Fix the stale operator source references
After this rename, a repo-wide search still finds todo/flow.md:241 linking to the deleted fjs/types/function/operator/module.f.ts and fjs/types/function/todo/uncurry-accumulator-types.md:13 directing readers to that old path. Following the canonical todo documentation now produces a broken link or points contributors at a nonexistent source file, so these references should be updated to .f.mjs with the other importers.
AGENTS.md reference: AGENTS.md:L10-L11
Useful? React with 👍 / 👎.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
BREAKING CHANGES. Continues the stage-1 TypeScript-to-mjs migration
(#1449) started in #1452/#1453/#1454. Migrates
fjs/types/function/comparefrom authored TypeScript (.f.ts) toJSDoc-typed JavaScript (
.f.mjs), and updates all importers to the newspecifier.
fjs/types/function/compare: same runtime exports (index3,index5,cmp,min,max,bsearch) and same types (Sign,Compare<T>,Cmp<T>,Cmp1,Cmp2<A, B>), now authored as.f.mjswith JSDoctypes
./module.f.mjs:fjs/asn.1,fjs/types/bigint,fjs/types/bit_vec,fjs/types/btree/{find,remove,set},fjs/types/number,fjs/types/ordered_map,fjs/types/range_map,fjs/types/sorted_list,fjs/types/sorted_set,fjs/types/string,and the
compareproofAny code importing this module by explicit
.f.tspath needs to update.Test plan
npm test(tsc+ full proof suite): 2354 pass, 0 fail🤖 Generated with Claude Code