Skip to content

Conversation

@kjvalencik
Copy link
Member

@kjvalencik kjvalencik commented Mar 31, 2022

This PR includes lots of clean-ups--each as an independent commit--but, only ones that made sense to merge at once.

  • Remove legacy (neon-sys, legacy backend, features, tests)
  • After removing the backend, lots of dead code was left for it. Deleted the deadcode.
  • Left with useless feature flags for napi-1. Remove these.
  • After removing feature flags, lots of use statements were unnecessarily complicated. Cleaned all of the use statements for consistent style.
  • Cleaned up tests, feature flags and aliases
  • Moved neon-runtime to neon::sys. There isn't a reason for it to be a separate crate anymore and this will yield better performance with thin LTO.
  • Removed other unused components: neon-build, cli

There are a few future clean-ups I would like to perform that are not included. For example:

  • Re-organize repo. crates only has one crate now. Move src into crates/neon. Create npm directory (name?) move create-neon and cargo-cp-artifact into it.
  • Update neon::sys (formerly neon-runtime) methods to be more idiomatic instead of the style of legacy. This is removing a lot of out pointers. Eliminate the build closure
  • Rename napi everywhere to node-api and deprecate napi- feature flags
  • Eliminate all uses of transmute
  • Audit for methods that should be unsafe but, aren't. I've seen this most on new_internal and from_raw methods.
  • Remove unnecessary context internals (e.g., isolate tracking)

@kjvalencik kjvalencik marked this pull request as ready for review April 1, 2022 19:02
Copy link
Collaborator

@dherman dherman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is so gratifying 🔥

A few questions and a couple minor comments, but it looks great.

@kjvalencik
Copy link
Member Author

@dherman Thanks for reviewing! I added a commit to address the review feedback. Additionally, I rebased on top of main and fixed merge conflicts.

Copy link
Collaborator

@dherman dherman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@kjvalencik kjvalencik merged commit 4eafb52 into main Apr 12, 2022
@kjvalencik kjvalencik deleted the kv/remove-legacy branch April 12, 2022 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants