Split "extra" modules into their own packages
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Refatoração
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Estagnada
- Stack de tecnologia
- fsharp, react-native
- Domínio
- developer-experience, documentation, mobile
Direção de pesquisa
Comece fazendo um inventário dos módulos em src/extra e dos limites dos pacotes, incluindo src/extra/react-native-sqlite-storage/Fable.ReactNativeSqlite.fs. Revise os exemplos de Helpers, DeviceInfo, react-native-fs e SQLite na issue e, em seguida, determine as mudanças necessárias nos pacotes, bindings e na documentação. A tarefa estará concluída quando os extras puderem ser usados e descobertos separadamente com APIs e documentação apropriadas.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- F#
- Estrelas
- 53
- Forks
- 11
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de fable-compiler/fable-react-native
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
fable-compiler/fable-react-native#65 · 3 comentários ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
fable-compiler/fable-react-native#60 · 2 comentários ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
fable-compiler/fable-react-native#59 · 8 comentários ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
fable-compiler/fable-react-native#53 · 1 comentário ·
-
Working with gesturesAberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
fable-compiler/fable-react-native#37 · 2 comentários ·
Todas as issues de fable-compiler/fable-react-native
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
eliasstravik/herdr-projects#787 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
code-yeongyu/oh-my-openagent#12784 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
`jiti/register`: `import.meta.resolve()` throws `ReferenceError: jitiESMResolve is not defined`Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 71/100
btclib-org/btclib#2964 ·
Mantenedores costumam responder em até 1 dia