You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 stuff
src/visitor.rs shared + rust stuff
src/napi/parse_error.rs napi stuff
src/napi/visitor.rs napi stuff
I suggest this:
src/parse_error/mod.rs shared stuff
src/parse_error/rust.rs rust stuff
src/parse_error/napi.rs napi stuff
src/visitor/mod.rs shared stuff
src/visitor/rust.rs rust stuff
src/visitor/napi.rs napi stuff
This 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.
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: