Skip to content

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

Draft
fhammerschmidt wants to merge 3 commits into
masterfrom
poc-platforms
Draft

[PoC]: Add platform-specific module support#8637
fhammerschmidt wants to merge 3 commits into
masterfrom
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 React Native’s resolver can select the correct implementation.

React Native is only the driving example here but the mechanism is of course fully generic and works with arbitrary platform names.

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 77.60%. Comparing base (d90b96a) to head (12749a6).

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             @@
##           master    #8637      +/-   ##
==========================================
+ Coverage   77.58%   77.60%   +0.01%     
==========================================
  Files         475      476       +1     
  Lines       64062    64104      +42     
==========================================
+ Hits        49704    49749      +45     
+ Misses      14358    14355       -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.

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