Skip to content

Conversation

@markjaquith
Copy link
Contributor

Because this SVG is just the same two paths rendered over and over again on a regular terminal grid, we can massively shrink the inlined size of the SVG by rendering it with JavaScript using RLE (Run Length Encoding).

e.g. 10A212.9A| = "10 × 1, 212 × space, 9 × 1, newline"

Before: 89,023 bytes (484,749 until recently)
After: 3,816 bytes

Despite the smaller size, I left alone the code that conditionally skips rendering this decoration inside unit tests and console.

The SVG has no id and the JS targets it by looking at the previous element sibling, so the "double render" trick for the hover effect is still fine.

Because this SVG is just the same two paths rendered over and over again
on a perfect terminal grid, we can massively shrink the inlined size of
the SVG by rendering it with JavaScript using RLE (Run Length Encoding).

Before: 89,023 bytes (484,749 until recently)
After: 3,816 bytes
@taylorotwell taylorotwell merged commit 605def0 into laravel:12.x Feb 9, 2026
73 checks passed
@taylorotwell
Copy link
Member

Thanks!

@jasonmccreary
Copy link
Contributor

@markjaquith 🤯

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.

3 participants