rescript-lang / rescript-lang/rescript
Support react-native platform-specific extension
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 7.5k
- Forks
- 485
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 55
Description
From the react-native docs:
For example, say you have the following files in your project:
BigButton.ios.js
BigButton.android.js
You can then require the component as follows:const BigButton = require('./BigButton');
This works since react-native ships a custom javascript bundler by default.
It would be good to have the possibility to generate such file names with bucklescript. Probably some sort of name mangling would be necessary.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the compiler generates JavaScript filenames and review the linked React Native platform-specific extensions documentation. Determine how platform suffixes such as .ios.js and .android.js should be represented and generated, then verify that a component can be required without the suffix as in the example. No specific source file or test is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, ocaml, react-native
- Domain
- compilers, mobile-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100