Skip to content

Comments

Remove toObject option (use css-tree AST directly)#292

Merged
domenic merged 2 commits intomainfrom
perf/remove-toplainobject
Jan 10, 2026
Merged

Remove toObject option (use css-tree AST directly)#292
domenic merged 2 commits intomainfrom
perf/remove-toplainobject

Conversation

@domenic
Copy link
Member

@domenic domenic commented Jan 10, 2026

Work directly with css-tree's List objects instead of converting to plain arrays via toPlainObject(). This does not give significant performance improvements, but simplifies the code a bit.

🤖 Generated with Claude Code

@asamuzaK WDYT?

Work directly with css-tree's List objects instead of converting to plain arrays via toPlainObject(). This does not give significant performance improvements, but simplifies the code a bit.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@asamuzaK
Copy link
Contributor

Awesome!
LGTM

lib/parsers.js Outdated
return cssTree.toPlainObject(ast);
}
return ast;
const parseCSS = (val, opt) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

const parseCSS = (val, opt) => cssTree.parse(prepareValue(val), opt);

@domenic domenic merged commit cc3a6af into main Jan 10, 2026
3 checks passed
@domenic domenic deleted the perf/remove-toplainobject branch January 10, 2026 06:34
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.

2 participants