Skip to content

[PoC]: Add platform-specific module support - #8637

Draft
fhammerschmidt wants to merge 19 commits into
fix/watch-rebuild-recoveryfrom
poc-platforms
Draft

fhammerschmidt wants to merge 19 commits into
fix/watch-rebuild-recoveryfrom
poc-platforms

Conversation

@fhammerschmidt

@fhammerschmidt fhammerschmidt commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Adds opt-in platform modules through "platforms": ["android", "ios"]. Files such as Button.android.res and Button.ios.res share Button.resi, compile to platform-specific JavaScript filenames, and are imported through the logical Button module so the configured resolver can select the correct implementation.

React Native is the driving example, but the mechanism is generic and accepts arbitrary platform names.

Standalone fixes surfaced by this work and extracted for separate review:

Fixes #1436

@fhammerschmidt fhammerschmidt changed the title Add platform-specific module support [PoC]: Add platform-specific module support Sep 9, 2026
@codecov

codecov Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.74359% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.24%. Comparing base (3e45f81) to head (e575a31).

Files with missing lines Patch % Lines
analysis/src/find_files.ml 85.36% 6 Missing ⚠️
compiler/core/lam_stats_export.ml 92.00% 2 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##           fix/watch-rebuild-recovery    #8637      +/-   ##
==============================================================
+ Coverage                       78.22%   78.24%   +0.01%     
==============================================================
  Files                             474      475       +1     
  Lines                           63512    63554      +42     
==============================================================
+ Hits                            49684    49729      +45     
+ Misses                          13828    13825       -3     
Files with missing lines Coverage Δ
analysis/src/packages.ml 76.72% <100.00%> (+0.20%) ⬆️
compiler/bsc/rescript_compiler_main.ml 71.63% <100.00%> (+0.13%) ⬆️
compiler/common/js_config.ml 75.00% <ø> (ø)
compiler/core/js_packages_info.ml 75.00% <100.00%> (+1.08%) ⬆️
...sts/ounit_tests/ounit_analysis_find_files_tests.ml 100.00% <100.00%> (ø)
tests/ounit_tests/ounit_tests_main.ml 100.00% <ø> (ø)
compiler/core/lam_stats_export.ml 91.66% <92.00%> (+0.55%) ⬆️
analysis/src/find_files.ml 82.02% <85.36%> (+4.13%) ⬆️
🚀 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 Sep 10, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

rescript

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

@rescript/belt

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

@rescript/darwin-arm64

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

@rescript/darwin-x64

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

@rescript/linux-arm64

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

@rescript/linux-x64

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

@rescript/runtime

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

@rescript/win32-x64

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

commit: e575a31

@fhammerschmidt
fhammerschmidt changed the base branch from master to fix/watch-rebuild-recovery September 10, 2026 10:59
@fhammerschmidt
fhammerschmidt added this pull request to stack #8642 September 10, 2026 10:59
@fhammerschmidt
fhammerschmidt force-pushed the fix/watch-rebuild-recovery branch from 38467bf to 527e72a Compare September 10, 2026 11:16
@fhammerschmidt
fhammerschmidt force-pushed the fix/watch-rebuild-recovery branch from 527e72a to 95cbeca Compare September 10, 2026 11:20
@fhammerschmidt
fhammerschmidt force-pushed the fix/watch-rebuild-recovery branch from 95cbeca to 08c262a Compare September 10, 2026 11:40
@fhammerschmidt
fhammerschmidt force-pushed the fix/watch-rebuild-recovery branch from 08c262a to 23913a4 Compare September 10, 2026 11:44
@fhammerschmidt
fhammerschmidt force-pushed the fix/watch-rebuild-recovery branch from 23913a4 to 4cc230a Compare September 11, 2026 13:46
@fhammerschmidt
fhammerschmidt force-pushed the fix/watch-rebuild-recovery branch from 4cc230a to 784f83f Compare September 11, 2026 13:49
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
@fhammerschmidt
fhammerschmidt force-pushed the fix/watch-rebuild-recovery branch from 52e838b to 1e2469f Compare September 11, 2026 16:41
@fhammerschmidt
fhammerschmidt force-pushed the poc-platforms branch 2 times, most recently from ba152f3 to a83b709 Compare September 11, 2026 19:45
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
Signed-off-by: Florian Hammerschmidt <florianh89@gmail.com>
@fhammerschmidt
fhammerschmidt force-pushed the fix/watch-rebuild-recovery branch from a4a65f3 to 3e45f81 Compare September 11, 2026 20:24
@fhammerschmidt
fhammerschmidt removed this pull request from stack #8642 September 11, 2026 20:25
@fhammerschmidt
fhammerschmidt added this pull request to stack #8650 September 11, 2026 20:25
@fhammerschmidt
fhammerschmidt removed this pull request from stack #8650 October 9, 2026 13:07
@fhammerschmidt
fhammerschmidt force-pushed the fix/watch-rebuild-recovery branch from 5e7c5a1 to 3377441 Compare October 9, 2026 13:09

This branch has not been deployed

No deployments
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.

Support react-native platform-specific extension

1 participant