dillon1000/react

Commit

[rust-compiler] Switch to hmac-sha256 and bump napi/similar (#36809)

## Summary

Dependency maintenance for the Rust compiler crates.

### Fast Refresh hash: sha2 + hmac → hmac-sha256
The Fast Refresh source hash (`enableResetCacheOnSourceFileChanges`)
only needs an HMAC-SHA256 of the source text, matching the TS compiler's
`createHmac('sha256', code).digest('hex')`. RustCrypto's `sha2` + `hmac`
pulled in **11 crates** (`sha2`, `hmac`, `digest`, `block-buffer`,
`typenum`, `crypto-common`, `hybrid-array`, `const-oid`, `cpufeatures`,
`cmov`, `ctutils`) — generic-hashing / constant-time machinery that is
irrelevant for a non-security content fingerprint. This replaces them
with the single **zero-dependency** `hmac-sha256` crate: a net reduction
of **10 crates**.

HMAC-SHA256 is a standardized deterministic algorithm, so the emitted
hash is unchanged. A new unit test
`source_file_hash_matches_node_create_hmac` pins the result against
Node's `createHmac('sha256', code).digest('hex')` for several inputs.

### Other bumps
- `napi` / `napi-derive` 2 → 3
- `similar` 2 → 3 (dev-dependency)
- Drop the unused `react_compiler_lowering` dependency from
`react_compiler_ssa`

`cargo check --workspace --all-targets` passes, including the napi 3
native crate.
Browse files
Changed paths6 files
First-parent comparison
M compiler/Cargo.lock ModifiedM compiler/crates/react_compiler_ast/Cargo.toml ModifiedM compiler/crates/react_compiler_reactive_scopes/Cargo.toml ModifiedM compiler/crates/react_compiler_reactive_scopes/src/codegen_reactive_function.rs ModifiedM compiler/crates/react_compiler_ssa/Cargo.toml ModifiedM compiler/packages/babel-plugin-react-compiler-rust/native/Cargo.toml Modified
Patch

Files changed

Rendering syntax-highlighted changes…