3 releases (breaking)
Uses new Rust 2024
| new 0.3.0 | Feb 18, 2026 |
|---|---|
| 0.2.0 | Feb 18, 2026 |
| 0.1.0 | Feb 18, 2026 |
#258 in Web programming
1.5MB
35K
SLoC
browser-tester
A deterministic browser-like testing crate implemented entirely in Rust.
- Japanese README: translations/ja/README.md
- Developed by Finite Field, K.K.
Purpose
- Provide a runtime that can execute DOM and script tests deterministically within a single process.
- Enable browser interaction tests without depending on an external browser, WebDriver, or Node.js.
Usage
- Create a test harness from HTML.
- Operate elements using selectors.
- Assert the expected DOM state.
use browser_tester::Harness;
fn main() -> browser_tester::Result<()> {
let html = r#"
<input id='name' />
<button id='submit'>Submit</button>
<p id='result'></p>
<script>
document.getElementById('submit').addEventListener('click', () => {
const name = document.getElementById('name').value;
document.getElementById('result').textContent = `Hello, ${name}`;
});
</script>
"#;
let mut harness = Harness::from_html(html)?;
harness.type_text("#name", "Alice")?;
harness.click("#submit")?;
harness.assert_text("#result", "Hello, Alice")?;
Ok(())
}
Run tests:
cargo test
Runtime Policy
evalis intentionally not implemented to preserve security and determinism.- Time APIs are based on a fake clock and provide
Date.now()andperformance.now().
Test Mocks
fetchis designed to be replaced with mocks during tests.confirm/promptprovide APIs for injecting mocked return values.- Main APIs:
Harness::set_fetch_mock(url, body)Harness::enqueue_confirm_response(bool)Harness::enqueue_prompt_response(Option<&str>)
Developed by Finite Field, K.K.
Full Design Document
The following content is synchronized with doc/e2e-lite-runtime-design.md.
Lightweight HTML+JS Test Runtime Design (Rust)
1. Background and Goals
Browser-launch-based E2E approaches like chromedp have high overhead in startup, rendering, networking, and inter-process communication, which often slows feedback.
This design defines a Rust test runtime for a single HTML file (inline JS only) to quickly validate DOM and event behavior.
Main goals:
- Quickly execute form input, checkbox operations, button clicks, and result text assertions.
- Run tests as Rust unit tests.
- Avoid aiming for 100% real-browser compatibility; instead, provide stable behavior within the required scope.
2. Scope
2.1 In Scope
- Load one HTML string and build a DOM.
- Execute inline
<script>. - DOM operations (
querySelector,getElementById,textContent,value,checked). - Event system (
click,input,change,submit). - Capture/bubble,
preventDefault,stopPropagation. - Test harness API (actions + assertions).
- Diff output on failure.
2.2 Out of Scope
- Loading external CSS/JS files.
- Real network I/O (XHR/WebSocket/external HTTP).
fetchis supported only through mock injection. - Screen rendering, layout calculation, style application, accessibility tree.
- iframe, shadow DOM, custom elements (not supported in MVP).
3. Requirements
3.1 Functional Requirements
- Initialize HTML with
Harness::from_html. - Call
type_text,set_checked,click, andsubmit. - Update DOM via JS event handlers.
- Support
assert_text,assert_value,assert_checked, andassert_exists. - Show both actual and expected values for selector targets on failure.
3.2 Non-Functional Requirements
- Target several milliseconds to several tens of milliseconds per unit test case (depends on HTML size).
- Full test isolation between test cases (prevent state leaks).
- Deterministic execution (time, randomness, and async can be fixed).
4. Overall Architecture
flowchart LR
T["Rust Test (cargo test)"] --> H["test_harness"]
H --> R["runtime_core"]
R --> D["dom_core"]
R --> E["event_system"]
R --> S["script_runtime (self-implemented)"]
D <--> S
E <--> S
Modules:
dom_core: DOM tree, selectors, attributes/properties.script_runtime: custom parser + custom evaluator (JS subset).event_system: event propagation and default actions.runtime_core: initialization, script execution, task queue.test_harness: high-level test operation API.
5. Crate Structure (Adopted Policy)
- This project is implemented as a single crate.
- Centered on
src/lib.rs, with module splitting inside the same crate as needed. - No separate-crate split such as
runtime-core/dom-core.
6. DOM Model Details
6.1 Data Structures
- Arena style (
Vec<Node>) +NodeId(usize). - Each node:
node_type: Document / Element / Textparent: Option<NodeId>children: Vec<NodeId>tag_name(Element only)attributes: HashMap<String, String>properties: ElementProperties
ElementProperties (MVP):
value: String(input/textarea/select)checked: bool(checkbox/radio)disabled: boolreadonly: boolrequired: bool
6.2 Indexes
id_index: HashMap<String, Vec<NodeId>>class_index: HashMap<String, Vec<NodeId>>(when needed)#id/getElementByIdreturns the first element for a given id, while duplicate ids are kept internally.
6.3 Selectors
MVP support:
- Simple/compound:
#id,.class,tag,[name],[name=value],tag#id.class[attr=value][attr2] - Combinators: descendant (space), child (
>), adjacent sibling (+), general sibling (~) - Groups:
A, B(deduplicate and return in document order)
Unsupported selectors must return explicit errors (no silent ignore).
7. Script Runtime Details
7.1 Implementation Approach
- Do not use an external JS engine (pure Rust implementation).
- Parse
<script>strings into AST with a custom parser and execute with a custom evaluator. - Limit support to the JS subset needed for tests; unsupported syntax fails explicitly with
ScriptParse.
7.2 Supported Syntax/DOM APIs (Main)
- Listener registration/removal:
addEventListener(...),removeEventListener(...) - Control flow:
if/else,while,do...while,for,for...in,for...of,break,continue,return - Main operators: ternary, logical/comparison/strict comparison, arithmetic, bitwise, assignment operators (
+=,&&=,??=, etc.) - Numeric literals: integer/decimal/exponent/hex/octal/binary, BigInt literals
- DOM references:
getElementById,querySelector,querySelectorAll,querySelectorAll(...).length,form.elements.length,form.elements[index],new FormData(form),formData.get(name),formData.has(name),formData.getAll(name).length - DOM updates:
textContent,value,checked,disabled,readonly,required,className,id,name,classList.*,setAttribute/getAttribute/hasAttribute/removeAttribute,dataset.*,style.*,matches(selector),closest(selector)(returnsnullwhen not matched),getComputedStyle(element).getPropertyValue(property),createElement/createTextNode,append/appendChild/prepend/removeChild/insertBefore/remove(),before/after/replaceWith,insertAdjacentElement/insertAdjacentText/insertAdjacentHTML,innerHTML - Timers:
setTimeout(callback, delayMs?)/setInterval(callback, delayMs?)(returns timer ID. No real-time waiting; execute viaharness.advance_time(ms)/harness.flush()),clearTimeout(timerId)/clearInterval(timerId),requestAnimationFrame/cancelAnimationFrame,queueMicrotask - Time:
Date.now()/performance.now()(returns current fake clock valuenow_ms) - Random:
Math.random()(returns deterministic PRNG float0.0 <= x < 1.0) - Mock-oriented APIs:
fetch,matchMedia,alert,confirm,prompt - Events:
preventDefault,stopPropagation,stopImmediatePropagation offsetWidth,offsetHeight,offsetTop,offsetLeft,scrollWidth,scrollHeight,scrollTop,scrollLeft(minimal implementation returns numeric values)
7.2.1 Priority for Unsupported DOM APIs
- First priority: DOM references/updates required for tests (
getElementById,querySelector*,textContent,value,checked,disabled,readonly,required,classList,dataset,style,append*/remove*family) - Second priority: timer/event/form APIs (
setTimeout,setInterval,clearTimeout,clearInterval,preventDefault,FormData,submit) - Third priority: display/measurement APIs such as
focus - Unsupported cases must fail explicitly in
ScriptParse/ScriptRuntimelayers (no silent ignore) - Preferred expansion order:
dataset/style-> DOM events ->offset/scroll(minimal read support) -> other display/measurement APIs
7.2.2 Parser Decision Order (Implementation Note)
- For expressions such as
event.currentTargetanddocument.getElementById(...).matches(...)/closest(...), resolveevent/DOM methodcases beforeDomRefmatching (to avoid misinterpretingdocument.getElementById(...).textContent). - This order avoids known
ScriptParseedge cases (name collisions betweeneventand DOM properties).
Simplified FormData spec (for testing):
new FormData(form)scansform.elementsand creates a snapshot.- Only valid controls with
nameare included (disabledandbutton/submit/reset/file/imageare excluded). - For checkbox/radio, only
checked=trueentries are included; ifvalueis empty, use"on". .get(name)returns the first value, or empty string if missing..has(name)returns key presence..getAll(name).lengthreturns the number of values for the same key.formData.append(name, value)appends to the end (supported only as statements against aFormDatavariable).- Initial
textareavalue uses the element body text. - Initial
selectvalue prefersoptionwithselected; otherwise uses the firstoption. - If an
optionhas novalueattribute, use theoptiontext as value. - On
select.value = x, one matchingoptionis selected and others are unselected.
7.3 Rust <-> Script Bridge
- Access DOM through
DomQuery/DomPropinside AST nodes. - When executing events, pass
EventStateand local variable environmentenvinto the evaluator. - Synchronize
id_indexas needed when DOM updates occur.
8. Event System Details
8.1 Event Object
Fields:
type,target,currentTarget,bubbles,cancelable,defaultPrevented,isTrustedeventPhase,timeStamp- Reference properties:
targetName,currentTargetName,targetId,currentTargetId - Internal controls:
propagation_stopped,immediate_propagation_stopped
8.2 Propagation Algorithm
- Build path from
targetto root. - Capture phase (root -> parent of target).
- Target phase (target).
- Bubble phase (parent of target -> root).
stopPropagation stops following phases; stopImmediatePropagation also stops remaining listeners on the same node.
8.3 Default Actions (Important)
click on checkbox:
- Toggle
checked. - Fire
input. - Fire
change.
click on submit button:
- Fire
submitevent on ancestorform. - Do not perform navigation or similar default browser actions (
preventDefaultstate is observable viaevent.defaultPrevented).
9. Runtime Execution Model
9.1 Initialization
- Parse HTML (custom HTML parser).
- Build DOM.
- Execute
<script>synchronously in document order. - Execute microtasks generated by
<script>at the end of each top-level task (timers remain queued).
9.2 Task Queue
- Use synchronous execution as the base while supporting a microtask queue (
queueMicrotask/ Promise reaction). - Timers run deterministically with a fake clock (initial value
0ms) and never wait for real time. harness.advance_time(ms)advances fake clock and runs only timers wheredue_at <= now.harness.run_due_timers()runs only timers wheredue_at <= now_mswithout advancingnow_ms.harness.advance_time_to(targetMs)advances fake clock to an absolute time and runs timers wheredue_at <= targetMs.harness.flush()advances fake clock by as much as needed and runs until queues are empty.harness.run_next_timer()runs exactly one next timer and returnstrueif one ran (falsewhen queue is empty).harness.run_next_due_timer()runs exactly one next timer wheredue_at <= now_msand returnstrueif one ran.harness.clear_timer(timerId)removes the specified timer ID and returnstrueif removed.harness.clear_all_timers()removes all queued timers and returns the number removed.- Safety limit defaults to
10000(configurable viaharness.set_timer_step_limit(max_steps)). - If
harness.flush()/advance_time()exceed safety limit, return an error with diagnostics includingnow_ms,due_limit,pending_tasks, andnext_task(due_limitisnoneforflush(), and updatednow_msforadvance_time(ms)). harness.pending_timers()returns currently queued timers sorted bydue_at,order.
9.3 Determinism Support
Date.now()/performance.now()return fake clock (now_ms).now_msadvances throughadvance_time(ms)/advance_time_to(ms)/flush()/run_next_timer().Math.random()is generated by deterministic PRNG.Harness::set_random_seed(seed)makes random sequences reproducible.
10. Test Harness API Details
pub struct Harness { /* runtime */ }
impl Harness {
pub fn from_html(html: &str) -> Result<Self>;
// Action
pub fn type_text(&mut self, selector: &str, text: &str) -> Result<()>;
pub fn set_checked(&mut self, selector: &str, checked: bool) -> Result<()>;
pub fn click(&mut self, selector: &str) -> Result<()>;
pub fn focus(&mut self, selector: &str) -> Result<()>;
pub fn blur(&mut self, selector: &str) -> Result<()>;
pub fn submit(&mut self, selector: &str) -> Result<()>;
pub fn dispatch(&mut self, selector: &str, event: &str) -> Result<()>;
pub fn dump_dom(&self, selector: &str) -> Result<String>;
// Trace
pub fn enable_trace(&mut self, enabled: bool);
pub fn take_trace_logs(&mut self) -> Vec<String>;
pub fn set_trace_stderr(&mut self, enabled: bool);
pub fn set_trace_events(&mut self, enabled: bool);
pub fn set_trace_timers(&mut self, enabled: bool);
pub fn set_trace_log_limit(&mut self, max_entries: usize) -> Result<()>;
// Determinism / clocks
pub fn set_random_seed(&mut self, seed: u64);
pub fn set_timer_step_limit(&mut self, max_steps: usize) -> Result<()>;
pub fn now_ms(&self) -> i64;
pub fn advance_time(&mut self, ms: i64) -> Result<()>;
pub fn advance_time_to(&mut self, target_ms: i64) -> Result<()>;
pub fn flush(&mut self) -> Result<()>;
pub fn clear_timer(&mut self, timer_id: i64) -> bool;
pub fn clear_all_timers(&mut self) -> usize;
pub fn pending_timers(&self) -> Vec<PendingTimer>;
pub fn run_due_timers(&mut self) -> Result<usize>;
pub fn run_next_timer(&mut self) -> Result<bool>;
pub fn run_next_due_timer(&mut self) -> Result<bool>;
// Mock / browser-like globals
pub fn set_fetch_mock(&mut self, url: &str, body: &str);
pub fn clear_fetch_mocks(&mut self);
pub fn take_fetch_calls(&mut self) -> Vec<String>;
pub fn set_match_media_mock(&mut self, query: &str, matches: bool);
pub fn clear_match_media_mocks(&mut self);
pub fn set_default_match_media_matches(&mut self, matches: bool);
pub fn take_match_media_calls(&mut self) -> Vec<String>;
pub fn enqueue_confirm_response(&mut self, accepted: bool);
pub fn set_default_confirm_response(&mut self, accepted: bool);
pub fn enqueue_prompt_response(&mut self, value: Option<&str>);
pub fn set_default_prompt_response(&mut self, value: Option<&str>);
pub fn take_alert_messages(&mut self) -> Vec<String>;
// Assert
pub fn assert_text(&self, selector: &str, expected: &str) -> Result<()>;
pub fn assert_value(&self, selector: &str, expected: &str) -> Result<()>;
pub fn assert_checked(&self, selector: &str, expected: bool) -> Result<()>;
pub fn assert_exists(&self, selector: &str) -> Result<()>;
}
pub struct PendingTimer {
pub id: i64,
pub due_at: i64,
pub order: i64,
pub interval_ms: Option<i64>,
}
10.1 Internal Action Behavior
type_text:- Replace target
value. - Fire
inputevent.
- Replace target
set_checked:- Update only when value differs from existing value.
input->change
click:- Fire
clickevent. - Perform default action depending on element type.
- Fire
11. Error Design
Error categories:
HtmlParse { message }ScriptParse { message }ScriptRuntime { message }SelectorNotFound { selector }UnsupportedSelector { selector }TypeMismatch { selector, expected, actual }AssertionFailed { selector, expected, actual, dom_snippet }
Failures must always include:
- Target selector
- Expected/actual values
- HTML snippet around target node (max 200 chars)
12. Logging and Debugging
-
Enable event trace with
Harness::enable_trace(true). -
Trace output goes to stderr and can be fetched/cleared via
take_trace_logs(). -
set_trace_stderr(false)disables stderr output and keeps log collection only. -
set_trace_events(false)/set_trace_timers(false)control logs by category. -
Retention default is
10000.set_trace_log_limit(n)changes it; old logs are dropped first when exceeded. -
Timer control APIs output summary lines (advance/advance_to/run_due/flush).
-
Output examples:
[event] click target=#submit current=#submit phase=bubble default_prevented=false[event] done submit target=#signup current=#signup outcome=completed default_prevented=false propagation_stopped=false immediate_stopped=false[timer] schedule timeout id=1 due_at=10 delay_ms=10[timer] run id=1 due_at=10 interval_ms=none now_ms=10[timer] advance delta_ms=5 from=0 to=5 ran_due=1[timer] flush from=5 to=10 ran=1
-
dump_dom(selector)stringifies a partial DOM.
13. Test Strategy
13.1 Specification Tests (Runtime)
- Event ordering tests
stopPropagationbehavior- Checkbox default behavior
- Submit suppression with
preventDefault
13.2 Sample Tests for Users
- Input + check + button click + result text verification
- Validation failure message verification
13.3 Regression Test Operations
- Every past bug must be converted into fixture HTML.
- Keep expected snapshots per fixture.
15. Representative Use Case
#[test]
fn submit_updates_result() -> anyhow::Result<()> {
let html = r#"
<input id='name'>
<input id='agree' type='checkbox'>
<button id='submit'>Send</button>
<p id='result'></p>
<script>
document.getElementById('submit').addEventListener('click', () => {
const name = document.getElementById('name').value;
const agree = document.getElementById('agree').checked;
document.getElementById('result').textContent =
agree ? `OK:${name}` : 'NG';
});
</script>
"#;
let mut h = Harness::from_html(html)?;
h.type_text("#name", "Taro")?;
h.set_checked("#agree", true)?;
h.click("#submit")?;
h.assert_text("#result", "OK:Taro")?;
Ok(())
}
16. Technology Choices
Implementation policy:
- HTML parse: custom implementation
- Selector: custom implementation
- Script runtime: custom parser + custom evaluator
- Error: custom
Errorenum - Keep external dependencies minimal (
regex,num-bigint,num-traits)
17. Known Risks and Mitigations
- Insufficient JS compatibility (differences in ES features)
- Mitigation: define JS constraints for target HTML and fail early on unsupported syntax.
- Missing DOM spec coverage
- Mitigation: define required Web API list as contract and implement incrementally.
- Event order divergence
- Mitigation: lock spec tests first and detect changes in CI.
This design is defined not as full browser compatibility, but as a practical design to minimize and accelerate logic validation for form-centric UIs.
19. Low-Level Implementation Design
19.1 Core Type Definitions (Draft)
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct NodeId(pub usize);
#[derive(Debug)]
pub enum NodeType {
Document,
Element(ElementData),
Text(String),
}
#[derive(Debug)]
pub struct ElementData {
pub tag_name: String,
pub attributes: std::collections::HashMap<String, String>,
pub props: ElementProps,
}
#[derive(Debug, Default)]
pub struct ElementProps {
pub value: String,
pub checked: bool,
pub disabled: bool,
pub readonly: bool,
pub required: bool,
}
#[derive(Debug)]
pub struct Node {
pub parent: Option<NodeId>,
pub children: Vec<NodeId>,
pub node_type: NodeType,
}
#[derive(Debug, Default)]
pub struct Document {
pub nodes: Vec<Node>,
pub root: NodeId,
pub id_index: std::collections::HashMap<String, Vec<NodeId>>,
}
19.2 Event Listener Storage Structure
pub struct ListenerEntry {
pub capture: bool,
pub callback: ScriptHandler,
}
pub struct ListenerStore {
// node_id -> event_type -> listeners
pub map: std::collections::HashMap<
NodeId,
std::collections::HashMap<String, Vec<ListenerEntry>>,
>,
}
Key points:
removeEventListenerremoves by matchingevent_type + callback + capture.- Even if listener arrays are modified during dispatch, use snapshots for execution safety.
19.3 Runtime Aggregate Structure
pub struct Runtime {
pub dom: Dom,
pub listeners: ListenerStore,
pub script_env: std::collections::HashMap<String, Value>,
pub task_queue: Vec<ScheduledTask>,
pub microtask_queue: std::collections::VecDeque<ScheduledMicrotask>,
pub trace: bool,
pub trace_events: bool,
pub trace_timers: bool,
pub trace_logs: Vec<String>,
pub trace_log_limit: usize,
pub trace_to_stderr: bool,
}
Harness wraps Runtime and provides action APIs and assertion APIs.
20. HTML Loading Spec
- Parse the input HTML string.
- Create
documentnode. - Store Element/Text nodes into the arena in sequence.
- Register
id_indexwhen anidattribute is found (duplicate ids are kept asVec<NodeId>). - Collect
<script>element text in document order. - Execute scripts synchronously after DOM construction completes.
Notes:
- For DOM mutations during script execution (
appendChild/removeChild/insertBefore, etc.), prioritize DOM API consistency and updateid_indexeach time.
21. Script Execution Details
21.1 Execution Model
- Parse
<script>into statement-levelStmt/ExprAST. - Parse and store listener bodies as
Stmt/ExprAST. - Evaluate AST with
execute_stmtswhen events fire, and apply side effects to DOM.
21.2 Representative Rust-Side Signatures
fn parse_block_statements(body: &str) -> Result<Vec<Stmt>>;
fn parse_single_statement(stmt: &str) -> Result<Stmt>;
fn execute_stmts(
&mut self,
stmts: &[Stmt],
event_param: &Option<String>,
event: &mut EventState,
env: &mut std::collections::HashMap<String, Value>,
) -> Result<()>;
21.3 Exception Policy
- Syntax errors are
ScriptParse. - Runtime errors are
ScriptRuntime. - On failure, return selector + expected/actual values (assertion-related).
22. Event Behavior Strictness
22.1 click(selector) Execution Order
- Resolve target element.
- If
disabled=true, do nothing (browser-like behavior). - Dispatch
click. - If
defaultPreventedisfalse, run default action. - Dispatch additional
input/change/submitas required by default action. - Auto-run microtask queue at end of top-level task.
22.2 type_text(selector, text) Execution Order
- Verify target is
input/textarea. - If
disabled/readonly, do nothing. - Replace
valuewithtext. - Dispatch
input(bubbles=true). - Do not dispatch
change(changeis for explicit events or blur-equivalent timing).
22.3 set_checked(selector, checked) Execution Order
- Verify target is checkbox/radio.
- Update only when value changes.
- Dispatch
input. - Dispatch
change.
23. Selector Engine Details
MVP implementation idea:
- Parse selector strings simply into
SelectorAst. - Match right-to-left while traversing parents.
- Supported selectors:
#id,.class,tag,[attr],[attr='value'],*,:first-child,:last-child,:first-of-type,:last-of-type,:only-child,:only-of-type,:nth-child(n),:nth-child(odd),:nth-child(even),:nth-child(an+b),:nth-last-child(n|odd|even|an+b),:nth-of-type(n|odd|even|an+b),:nth-last-of-type(n|odd|even|an+b),:empty,:checked,:disabled,:enabled,:required,:optional,:read-only(also support non-standard alias:readonly),:read-write,:focus,:focus-within,:active,:not(selector),:is(selector),:where(selector),:has(selector)(supports selector-list), descendant/child/adjacent/general sibling combinators :nth-child(an+b)supports forms like2n+1,-n+3,n+1.nuses 1-based element index.:nth-last-child(an+b|odd|even|n)also supports 1-based index from the end.- Supported attribute operators:
=,^=,$=,*=,~=,|=
enum SelectorPseudoClass {
FirstChild,
LastChild,
FirstOfType,
LastOfType,
OnlyChild,
OnlyOfType,
Checked,
Disabled,
Enabled,
Required,
Optional,
Readonly,
Readwrite,
Empty,
Focus,
FocusWithin,
Active,
Is(Vec<Vec<SelectorPart>>),
Where(Vec<Vec<SelectorPart>>),
Has(Vec<Vec<SelectorPart>>),
NthOfType(NthChildSelector),
NthLastOfType(NthChildSelector),
Not(Vec<Vec<SelectorPart>>),
NthChild(NthChildSelector),
NthLastChild(NthChildSelector),
}
enum NthChildSelector {
Exact(usize),
Odd,
Even,
AnPlusB(i64, i64),
}
struct SelectorStep {
tag: Option<String>,
universal: bool,
id: Option<String>,
classes: Vec<String>,
attrs: Vec<SelectorAttrCondition>,
pseudo_classes: Vec<SelectorPseudoClass>,
}
enum SelectorCombinator {
Descendant,
Child,
AdjacentSibling,
GeneralSibling,
}
Performance:
#iduses directid_indexlookup for O(1).- Others are worst-case O(N) scans.
24. Assertion Failure Format
AssertionFailed: assert_text
selector : #result
expected : "OK:Taro"
actual : "NG"
snippet : <p id="result">NG</p>
Design policy:
- Provide enough information to identify the cause in one failure.
- Always distinguish selector resolution failure from value mismatch.
Dependencies
~2.3–3.5MB
~61K SLoC