Migrate deprecated Js.* APIs, extract keyboard handlers, fix loose ends#28
Closed
hyperpolymath wants to merge 1 commit intomainfrom
Closed
Migrate deprecated Js.* APIs, extract keyboard handlers, fix loose ends#28hyperpolymath wants to merge 1 commit intomainfrom
hyperpolymath wants to merge 1 commit intomainfrom
Conversation
Quick fixes: - Remove Chapel references from WORKPLAN (replaced by Zig solvers) - Update OPUS-TODO.adoc tracking table (P1 README partial, P2 mapBounded partial) - Triage stale 2026-02-22 session todos (detection cones done, knockdown still open) - Remove #/editor hash route stub from UMS main.js (editor deferred beyond MVP) - Bump ratatui 0.29→0.30 in escape-hatch Cargo.toml (resolves lru vuln) Migrations: - Migrate ~945 deprecated Js.Dict/Console/log/String2/Array2/Math/Float/Int/ Promise/Nullable calls to @rescript/core equivalents across 67 files - Replace 7 Belt.Array.getExn calls with Belt.Array.getUnsafe (all bounds-checked) - Rewrite State.res deserializeState with JSON.Classify.classify - Extract 5 duplicated %raw keyboard handler blocks to new KeyboardNav.res utility (addKeydownHandler, removeKeydownHandler, removeFromRef, eventKey, preventDefault); refactor WorldBuilder, TrainingBase, TrainingMenuScreen, VictoryScreen, GameOverScreen to use it Documentation: - Update LOOSE-ENDS.md with completion status for all resolved items - Update STATE.scm (v1.7.0→v1.8.0): completed-migrations section, updated critical-next-actions, new recent-changes entry https://claude.ai/code/session_01Rxhv9LRQ1Xq5GWGx5CnYr7
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5ed90be73
ℹ️ 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".
hyperpolymath
added a commit
that referenced
this pull request
Mar 2, 2026
Five screens had identical %raw keyboard event handler patterns (addEventListener/removeEventListener/key extraction). Extract into src/app/utils/KeyboardNav.res for reuse. Part of #28. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
Mar 2, 2026
Refactor 5 screens to use the shared KeyboardNav module instead of duplicated %raw addEventListener/removeEventListener/key blocks. Files: GameOverScreen, VictoryScreen, WorldBuilder, TrainingBase, TrainingMenuScreen. Part of #28. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
Mar 2, 2026
Replace deprecated Js.Dict API with modern Dict equivalents: - Js.Dict.empty() -> Dict.make() - Js.Dict.get/set -> Dict.get/set - Js.Dict.entries -> Dict.toArray - Js.Dict.keys -> Dict.keysToArray - Js.Dict.t<X> -> dict<X> Part of #28. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
Mar 2, 2026
Replace deprecated Js.Dict API with modern Dict equivalents in Coprocessor, Coprocessor_IO, DLCLoader, Kernel_Crypto, Kernel_Quantum, and ResourceAccounting. Part of #28. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
Mar 2, 2026
Replace deprecated Js.Dict in enemies/, screens/, multiplayer/, popups/, player/, proven/, ui/, and utils/. Part of #28. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
Mar 2, 2026
…ces) Replace deprecated Js.Math API with modern Math equivalents: - Js.Math.floor_float -> Math.floor - Js.Math.sqrt/sin/cos/atan2 -> Math.* - Js.Math.max_float/min_float -> Math.max/min - Js.Math._PI -> Math.Constants.pi - Js.Math.random -> Math.random - Js.Math.abs_float -> Math.abs Part of #28. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
Mar 2, 2026
Replace deprecated Js.String2 API with modern String equivalents: - startsWith, length, includes, toLowerCase, toUpperCase Part of #28. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
Mar 2, 2026
Replace deprecated Js.Json API with modern JSON equivalents: - Js.Json.classify -> JSON.Classify.classify (with new variant names) - Js.Json.string/number -> JSON.Encode.string/float - Js.Json.object_/array -> JSON.Encode.object/array - Js.Json.parseExn/stringify -> JSON.parseExn/stringify - Js.Json.t -> JSON.t - JSONString/JSONNumber/JSONObject/JSONArray -> String/Number/Object/Array Part of #28. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
Mar 2, 2026
…ces) Replace deprecated APIs: - Js.Console.log/error -> Console.log/error - Js.Float.toFixedWithPrecision -> Float.toFixedWithPrecision - Js.Float.isFinite -> Float.isFinite Part of #28. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
Mar 2, 2026
Chapel was removed from the project on 2026-02-27. Part of #28. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
auto-merge was automatically disabled
March 2, 2026 19:48
Pull request was closed
Owner
Author
Completed (tracked
|
| Migration | Files | Occurrences |
|---|---|---|
| KeyboardNav utility extracted | 5 screens + 1 new | 5 duplicated %raw blocks eliminated |
Js.Dict → Dict |
36 files | ~178 occurrences |
Js.Math → Math |
33 files | 118 occurrences |
Js.String2 → String |
21 files | 107 occurrences |
Js.Array2 → Array |
— | 31 occurrences |
Js.Json → JSON |
1 file (DLCLoader) | 53 occurrences |
Js.Float → Float |
14 files | 35 occurrences |
Js.Console → Console |
(included above) | — |
Js.Global.setTimeout → setTimeout |
1 file | 1 occurrence |
| Chapel removed from credits | 1 file | — |
Out of scope (untracked dirs)
These remain for a future issue once vm/, shared/ (non-git), main-game/ are committed:
Belt.Array.getExn→Array.getUnsafeinvm/(6 occurrences)vm/lib/ocaml/State.resrewrite withJSON.Classify.classifyescape-hatchratatui bump- UMS
#/editorroute stub
STATE.scm updated to v1.9.0.
hyperpolymath
added a commit
that referenced
this pull request
Mar 2, 2026
…for migration period - Update actions/upload-artifact, github/codeql-action, trufflesecurity/trufflehog, editorconfig-checker to current SHA pins - Add SECURITY.md (required by OpenSSF Scorecard) - Exclude legacy src/engine/ and src/app/ TypeScript from anti-pattern check (tracked in issue #28 for ReScript migration) - Tolerate package-lock.json alongside deno.json during migration - Tolerate tsconfig.json alongside rescript.json during migration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quick fixes:
Migrations:
Documentation:
https://claude.ai/code/session_01Rxhv9LRQ1Xq5GWGx5CnYr7