Repository navigation
Commit 26eabde
committed
refactor(css): reach the halves through getters, as javascript does
syntax.js now exposes `parser` and `printer` the way lib/javascript's
facade does, and every name it published before is a getter onto the half
that owns it. Nothing loads until a name is read: requiring the facade
loads neither half, and a walk that only fires visitors never loads the
printer.
SourceProcessor asks for its printer on the first print rather than
naming it up front — util/SourceProcessor takes that loader as a third
argument and calls it once per process, never per node. In-repo readers
that never print (CssParser, CssIcssExportDependency, the html parser's
css tokens) now import the parser half directly.
`css.syntax.printer` is the printer half now, as in javascript; the
print function it holds is `printer.printer`.1 parent 17c35c0 commit 26eabde
13 files changed
Lines changed: 926 additions & 497 deletions
File tree
- lib
- css
- dependencies
- html
- util
- test
- helpers
- specCases
- unitCases
- tooling
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
0 commit comments