Open ErichDonGubler opened 2 years ago
There's no reason it couldn't but it would not provide value. declare_type
is not implemented for the Node-API backend and will not be (it is not very ergonomic and is unsound when used with workers).
The current recommendation is to use JsBox and some glue code in JavaScript to create classes. See this example: https://github.com/neon-bindings/examples/blob/main/examples/async-sqlite/index.js
The goal is to addon classes later with a proc macro design.
https://github.com/neon-bindings/rfcs/pull/43 https://github.com/neon-bindings/neon/issues/745
JsBox<...>
appears to implementObject
, andManaged
. Is there a reason that it doesn't also implementThis
also? The lack ofThis
implementation currently makes it impossible to have aMethodContext<'_, JsBox<...>>
, which is something that was previously possible withdeclare_type! { ... }
.