Unblock the disabled node-addon-examples (lambdas, `noexcept`, output paths)

Aperta
#423 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cmake, cpp, nodejs

Direzione di ricerca

Inizia da packages/node-addon-examples/scripts/copy-examples.mts e riproduci un esempio lambda disabilitato per acquisire l’errore del compilatore. Poi esamina la traduzione da gyp-to-cmake e i percorsi di output per i casi noexcept e require-path. Il lavoro è completato quando i tre blocchi sono stati risolti indipendentemente e gli esempi interessati possono essere abilitati e compilati con i percorsi previsti.

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

Descrizione

gyp-to-cmake

packages/node-addon-examples/scripts/copy-examples.mts carries a list of upstream examples we deliberately skip. Most entries are disabled for reasons we accept and won't fix (they use worker_threads, process.argv, node:events, uv.h, or bring their own CMake project). Five carry TODOs instead — i.e. we intend to enable them:

https://github.com/callstackincubator/react-native-node-api/blob/29a527d87fa8cb965b0048b1b4c1cff2b0eab281/packages/node-addon-examples/scripts/copy-examples.mts#L19-L28

https://github.com/callstackincubator/react-native-node-api/blob/29a527d87fa8cb965b0048b1b4c1cff2b0eab281/packages/node-addon-examples/scripts/copy-examples.mts#L38-L40

Three distinct blockers:

  1. Lambda functions — blocks 1-getting-started/6_object_wrap/napi/, 1-getting-started/7_factory_wrap/napi/ and 2-js-to-native-conversion/8_passing_wrapped/napi/. Three examples for one fix, so this is the highest-value of the three.
  2. noexcept — blocks 2-js-to-native-conversion/object-template-demo/napi/.
  3. Output-directory mismatch — as the TODO notes, gyp-to-cmake should produce projects whose output directory matches what gyp would have produced, so that examples with a require pointing at the conventional gyp path resolve. That would unblock 5-async-work/napi-asyncworker-example/node-addon-api/ and 6-threadsafe-function/promise-callback-demo/node-addon-api/, both currently disabled with "require statement to an unexpected path".

The first two say "Fix C++ support", which is worth pinning down before anyone starts: it is not obvious from the comments whether the failure is in gyp-to-cmake's translation, in a C++ standard/flag we pass, or in the host's C++ surface. Reproducing one of the lambda cases and capturing the actual compiler error is the first step.

Each of the three can land independently. Related to the other gyp-to-cmake gaps: #98, #99, #100, #101, #102, #103.

Lingua principale
TypeScript
Stelle
188
Fork
10
Merge medio
2g 17h
PR unite (30g)
3

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.

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.