# What changed in napi-derive

> 15 changes in napi-derive 3 from its official release notes, upgrade guides and advisories: 2 breaking, 1 security, 6 new APIs and options. Each one cited. Sources checked 2026-11-23. HTML: https://unstale.sh/cargo/napi-derive/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## napi-derive 3

### Breaking changes

- The Rust version requirement was bumped. (3.3.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-derive-v3.3.0)
- The module initialization macro moved from napi::module_init to napi_derive::module_init because of breaking changes in the upstream ctor crate. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)

### Security

- Classes marked with #[napi] have unforgeable identity via Node object type tags. (3.6.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-derive-v3.6.0)

### New APIs and options

- Class members can use symbol_for keys. (3.7.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-derive-v3.7.0)
- Class members can use well-known symbol keys. (3.7.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-derive-v3.7.0)
- Adds the napi(async_iterator) macro attribute. (3.5.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-derive-v3.5.0)
- Adds a feature for debug logging NAPI function calls. (3.4.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-derive-v3.4.0)
- Adds `discriminant_case` to allow changing the case of a discriminant. (3.3.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-derive-v3.3.0)
- This attribute replaces the compat-mode #[module_exports] macro, allowing use of the modern #[napi] macros without the compat-mode feature. (3.0.0) — [upgrade guide](https://napi.rs/docs/more/v2-v3-migration-guide)

### Fixes and other changes

- The TS1016 issue in constructors is avoided. (3.7.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-derive-v3.7.0)
- Closures passed to define_class are freed. (3.7.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-derive-v3.7.0)
- Static flags are honoured. (3.7.0) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-derive-v3.7.0)
- AsyncTask completion is guarded against environment teardown. (3.6.8) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-derive-v3.6.8)
- Fixes invalid TypeScript generic syntax generated for type aliases. (3.5.6) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-derive-v3.5.6)
- Using ThreadsafeFunction::call_async no longer requires tokio. (3.3.1) — [release notes](https://github.com/napi-rs/napi-rs/releases/tag/napi-derive-v3.3.1)
