Skip to content

Extract Belt into a separate @rescript/belt package - #8554

Open
cknitt wants to merge 14 commits into
masterfrom
move-belt
Open

Extract Belt into a separate @rescript/belt package#8554
cknitt wants to merge 14 commits into
masterfrom
move-belt

Conversation

@cknitt

@cknitt cknitt commented Aug 16, 2026

Copy link
Copy Markdown
Member

Summary

Extract Belt from @rescript/runtime into a separately installed, source-distributed @rescript/belt package.

  • Move Belt sources and generated artifacts into the new package
  • Remove compiler behavior that depends specifically on Belt
  • Lower array and list spreads to runtime primitives instead of Belt.*.concatMany
  • Keep Belt available in the playground and API documentation
  • Add package installation coverage for npm and pnpm
  • Separate Belt tests from the compiler/runtime test suite
  • Update affected fixtures, dependencies, tooling, and generated output

Breaking change

Belt is no longer bundled with the ReScript runtime. Projects that use Belt must install it:

npm install @rescript/belt

They must also list it in rescript.json:

{
  "dependencies": ["@rescript/belt"]
}

Existing Belt.* APIs remain available after adding the dependency.

Rewatch note

The compiler repository builds the Belt source dependency through test projects with different package output settings. Rewatch can currently reuse stale dependency artifacts when switching between those settings.

This PR explicitly cleans and rebuilds Belt where required as a temporary workaround. The underlying invalidation problem is tracked separately in #8539 and is not fixed by this PR.

Testing

  • make test
  • make test-syntax
  • make test-gentype
  • make test-analysis

Closes #8050

Related to #8539

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fab5728e03

ℹ️ 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".

Comment thread compiler/gentype/translate_type_expr_from_types.ml Outdated
Comment thread CHANGELOG.md Outdated
@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.79%. Comparing base (3f1843d) to head (0750bf7).

Files with missing lines Patch % Lines
compiler/core/outcome_printer_ns.ml 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8554      +/-   ##
==========================================
+ Coverage   75.54%   75.79%   +0.24%     
==========================================
  Files         476      476              
  Lines       62710    62680      -30     
==========================================
+ Hits        47374    47506     +132     
+ Misses      15336    15174     -162     
Files with missing lines Coverage Δ
analysis/src/semantic_tokens.ml 89.14% <100.00%> (ø)
compiler/frontend/bs_builtin_ppx.ml 90.55% <ø> (ø)
compiler/syntax/src/res_comments_table.ml 89.39% <ø> (ø)
compiler/syntax/src/res_core.ml 91.58% <ø> (+0.05%) ⬆️
compiler/syntax/src/res_diagnostics.ml 77.77% <ø> (ø)
compiler/syntax/src/res_grammar.ml 42.05% <ø> (ø)
compiler/syntax/src/res_parsetree_viewer.ml 91.10% <ø> (ø)
compiler/syntax/src/res_printer.ml 93.15% <100.00%> (ø)
compiler/core/outcome_printer_ns.ml 0.00% <0.00%> (ø)

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new

pkg-pr-new Bot commented Aug 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@8554

@rescript/belt

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/belt@8554

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@8554

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@8554

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@8554

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@8554

@rescript/runtime

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@8554

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@8554

commit: 0750bf7

@github-actions

Copy link
Copy Markdown

@cknitt

cknitt commented Aug 16, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60b8ecb78b

ℹ️ 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".

Comment thread Makefile
@cknitt

cknitt commented Aug 16, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: a026aa0324

ℹ️ 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".

cknitt added 14 commits August 17, 2026 10:51
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
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.

Split off Belt into a separate package

1 participant