Skip to content

Candidate Breaking Changes for 1.0

Dave Herman edited this page Jun 2, 2023 · 11 revisions

Candidate Breaking Changes for 1.0

This is a list of candidate breaking changes for 1.0. We will not necessarily go through with all of them! We're building a master list here so we can prioritize and decide which changes are worth it and which ones aren't worth the disruption.

Open

  • Generalize export_function() and JsFunction::new() to take an auto-destructuring trait (see #953)

Rejected

  • Align argument_opt() signature with argument() signature <== rejected: better forward-looking approach is Serde arg parsing
  • Eliminate panics based on throwing state by having (nearly) all APIs return a Result
  • Eliminate the Context trait and make it just a struct, passing Arguments as a second parameter to Neon functions
  • Rename downcast_or_throw() <== let's try to avoid needing to do this, thanks to implicit downcasting in more contexts
  • Keep cx.global() as-is and add cx.get::<JsFunction>("Array")? <== rejected: "context" suggests getting from local context, i.e. this
  • Collapse all Context types except ModuleContext and FunctionContext <== rejected: we'll try to make new back-compat frontends for everything when we create the Env struct post-1.0

Done