alloc/saus

Use bare bones HTML parser

Closed this issue · 1 comments

html5parser is too full-featured for our needs. We would prefer a smaller bundle footprint in exchange for less robust parsing. We can safely assume that a renderer is responsible enough to produce valid HTML and isn't too clever.

This would also let us intertwine the visitor pattern with parsing, so if a node gets skipped, we can skip parsing of its children's attributes (literally just look for < and > tokens).

The parser is implemented in the next branch (https://github.com/alloc/saus/blob/25823266d8c175347d03447a0dfd25dc52bf0273/packages/html/src/parser.ts)

This would also let us intertwine the visitor pattern with parsing, so if a node gets skipped, we can skip parsing of its children's attributes (literally just look for < and > tokens).

I'm punting on this part for now..