jantimon / next-yak

a streamlined CSS-in-JS solution tailor-made for Next.js, seamlessly combining the expressive power of styled-components syntax with efficient build-time extraction and minimal runtime footprint, ensuring optimal performance and easy integration with existing atomic CSS frameworks like Tailwind CSS
https://yak.js.org
108 stars 2 forks source link

reuse compilation result of ts-loader #107

Closed jantimon closed 1 month ago

jantimon commented 1 month ago

right now the special import e.g. ./page.yak.module.css!=!./page?./page.yak.module.css is executed by the css-loader directly from it's original source

this means that the typescript transformation has to be run again for the entire code although it was just transformed by the ts-loader

to workaround this issue the compilation result of ./page could be reused for ./page.yak.module.css!=!./page?./page.yak.module.css

such a workaround could also help us for swc as executing swc from the css-loader with the very same options might be tricky

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-yak-benchmark ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 9:00am
yacijs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 9:00am
codspeed-hq[bot] commented 1 month ago

CodSpeed Performance Report

Merging #107 will improve performances by 12.1%

Comparing feature/faster-compilation (231dd5b) with main (ddc1b3d)

Summary

⚡ 2 improvements

Benchmarks breakdown

Benchmark main feature/faster-compilation Change
render KanjiLetterComponentStyled 322.1 ms 287.3 ms +12.1%
render KanjiLetterComponentYak 239.5 ms 148.3 ms +61.51%
jantimon commented 1 month ago

I am no longer able to build the playground locally 🤷‍♂️

@Mad-Kat could you please take a look?