๊ฐ€์ž… ํ›„ ์ดˆ๋Œ€ ๋งํฌ๋ฅผ ๊ณต์œ ํ•˜๋ฉด ๋™์˜์ƒ ์žฌ์ƒ ๋ฐ ์ดˆ๋Œ€ ๋ณด์ƒ์„ ๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Kenneth Skovhus
@kenneth_skovhus
Flipping bits to bring back magic at @linear
๊ฐ€์ž… February 2016
1.5K ํŒ”๋กœ์ž‰ ์ค‘    2.3K ํŒฌ
Recent performance fix: lazy-loaded CSS comes with a price. @vite_js build.cssCodeSplit helped us. Linear still uses CSS Modules for complex selectors not yet migrated to @stylexjs. When our module preloader warmed lazy-loaded chunks that contained CSS, it attached new stylesheets in quick succession. Each invalidated style and layout across the page, triggering 28 full-page layouts. ๐Ÿฅบ We fixed this by setting `build.cssCodeSplit` to false, which makes Vite emit one stylesheet. As StyleX already uses atomic CSS, the file size is acceptable and bounded. That introduced a new issue: Vite adds the file to the HTML as a render-blocking link, delaying our custom loader icon baked into the HTML. Our post-build step rewrites the link to media=print so it fetches early without blocking the loader. We wait for it to load, switch it to media=all, and only then render the app.
๋” ๋ณด๊ธฐ