Repository navigation
Remove stdlib APIs deprecated in v12 - #9052
Conversation
Changelog💥 Breaking Change
Semantic Diff4 commits · Full page Remove stdlib APIs deprecated in v12bf4e2c5 · cknitt + Claude · Oct 26, 2026, 09:57 UTC
Review
Replace the stdlib migration fixtures with a self-contained one9ef4fe2 · cknitt + Claude · Oct 26, 2026, 09:57 UTC The StdlibMigration_* fixtures exercised the templates of the removed stdlib APIs. DeprecatedTemplates declares the same template shapes locally, so the migration tool keeps its coverage. Migrate tests to the replacement APIsfd9924f · cknitt + Claude · Oct 26, 2026, 09:57 UTC Tests and fixtures that used the removed APIs now use the replacements their migration templates name; snapshots are regenerated. Patch the test repo's bindings for the removed stdlib APIs7b0ea27 · cknitt + Claude · Oct 26, 2026, 10:10 UTC rescript-nodejs 17.0.0 and rescript-bun 2.1.0, the latest releases, call failwith and catch Exn.Error, so the rewatch test repo stopped compiling. Yarn patches replace them with throw(Failure(...)) and JsExn, which v12 accepts as well. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9052 +/- ##
==========================================
+ Coverage 81.39% 81.41% +0.01%
==========================================
Files 459 459
Lines 64548 64546 -2
==========================================
+ Hits 52542 52547 +5
+ Misses 12006 11999 -7
🚀 New features to boost your workflow:
|
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 👍 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". |
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-9052 |
Why:
v12 deprecated these APIs with migration templates, so v13 can drop
them. List.has and the Error and Exn modules are deprecated in 12.3.2
(#8807) and go as well. Reanalyze, gentype and completion no longer
name the removed modules.
Review: Why does lam_analysis lose its Lazy.from_fun case? That case
treated a call to the removed `Lazy.from_fun` as free of side effects;
no program can call it any more.
Breaking: Code using a removed API no longer compiles. Run
`rescript-tools migrate-all` with ReScript 12.3.2 before upgrading;
13.0.0 must therefore be released after 12.3.2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013ZYFYMu3AE9P1xFVCR34d1
Signed-off-by: Christoph Knittel <ck@cca.io>
The StdlibMigration_* fixtures exercised the templates of the removed stdlib APIs. DeprecatedTemplates declares the same template shapes locally, so the migration tool keeps its coverage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ZYFYMu3AE9P1xFVCR34d1 Signed-off-by: Christoph Knittel <ck@cca.io>
Tests and fixtures that used the removed APIs now use the replacements their migration templates name; snapshots are regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ZYFYMu3AE9P1xFVCR34d1 Signed-off-by: Christoph Knittel <ck@cca.io>
rescript-nodejs 17.0.0 and rescript-bun 2.1.0, the latest releases, call failwith and catch Exn.Error, so the rewatch test repo stopped compiling. Yarn patches replace them with throw(Failure(...)) and JsExn, which v12 accepts as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FrejUgZbjj4wX44oqa67V5 Signed-off-by: Christoph Knittel <ck@cca.io>
ae22d44 to
7b0ea27
Compare
Removes every standard library API that v12 deprecated, plus
List.hasand theError/Exnmodules, which 12.3.2 deprecates (#8807). After this PR, the runtime has no@deprecateditems left. #8564 already removed the items explicitly scheduled for v13.Release order: this PR may merge before 12.3.2 ships, but 13.0.0 must be released after 12.3.2. The migration templates live in the v12 stdlib, so users run
rescript-tools migrate-allon 12.3.2 before upgrading.Removed, by module:
Pervasives:raise,failwith,invalid_arg,Exit;Stdlib:Error,Exn,lazy_t,window,documentArray:copyAllWithin,copyWithinToEnd,fillAll,fillToEnd,indexOfFrom,lastIndexOfFrom,joinWith,joinWithUnsafe,sliceToEndArrayBuffer,DataView:fromBufferToEnd,fromBufferWithRange,fromArrayLikeOrIterableWithMap,sliceToEnd,TypedArray.copyWithinToEnd, …BigInt:fromStringExn,toStringWithRadix,land/lor/lxor/lnot/lsl/asr;Int/Float:*WithRadix,*WithPrecision,rangeWithOptions,Int.BitwiseJSON:parseExn*,stringify*With*,stringifyAny*With*,ClassifyList:has,headExn,getExn,getAssoc/hasAssoc/setAssoc/removeAssoc,toShuffledOption/Result/Null/Nullable:getExn,getWithDefault,mapWithDefault;Bool.fromStringExn;Lazy:force,force_val,from_fun,from_val,is_val;String:sliceToEnd,substringToEnd,unsafeReplaceRegExpBy0..3;RegExp.fromStringWithFlags;Promise.doneJsxDOM:begin_,end_,to_propsReanalyze, gentype and completion no longer reference
Error/Exn.Ecosystem: the latest releases of rescript-nodejs (17.0.0) and rescript-bun (2.1.0) still call
failwithand catchExn.Error. The rewatch test repo patches them with Yarn patches; the libraries need a release before v13. The replacements (throw(Failure(...)),JsExn) already work on v12.New tests: the 14
StdlibMigration_*fixtures in tests/tools_tests exercised templates of the removed APIs. They are replaced byDeprecatedTemplates+Migrate_Templates, which declare type, constructor, labelled-argument, inserted-argument and operator templates locally. That keeps the migration tool's coverage independent of the stdlib.🤖 Generated with Claude Code
https://claude.ai/code/session_01FrejUgZbjj4wX44oqa67V5