New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(remix-dev/vite): use transformRequest
for route exports anlaysis to utilize Vite's caching
#8113
Conversation
…is to utilize vite's transform cache
|
transformRequest
for route exports anlaysis to utilize vite's transform cachetransformRequest
for route exports anlaysis to utilize Vite's cache
transformRequest
for route exports anlaysis to utilize Vite's cachetransformRequest
for route exports anlaysis to utilize Vite's caching
0053fe8
to
9649e5b
Compare
f1d29b6
to
58010e1
Compare
…se `vite build --ssr` stuck?)" This reverts commit d1cdc12.
977a746
to
0c95aef
Compare
I thought this idea makes sense and it feels like a nice cleanup as well, but I don't have a definitive way to measure overall perf impact, so let me close this for now. I'm suspecting the actual bottleneck is |
This is a 2nd idea extracted from #8102.
Main changes are:
ViteDevServer.transformRequest
instead ofpluginContainer.transform
to benefit from Vite's module caching with automatic invalidation on file change.{ ssr: true }
so that Vite won't transformexport ...
into__vite_ssr_exports__(...)
, which would break es-module-lexer's exports analysis. this also requires filtering out remix's own plugin further for child compiler.Actually I found something very odd withoutssr: true
. For some reason,vite build --ssr
was stuck forever (locally reproducible on my Linux. Maxos seems fine on CI).So for now, I put it back
ssr: true
withexperimental.skipSsrTransform
so that__vite_ssr_exports__
will not be injected. But I still feelssr: false
transform should technically work but I'm just missing something, so I'll investigate it further.preTransformRequests
was causing tovite build --ssr
stuck forever. After #8121 is merged, this is disabled for child compiler and the issue is resolved.testing strategy
It's still rough measurement but the effect of vite caching
transformRequest
can be seen on this demo project https://github.com/hi-ogawa/remix-benchmarkThe log is generated based on
wrapConsoleTimeAsync
4417a49.before
after