-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render special blockquotes on the backend #351
Conversation
public/img/callouts/star.min.svg
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This asset is no longer referenced.
$environment->addExtension(new GithubFlavoredMarkdownExtension()); | ||
$environment->addExtension(new AutolinkExtension()); | ||
$environment->addExtension(new StrikethroughExtension()); | ||
$environment->addExtension(new TableExtension()); | ||
$environment->addExtension(new TaskListExtension()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've inlined the extensions previously added in the extracted GithubFlavoredMarkdownExtension
class.
case "laracasts": | ||
case "video": | ||
return ['/img/callouts/laracast.min.svg', 'bg-blue-600', 49, 40]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "laracasts"
tag does not appear in the docs anymore. Only "video"
does.
This PR moves the rendering of the pretty "highlight" blockquotes to the backend. Currently, there is a slight visible flicker and content shift for all blockquotes.
In addition to pushing the rendering to the backend, it also inlines the highlight images as inline SVGs. This reduces the requests needed to be made to render a page. The images are very small and we also use GZIP, so inlining them really has no impact on HTML load times.
Overall, this should also have a positive impact on load / interactive times.
Flicker example
Screen.Recording.2024-07-16.at.09.00.06.mov
How it works
Currently, we ship the raw blockquote content to the frontend:
Once the DOM has loaded into the browser, we then manipulate the DOM and update the blockquotes to their fancy version.
This causes the flicker. Now we just deliver the fancy highlight in the HTML delivered to the browser.