diff --git a/book.toml b/book.toml index 9708038..aa148fb 100644 --- a/book.toml +++ b/book.toml @@ -15,4 +15,8 @@ no-section-label = true additional-css = ["custom.css"] [output.html.redirect] +"/napi/README.html" = "../napi/index.html" +"/oxc/README.html" = "../oxc/index.html" "/oxc-resolver/README.html" = "../oxc-resolver/index.html" +"/rolldown/README.html" = "../rolldown/index.html" +"/rust/README.html" = "../rust/index.html" diff --git a/src/oxc-resolver/README.md b/src/oxc-resolver/README.md index 3fd9bc6..27f3ac4 100644 --- a/src/oxc-resolver/README.md +++ b/src/oxc-resolver/README.md @@ -22,3 +22,5 @@ Those resolving rules are applied, taking in account: - `package.json#module` And a lot of other things that can alter the resolution algorithm. + +This crate is widely used by [`rolldown_resolver`](../rolldown/README.md#rolldown_resolver). diff --git a/src/rolldown/README.md b/src/rolldown/README.md index abe031e..5434c9a 100644 --- a/src/rolldown/README.md +++ b/src/rolldown/README.md @@ -126,3 +126,15 @@ This is the plugin in charge of resolving the paths of the imports, which is a v - however, the `type` field of the `package.json` may affect the resolution (`module`, `commonjs`) 📄 + +## rolldown_rstr + +Exposes `rolldown_rstr::Rstr` which is a thin wrapper over [`oxc::span::CompactStr`](https://github.com/oxc-project/oxc/blob/main/crates/oxc_span/src/compact_str.rs), which is a wrapper over the [compact_str](https://crates.io/crates/compact_str) crate. + +> A memory efficient string type that can store up to 24* bytes on the stack. +> +> A `CompactString` is a more memory efficient string type, that can store smaller strings on the stack, and transparently stores longer strings on the heap (aka a small string optimization). It can mostly be used as a drop in replacement for `String` and are particularly useful in parsing, deserializing, or any other application where you may have smaller strings. + +`rolldown_rstr::Rstr` is used in many places in the project. + +📄 diff --git a/src/rust/README.md b/src/rust/README.md index 44356ce..d97ad12 100644 --- a/src/rust/README.md +++ b/src/rust/README.md @@ -6,3 +6,4 @@ Some rust specifics - [`std::sync::LazyLock`](https://doc.rust-lang.org/beta/std/sync/struct.LazyLock.html) - A value which is initialized on the first access. - [`string_wizard::MagicString`](https://docs.rs/string_wizard/0.0.22/string_wizard/struct.MagicString.html) / [`magic-string`](https://github.com/Rich-Harris/magic-string) - performant updates on large strings (like source-maps) +- [compact_str](https://crates.io/crates/compact_str) - check [rolldown_rstr](../rolldown/README.md#rolldown_resolver)