-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge NAPI wrapper types into same file as Rust types #570
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I suggest keeping every type/API in a single place. This makes it much easier to maintain or edit together, instead of editing one version and spending the time to look for others, possibly missing them. This way, all types/APIs can evolve together, and we don't have to maintain separate hierarchies.
So instead of this:
src/parse_error.rs
shared + rust stuffsrc/visitor.rs
shared + rust stuffsrc/napi/parse_error.rs
napi stuffsrc/napi/visitor.rs
napi stuffI suggest this:
src/parse_error/mod.rs
shared stuffsrc/parse_error/rust.rs
rust stuffsrc/parse_error/napi.rs
napi stuffsrc/visitor/mod.rs
shared stuffsrc/visitor/rust.rs
rust stuffsrc/visitor/napi.rs
napi stuffThis way, they can also follow (roughly) the same structure as the public API. For example, if I'm adding a new method to
Cursor
, it is really easy to miss its NAPI counterpart if it is not within the same module/folder. This is a trivial example, but there are more complicated scenarios.The more atomic/holistic each type/module can be, the easier it is to update/revision accurately.
Originally posted by @OmarTawfik in #564 (comment)
The text was updated successfully, but these errors were encountered: