Support statically linked addons

Aperta
#499 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
8/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cmake, react-native, typescript

Direzione di ricerca

This is a design discussion, not a patch: the issue asks how addons can be linked statically rather than loaded via dlopen (see #498). Read the four questions in the body (entry-point collisions, registration, the cmake-rn and ferric build outputs, and Node-API symbol resolution through weak-node-api or a Hermes stub) and the linked #263. Done means a written proposal that answers them, not code.

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

Descrizione

enhancement Linking 🔗

Tracks interest in addons statically linked into the app, as opposed to loaded from a dynamic library. Node.js offers this through process._linkedBinding("foo"), for addons registered at startup. Originally raised in #263.

This isn't planned. It needs significant design work, so please add a 👍 or describe your use case if you'd need it.

It doesn't fit dlopen(module, filename) (#498), because there's no library to open. Some of the questions a design would have to answer:

  • Entry points: every addon exports the same napi_register_module_v1 symbol, so two addons would collide when linked into one binary.
  • Registration: how an addon registers itself and under what name, given that napi_module_register is deprecated.
  • Build: what cmake-rn and ferric produce, and how link gets it into the app, since today's prebuilds are dynamic libraries.
  • Node-API symbols: how a static addon reaches Node-API, with weak-node-api or a Hermes stub.
Lingua principale
TypeScript
Stelle
206
Fork
12
Merge medio
4h 35m
PR unite (30g)
9

Preparare l'ambiente

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.

Altre issue di callstackincubator/react-native-node-api

Tutte le issue di callstackincubator/react-native-node-api

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.