Support statically linked addons

Ouverte
#499 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
8/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
cmake, react-native, typescript

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.
Langage dominant
TypeScript
Étoiles
206
Forks
12
Merge moyen
4 h 35 min
PR mergées (30 j)
9

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de callstackincubator/react-native-node-api

Toutes les issues de callstackincubator/react-native-node-api

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.