Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Split "extra" modules into their own packages

オープン
#54 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
リファクタリング
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
fsharp, react-native

調査の方向性

まず src/extra 配下のモジュールとパッケージ境界を一覧化します。これには src/extra/react-native-sqlite-storage/Fable.ReactNativeSqlite.fs も含まれます。issue にある Helpers、DeviceInfo、react-native-fs、SQLite の例を確認し、その後、必要なパッケージ、binding、ドキュメントの変更を判断します。extras が適切な API とドキュメントによって個別に利用および発見できる状態になれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Having every possible react-native module just as an "extra" module makes using rn with fable very cumbersome

1) Versioning
  • Some of these packages depend on a specific version of react-native but here they are all available in this one single package (see for example notice of react-native-fs) and they could be easily incompatible with the current version of rn.
  • They are not compatible with Femto making it hard to find and use different versions of an "extra" package
2) Discoverability

Using the auto-opened "Helpers" module is the most unhelpful thing to have, because the user will have functions that are globally available and the only way to find them is by having to look in the source code, for example the "helper" of device info:

[<AutoOpen>]
module Helpers =
    let private deviceInfo: obj = importDefault "react-native-device-info"
    /// Gets the API level.
    let getAPILevel () : int =
        deviceInfo?getAPILevel() |> unbox
    /// Gets the application name.
    let getApplicationName () : string =
        deviceInfo?getApplicationName() |> unbox

Please replace instead with DeviceInfo as [<RequireQualifiedAccess>], i.e.

[<RequireQualifiedAccess>]
module DeviceInfo =
    let private deviceInfo: obj = importDefault "react-native-device-info"
    /// Gets the API level.
    let getAPILevel () : int =
        deviceInfo?getAPILevel() |> unbox
    /// Gets the application name.
    let getApplicationName () : string =
        deviceInfo?getApplicationName() |> unbox
3) The use of ts2fable-like constructs

Going through some of the extra packages, I still see U<...> being used instead of proper arguments, for example in here where it is not obvious how the location of the SQLite database can be instantiated from a float

4) Adhoc Bindings

for example react-native-fs now only includes two functions:

[<AutoOpen>]
module Helpers =
    [<Import("default","react-native-fs")>]
    let private fileSystem = obj()
    let deleteFile (uri:string) : unit = fileSystem?unlink(uri) |> ignore
    let getBase64File (uri:string) : JS.Promise<string> = fileSystem?readFile(uri,"base64") |> unbox

This is not helpful for the users of the library and they are better off writing these functions in their application code instead of having two random functions

5) Zero docs

Might be the biggest reason that it is hard to get started with this library, even though it has a really high potential next to electronjs that there is no docs on the "extra" packages

@forki @alfonsogarciacaro @MangelMaxime

主要言語
F#
スター
53
フォーク
11
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fable-compiler/fable-react-native のほかの issue

fable-compiler/fable-react-native の issue をすべて見る

似ている issue

DevTools の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。