servo / rust-url

URL parser for Rust
https://docs.rs/url/
Apache License 2.0
1.27k stars 317 forks source link

Use web_sys::Url for IDN conversion on wasm32-unknown-unknown #887

Open micolous opened 7 months ago

micolous commented 7 months ago

This pull request is based on #886. Merging this PR will also merge #886.

This removes the dependency on idna on wasm32-unknown-unknown, replacing it with a small shim which calls out to web_sys::Url.

With a small yew demo app (which calls Url::parse()), this reduces binary size by 228 KiB on a release build and by 425 KiB on a debug build. These savings should go a lot of the way towards addressing #557, while retaining IDN support.

API changes

The deprecations could be split out from this, I've included them as related work.

Alternatives considered

Known issues

micolous commented 3 months ago

While this is based on #886, I've marked it as "ready for review", as this isn't really a work in progress – it's just blocked.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:exclamation: No coverage uploaded for pull request base (main@a4dd58b). Click here to learn what that means.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #887 +/- ## ======================================= Coverage ? 81.88% ======================================= Files ? 20 Lines ? 3545 Branches ? 0 ======================================= Hits ? 2903 Misses ? 642 Partials ? 0 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.