Skip to content

Commit

Permalink
rolldown_rstr
Browse files Browse the repository at this point in the history
  • Loading branch information
topheman committed Oct 25, 2024
1 parent 0fb1cca commit 987ddf3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions src/oxc-resolver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
12 changes: 12 additions & 0 deletions src/rolldown/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)

<a href="https://github.com/rolldown/rolldown/tree/main/crates/rolldown_resolver" title="Source Code of rolldown_resolver">📄</a>

## 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.

<a href="https://github.com/rolldown/rolldown/tree/main/crates/rolldown_rstr" title="Source Code of rolldown_rstr">📄</a>
1 change: 1 addition & 0 deletions src/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 987ddf3

Please sign in to comment.