Skip to content

Adopt hand-written liquid-html-parser for performance#1252

Merged
karreiro merged 8 commits into
mainfrom
plhp/1-adopt
Jul 17, 2026
Merged

Adopt hand-written liquid-html-parser for performance#1252
karreiro merged 8 commits into
mainfrom
plhp/1-adopt

Conversation

@karreiro

@karreiro karreiro commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Introduces the hand-written liquid-html-parser, replacing the Ohm grammar-based parser. Benchmarks on the theme corpus show it is roughly 75x faster than the Ohm parser.

@karreiro
karreiro requested a review from lukeh-shopify July 14, 2026 18:49
@karreiro
karreiro marked this pull request as ready for review July 14, 2026 18:49
@karreiro
karreiro requested a review from a team as a code owner July 14, 2026 18:49

@lukeh-shopify lukeh-shopify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

References: artifacts/research/2026-07-14T1431-liquid-html-parser-world-copy-inventory.md and artifacts/plans/2026-07-14T1434-liquid-html-parser-world-resourcing-plan.md.

Assisted-By: devx/e23cd8b6-9fad-4c85-8a59-927ec572d0d1
karreiro added 6 commits July 17, 2026 14:55
* Configure liquid-html-parser package

Assisted-By: devx/bf1b845f-ea09-4e31-9686-5c3b1cb5ebc6

* Adapt liquid-html-parser to theme-tools source model (#1254)

* Adapt liquid-html-parser to theme-tools source model

* Add resilient liquid-html parsing (#1255)

* Add resilient liquid-html parsing

* rename to tolerant

* Update theme-language-server-common for new parser (#1256)

* Update theme-language-server-common for new parser

* Fix NEW parser completion parity regressions

Restores completion behavior lost in the NEW liquid parser so it matches
OLD across empty/unclosed slots, pipe/filter routing, literal
type-narrowing, liquid-inner-statement, named-filter-arg value slots, and
abutting end-tag cases (A-G, R1, R2, R3).

Fix branch-tag completion parity when abutting end tag

Extends the abutting-endtag recovery to LiquidBranch (elsif/when); the R3 fix covered LiquidTag/ForMarkup only.

* Update theme-check-common, prettier-plugin-liquid, and theme-graph for new parser (#1257)

* Update theme-check-common, prettier-plugin-liquid, and theme-graph for new parser

* Restore baseline fixture output for 10 parser and printer regressions

Parser:
- paginate tolerant argument parsing
- comment/doc depth-balance
- conditional comments
- filter comma leniency
- curly quotes
- markdown script
- nested same-name HTML tags
- inline # indentation

Printer:
- liquid-doc trims
- tablerow branched-body

* Add changeset for hand-written liquid-html-parser (#1258)

* Remove unnecessary change
* Configure liquid-html-parser package

Assisted-By: devx/bf1b845f-ea09-4e31-9686-5c3b1cb5ebc6

* Adapt liquid-html-parser to theme-tools source model

* Add resilient liquid-html parsing

* rename to tolerant

* Update theme-language-server-common for new parser

* Fix NEW parser completion parity regressions

Restores completion behavior lost in the NEW liquid parser so it matches
OLD across empty/unclosed slots, pipe/filter routing, literal
type-narrowing, liquid-inner-statement, named-filter-arg value slots, and
abutting end-tag cases (A-G, R1, R2, R3).

Fix branch-tag completion parity when abutting end tag

Extends the abutting-endtag recovery to LiquidBranch (elsif/when); the R3 fix covered LiquidTag/ForMarkup only.

* Update theme-check-common, prettier-plugin-liquid, and theme-graph for new parser

* Restore baseline fixture output for 10 parser and printer regressions

Parser:
- paginate tolerant argument parsing
- comment/doc depth-balance
- conditional comments
- filter comma leniency
- curly quotes
- markdown script
- nested same-name HTML tags
- inline # indentation

Printer:
- liquid-doc trims
- tablerow branched-body

* Add changeset for hand-written liquid-html-parser (#1258)

* Remove unnecessary change

* Copy world theme-check checks verbatim

* Adapt ported theme-check checks to theme-tools--checks

* Add changeset for ported theme-check checks

* Regenerate factory configs for ported checks
@karreiro
karreiro merged commit 6803e99 into main Jul 17, 2026
8 checks passed
@karreiro
karreiro deleted the plhp/1-adopt branch July 17, 2026 16:44
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.

3 participants