I'm looking into sass/dart-sass#88, with the goal of exposing a PostCSS-compatible AST API (at least for statement-level AST nodes). One issue I'm running into is that Sass doesn't directly store the CSS text of the files it parses as a string. This means that creating a new Input object is relatively expensive, because we need to reconstruct the CSS file's text, even if the user is only ever accessing node.source.input.from as is reasonably common. It would be nice to have a way to make the css argument to new Input() be able to be lazy and only accessed when it's necessary.
I'm looking into sass/dart-sass#88, with the goal of exposing a PostCSS-compatible AST API (at least for statement-level AST nodes). One issue I'm running into is that Sass doesn't directly store the CSS text of the files it parses as a string. This means that creating a new
Inputobject is relatively expensive, because we need to reconstruct the CSS file's text, even if the user is only ever accessingnode.source.input.fromas is reasonably common. It would be nice to have a way to make the css argument tonew Input()be able to be lazy and only accessed when it's necessary.