rescript-lang / rescript-lang/experimental-rescript-webapi

Consider adding useful extension module

Aperta
#5 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
ReScript
Stelle
40
Fork
11
Merge medio
3g 12h
PR unite (30g)
12

Descrizione

While the aspiration of this project is to have bindings for anything available in the browser, it might be interesting consider having an additional auxiliary module.

Or to phrase it differently: some API methods are shit. Like https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement. You pass it any string and get an element back. Maybe you want to create something more specific and get a better type back like document.createElement("input") and get HTMLInputElement back.

So having something like:

type document

type htmlInputElement

@scope("document")
external createInputElement: (unit, @as("input") _) => htmlInputElement =
  "createElement"

let i = createInputElement()

The input string can't be misspelled and the return type is better.
Perhaps each current API module can have an APIExt companion module?
Let me know what you thoughts.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Esamina i moduli API esistenti e l'esempio proposto di createElement/createInputElement. Decidi l'ambito e il design degli eventuali moduli complementari APIExt; il lavoro è completato quando la struttura dei moduli prevista e gli helper tipizzati supportati sono concordati e specificati chiaramente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Ambito
frontend
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.