Files
Benjamin Woodruff ‮ be2c3fdb3a Add a fast-path to 'get_relative_path_to' for a potential common case when 'from' is empty (#98440)
When creating an NFT file in
https://github.com/vercel/next.js/pull/98003, I store a generic list of
"base" paths and then construct the final path in the JSON file as
relative to the base path. For most files, these paths are relative to
the `*.nft.json` file, but for additional roots, this base path is
always an empty string (relative to the root of the filesystem), so
being able to re-use the original `RcStr` instead of constructing a
brand new string may be beneficial.

This also moves the unit tests to be colocated next to the functions
that are actually being tested.
2026-09-09 15:54:55 -07:00
..

Utilities for Next.js written without a dependency on turbo-tasks, allowing them to be shared with webpack and/or rspack codepaths. This crate must be compilable to WASM, so that it works in environments where no native bindings are available.

These utilities should not perform file IO directly, but instead accept files they depend on as arguments (preferred) or via async trait methods or callbacks (acceptable). Follow "sans-io" patterns where possible.