kabiroberai / node-swift

Create Node modules in Swift
MIT License
492 stars 16 forks source link

API: Preprocessor #6

Closed kabiroberai closed 10 months ago

kabiroberai commented 2 years ago

Using a preprocessor could vastly improve ergonomics, for example by removing the need to manually declare NodeClass.properties. The preprocessor should generate an auxiliary source file as seen in theos/orion, and can be built as an SPM package plugin or integrated into the JS builder.

KishanBagaria commented 2 years ago

napi-rs has done this well. Automated TypeScript bindings would be nice too.

Ideally we would just write Swift code normally without thinking of bridging and have the preprocessor bridge to JS with near-zero boilerplate.

kabiroberai commented 10 months ago

Implemented via macros 🎉