-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Vite plugin calls resolvePluginConfig
multiple times per request
#8369
Comments
I think this is a somewhat known issue and probably considered not so critical (as initial perf improvement is done by #7908). Currently remix/packages/remix-dev/vite/plugin.ts Lines 837 to 839 in 438a9b3
I thought such behavior would make sense, so I attempted such refactoring sometime ago #8164 Technically route files can live anywhere since |
For most apps it's probably not an issue. But if you're using custom routes that scan the file system, it could cause performance problems for projects with many routes. |
Unless there's a better way to setup test routes (for quickly adding things without forms, like users), this really slows down tests. i.e. If the grunge stack was converted to use vite, it'll suffer a bit because it sets up a create-user test route in its config. https://github.com/remix-run/grunge-stack/blob/main/remix.config.js |
Fixed by #8164 |
Reproduction
https://github.com/kiliman/remix-resolve-plugin-config
This shows that
resolvePluginConfig
is being called multiple times per request.System Info
Used Package Manager
npm
Expected Behavior
Remix should only call
resolvePluginConfig
once at startup and when config changes.Actual Behavior
resolvePluginConfig
is called multiple times per request.The image below shows the initial call, but when I opened the home page, you'll see it called the function again four times in a row.
The text was updated successfully, but these errors were encountered: