Prismjs helpers are loaded synchronously, blocking the main thread
Closed this issue · 0 comments
rejhgadellaa commented
I noticed that the library appends a <script> tag in the <head> to load prism:
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.30.0/components/prism-core.min.js"></script>AFAIK, <script> tags without async (or defer) attribute will be loaded synchronously, so this will block the main thread while the script loads?
(Or is this not the case because it's added dynamically?)
I would expect an async attribute:
<script async src="https://cdn.jsdelivr.net/npm/prismjs@1.30.0/components/prism-core.min.js"></script>