You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First let me thank you and every contributors for this package. I first went with Shiki.js for code-highlighting in the browser, but I found that was not so much performant for my needs, too much JavaScript was loaded, and I suspect it badly impacted the page interactivity. To me, a server-based solution is so much better because I can use HTTP cache for more optimisation! :)
I've just found Highlighter#withGutter() is in fact not a real "wither" , even if its name starts with with.
"Wither" methods are special methods that clones the object, mutate it, and returns the cloned object, this way the original object stays untouched. We can find many exemples in the PHP ecosystem:
Hi,
First let me thank you and every contributors for this package. I first went with Shiki.js for code-highlighting in the browser, but I found that was not so much performant for my needs, too much JavaScript was loaded, and I suspect it badly impacted the page interactivity. To me, a server-based solution is so much better because I can use HTTP cache for more optimisation! :)
I've just found
Highlighter#withGutter()
is in fact not a real "wither" , even if its name starts withwith
."Wither" methods are special methods that clones the object, mutate it, and returns the cloned object, this way the original object stays untouched. We can find many exemples in the PHP ecosystem:
So we have two solutions:
enableGutter
, or something else that will says to users "this will not returns a new object".In both cases, to not introduce breaking changes, we can trigger a deprecation that will be removed in the next major version (like Symfony does).
WDYT?
The text was updated successfully, but these errors were encountered: