Skip to content

Conversation

@titoBouzout
Copy link
Contributor

@titoBouzout titoBouzout commented Jul 10, 2025

This is kind of low-hanging fruit low effort edit to make the output smaller. It adds a setStyleProperty helper.

While Solid code is hella small already, the code generated could add up depending on use case. This is a suggestion to make the output smaller.

Given the output, I am figuring there may be more opportunities to make it even smaller. So I'm going to have a look at that. .. 🤔 Yeah, I was able to "optimize" 1 case, from

_$effect(_$p => _$setStyleProperty(_el$56, "color", (_$p = a())));

to

_$effect(_$p => _$setStyleProperty(_el$56, "color", a());

_$p is unused, but treeshaked I suppose.

On the performance side of things (besides avoiding that assignement), this adds up a function call, but at the same time, when stuff it's a signal/store it removes a double-access. Without any scientific proof I would guess this performs better... but Im just making that up.

@titoBouzout titoBouzout marked this pull request as ready for review July 10, 2025 23:44
@ryansolid ryansolid merged commit 1b29a09 into ryansolid:main Aug 6, 2025
1 check failed
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