Commit 83ccd8d
Address review: drop runtime simple-html-tokenizer, fix PathExpression original setter
Two review comments from NullVoxPopuli on the cleanup commit:
1. rollup.config.mjs: "remove this. it's internal, and we don't want it.
this grammar work should negate the need for simple-html-tokenizer
entirely"
- Vendor the HTML5 named-entity table as
packages/@glimmer/syntax/lib/parser/html5-named-char-refs.js (the
~2200-entry map from simple-html-tokenizer's generated data, now
internal to @glimmer/syntax).
- Inline the entity decoder in tokenizer-event-handlers.ts: handles
hex (&#xHH;), decimal (&#dd;), and named entities via the vendored
table.
- Drop simple-html-tokenizer from @glimmer/syntax/package.json and
revert the rollup.config resolvePackages central externalization.
(simple-html-tokenizer is still a testDependency because
internal-test-helpers and integration-tests use it, but no runtime
code does anymore.)
- .prettierignore: exclude the vendored char-ref file (huge one-liner).
2. auto-import-builtins.ts: "this should not need changing. changing
`original` should mean that the other nodes updates"
The Peggy grammar was emitting PathExpression nodes as plain objects
with `original` as a data field, bypassing buildLegacyPath (which
installs `original` as a getter/setter tied to head/tail). That's why
the plugin was having to manually rewrite head/tail after assigning
to `.original`.
- convertLocations now upgrades every PathExpression through
buildLegacyPath, so `node.path.original = 'foo.bar'` correctly
updates head/tail via the setter.
- Revert the manual head/tail mutation in auto-import-builtins.ts
back to the original one-line `node.path.original = rewritten`.
Verified: pnpm lint, pnpm build, pnpm vite build --mode=development,
pnpm test (9138/9138 browser tests pass), and Prettier handlebars smoke
test (163/163 pass, 151 snapshots).
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>1 parent 4b69af0 commit 83ccd8d
6 files changed
Lines changed: 33 additions & 31 deletions
File tree
- packages
- @ember/template-compiler/lib/plugins
- @glimmer/syntax
- lib/parser
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
Lines changed: 1 addition & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 54 | + | |
69 | 55 | | |
70 | 56 | | |
71 | 57 | | |
| |||
Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 26 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| |||
469 | 474 | | |
470 | 475 | | |
471 | 476 | | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
472 | 483 | | |
473 | 484 | | |
474 | 485 | | |
| |||
482 | 493 | | |
483 | 494 | | |
484 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
485 | 500 | | |
486 | 501 | | |
487 | 502 | | |
| |||
492 | 507 | | |
493 | 508 | | |
494 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
495 | 514 | | |
496 | 515 | | |
497 | 516 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
427 | 428 | | |
428 | 429 | | |
429 | 430 | | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | 431 | | |
438 | 432 | | |
439 | 433 | | |
| |||
0 commit comments