Skip to content

cmd/tclipd: defer the prism script#105

Merged
Erisa merged 2 commits into
tailscale-dev:mainfrom
SapphoSys:chloe/prism-defer
Jun 11, 2026
Merged

cmd/tclipd: defer the prism script#105
Erisa merged 2 commits into
tailscale-dev:mainfrom
SapphoSys:chloe/prism-defer

Conversation

@SapphoSys

Copy link
Copy Markdown
Contributor

Since the prism.js script is 579KB, loading an individual paste means the user has to wait for the blocking script to fully finish loading before they can view the paste contents.

This PR defers the script so that the paste can load first, and the Prism highlighter can kick in afterwards.

I also added in a neat little optimization hack: I forced in a language-text class so paste contents have a proper codeblock and don't bleed into the background. The Prism script then removes this class and adds in a proper one depending on the language when it finishes loading.

@Erisa Erisa merged commit cebc20f into tailscale-dev:main Jun 11, 2026
1 check passed
@SapphoSys SapphoSys deleted the chloe/prism-defer branch June 11, 2026 17:55
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