next.js
f1899f34 - [turbopack] Create a macro rcstr! for constructing RcStr from string literals. (#79759)

Commit
229 days ago
[turbopack] Create a macro rcstr! for constructing RcStr from string literals. (#79759) ## Add `rcstr!` macro for efficient string literal handling ### What? This PR introduces a new `rcstr!` macro that creates `RcStr` instances from string literals, optimizing for inline storage when possible and using `LazyLock` for longer strings. ### Why? The `rcstr!` macro provides several benefits: - Allows compile-time evaluation of inline strings - Caches longer strings using `LazyLock` to avoid repeated allocations
Author
Parents
Loading