refactor: replace scraper with lol_html for HTML charset prescanning#398
Merged
refactor: replace scraper with lol_html for HTML charset prescanning#398
Conversation
Co-authored-by: barjin <61918049+barjin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Make scraper dependency optional or replace with alternative
refactor: replace scraper with lol_html for HTML charset prescanning
Mar 4, 2026
Member
|
@copilot regenerate the yarn.lock lockfile so the CI passes |
Co-authored-by: barjin <61918049+barjin@users.noreply.github.com>
Contributor
Author
There was a problem hiding this comment.
Pull request overview
This PR removes the scraper dependency from the impit Rust crate by rewriting the HTML charset prescanning logic to use lol_html, addressing both the “heavyweight dependency” concern and the common-crate-name workspace collision described in #396. It also updates the Node wrapper lockfile to keep CI green after native package updates.
Changes:
- Replaced DOM-based charset extraction (
scraper) with streaming parsing vialol_htmlinprescan_bytestream. - Swapped
scraper = "0.25.0"forlol_html = "2.7.2"inimpitdependencies (and updatedCargo.lockaccordingly). - Regenerated
impit-node/yarn.lockand normalizedimpit-node/package.jsonoptionalDependencies entries for native package versions.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
impit/src/response_parsing/mod.rs |
Reimplements HTML prescan encoding detection using lol_html element handlers instead of scraper selectors/DOM. |
impit/Cargo.toml |
Replaces scraper dependency with lol_html. |
Cargo.lock |
Reflects dependency graph changes from swapping scraper → lol_html. |
impit-node/yarn.lock |
Updates native package resolutions (v0.10.0 → v0.10.1) to match regenerated lockfile state. |
impit-node/package.json |
Reorders/normalizes optionalDependencies entries (no functional changes observed). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
impit/src/response_parsing/mod.rs)scraperwithlol_html = "2.7.2"inimpit/Cargo.tomlprescan_bytestreaminresponse_parsing/mod.rsto uselol_htmlimpit-node/yarn.lockto fix CI (updated native packages from v0.10.0 → v0.10.1)Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.