rescript-lang / rescript-lang/rescript

Support react-native platform-specific extension

Open
#1,436 21 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

need feedback
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.