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
Goal is pre-1.0 API stability planning (not immediate implementation).
What I audited
Public API surface snapshot across publishable crates (cargo-public-api).
First focused slice on boa_engine public-field exposure.
Key findings (first slice)
High-priority candidates for stabilization
JsNativeError.kind and JsErasedNativeError.kind: direction was accessor-based API (kind()) instead of direct field access.
OptimizerStatistics counters: direction was accessor-based API for forward-compatible evolution.
Medium-priority candidates for policy decision
ResolvingFunctions { resolve, reject }: keep ergonomic shape vs. mark type #[non_exhaustive].
RecursionLimiter { visited, live }: keep public internals vs. expose read methods only.
JsPartialTime public fields: keep as data struct vs. reduce visibility/encapsulate.
Enum shape exposure to discuss
TryNativeError and other enums with public variant fields may benefit from a project-wide rule on #[non_exhaustive] usage before 1.0.
Questions for maintainers
Do we want to adopt “prefer accessors over public fields” as a 1.0 policy baseline?
Should we standardize where #[non_exhaustive] is expected (which public enums/structs)?
Which crate/surface should be the very first implementation PR once policy is agreed (boa_engine errors, optimizer stats, or another area)?
If helpful, I can post a compact crate-by-crate matrix (public fields / non_exhaustive usage / suggested action) in this thread to drive decision-making.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Following up on #4524 and maintainer feedback in closed PR #4770, posting findings here for discussion before any code PR.
Context
What I audited
cargo-public-api).boa_enginepublic-field exposure.Key findings (first slice)
JsNativeError.kindandJsErasedNativeError.kind: direction was accessor-based API (kind()) instead of direct field access.OptimizerStatisticscounters: direction was accessor-based API for forward-compatible evolution.ResolvingFunctions { resolve, reject }: keep ergonomic shape vs. mark type#[non_exhaustive].RecursionLimiter { visited, live }: keep public internals vs. expose read methods only.JsPartialTimepublic fields: keep as data struct vs. reduce visibility/encapsulate.TryNativeErrorand other enums with public variant fields may benefit from a project-wide rule on#[non_exhaustive]usage before 1.0.Questions for maintainers
#[non_exhaustive]is expected (which public enums/structs)?boa_engineerrors, optimizer stats, or another area)?If helpful, I can post a compact crate-by-crate matrix (public fields / non_exhaustive usage / suggested action) in this thread to drive decision-making.
Beta Was this translation helpful? Give feedback.
All reactions