Skip to content

Conversation

@Boshen
Copy link
Contributor

@Boshen Boshen commented Feb 27, 2024

We've gone full circle 😅

The unicode-id and unicode-id-start crates were cloned from unicode-xid and unicode-ident for usages in the oxc project.

Oxc will be using this crate for sourcemap support, and is currently using the better optimized unicode-id-start crate. I don't want to include two similar dependencies due to the rather large static storage size of these crates.

The unicode-id-start crate is also faster and uses slightly less static storage. See full details at https://github.com/oxc-project/unicode-id-start/tree/master?tab=readme-ov-file#comparison-of-performance


The version "1" is used instead of the latest version because the crate is stable, future versions will only include unicode version upgrades.


And thank you Sentry for the sponsorship due to the inclusion of unicode-id crate ❤️

We've gone full circle 😅

The `unicode-id` and `unicode-id-start` crates were cloned from (`unicode-xid`)(https://crates.io/crates/unicode-xid) and [`unicode-ident`](https://crates.io/crates/unicode-ident) for usages in the [oxc project](https://github.com/oxc-project/oxc).

Oxc will be using this crate for sourcemap support, and is currently using the better optimized `unicode-id-start` crate. I don't want to include two similar dependencies due to the rather large static storage size of these crates.

The `unicode-id-start` crate is also faster and uses slightly less static storage. See full details at https://github.com/oxc-project/unicode-id-start/tree/master?tab=readme-ov-file#comparison-of-performance

---

The version "1" is used instead of the latest version because the crate is stable, future versions will only include unicode version upgrades.
@Boshen
Copy link
Contributor Author

Boshen commented Feb 27, 2024

For detecting JavaScript identifiers, oxc has an optimized routine which this crate could use. I can add the code to unicode-id-start if we want more performance :-) https://github.com/oxc-project/oxc/blob/27052ebfed27d8aa97913d26f95d285d9cb58e51/crates/oxc_syntax/src/identifier.rs#L66-L137

@Swatinem
Copy link
Member

lgtm

Though I believe this whole module, and sourceview which is the only other module that uses this might be headed out the door once we get around to #71

@Boshen
Copy link
Contributor Author

Boshen commented Feb 27, 2024

Fixed the clippy warning, ready to merge, and possibly a release 😁

@Swatinem Swatinem merged commit eff3dc0 into getsentry:master Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants