Skip to content

Conversation

zth
Copy link
Member

@zth zth commented Sep 4, 2025

This adds a new test project for gentype where no shims are set up, and adds a bunch of new mappings for the stdlib that previously wasn't there.

Intention is to have a central place to add tests for all the things from the stdlib/builtins we expect gentype to map without needing shims.

Part of #7835.

@zth zth requested review from cknitt, cometkim and Copilot September 4, 2025 19:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR extends gentype support for stdlib types by adding comprehensive mappings for JavaScript built-in types without requiring TypeScript shims. It creates a new test project to verify that stdlib types can be properly mapped to their TypeScript equivalents through gentype.

  • Adds new gentype mappings for typed arrays, iterators, Intl objects, and other JS builtins
  • Creates a comprehensive test suite with no-shims configuration to validate the mappings
  • Integrates the new test project into the main build and clean processes

Reviewed Changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.

File Description
tests/gentype_tests/stdlib-no-shims/ New test project with TypeScript config, ReScript source, and build files
compiler/gentype/TranslateTypeExprFromTypes.ml Adds gentype mappings for 40+ stdlib types to their TS equivalents
Makefile Integrates new test project into build and clean targets

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@zth zth requested a review from cristianoc September 4, 2025 20:06
Copy link

pkg-pr-new bot commented Sep 4, 2025

Open in StackBlitz

rescript

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

@rescript/darwin-arm64

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

@rescript/darwin-x64

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

@rescript/linux-arm64

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

@rescript/linux-x64

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

@rescript/runtime

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

@rescript/win32-x64

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

commit: 4369f1a

Copy link
Collaborator

@cristianoc cristianoc left a comment

Choose a reason for hiding this comment

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

sweet

@zth zth merged commit e3256ba into master Sep 5, 2025
25 checks passed
@zth zth deleted the extend-gentype-shims branch September 5, 2025 06:51
@zth zth mentioned this pull request Sep 5, 2025
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