evilmartians / figma-polychrom

Figma plugin for displaying the contrast level and font size recommendations according to the APCA method
https://www.figma.com/community/plugin/1281280685402026529/polychrom
MIT License
67 stars 5 forks source link

Modern approach with JS loading #9

Closed ai closed 1 year ago

ai commented 1 year ago

Put <script> to the end of HTML is old approach (to be sure that JS will be executed only when all HTML is loaded). With it JS file will be loaded a little later.

Modern approach is just add defer attribute which ask browser to run script only when HTML will be loaded.

mikhin commented 1 year ago

Thanks! Yep, it could be a great idea, but we always need to look at exact case. In case with the React app I think it doesn't make sense. Besides it is just the default for the Vite boilerplate.