-
-
Notifications
You must be signed in to change notification settings - Fork 92
fix: remove optionalDependencies from @fastify/vite #257
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
Conversation
✅ Deploy Preview for agitated-mahavira-26f8f9 canceled.
|
|
Can you update |
I don't see any mention of |
|
There isn't, since they were part of |
What's the reason they're needed for development? |
|
When developing the starters, somehow, local |
|
It's because the renderer is being passed by string to fastify/vite which can't resolve it. If we pass it like this it'll work, and we can remove the optional dependencies, await server.register(FastifyVite, {
root: import.meta.url,
renderer: import.meta.resolve('@fastify/vue'),
}) |
|
We should update the ci file to also run test on main I guess, this PR bypassed them |
npm always tries to install optionalDependencies by default, even if you don't need or use them. This means that every @fastify/vite installation will also result in all these other packages entering node_modules.
a66515d to
5b1a089
Compare
|
No, please, that's unnecessary complexity. I'm okay with using |
* fix: Remove optionalDependencies from @fastify/vite (#257) * docs: rm outdated info * docs: update roadmap * docs: update known limitations * docs: update section on route location * chore: fix pnpm-lock.yaml * Import meta dirname filename (#263) * Use import.meta.dirname instead of import.meta.url * Use import.meta.filename * undo changes in contrib folder * Fix some stuff I missed * Add src/ directory to TypeScript starters (#264) * Bump @fastify/[email protected] --------- Co-authored-by: Jonas Galvez <[email protected]>
* fix: Remove optionalDependencies from @fastify/vite (#257) * docs: rm outdated info * docs: update roadmap * docs: update known limitations * docs: update section on route location * chore: fix pnpm-lock.yaml * Import meta dirname filename (#263) * Use import.meta.dirname instead of import.meta.url * Use import.meta.filename * undo changes in contrib folder * Fix some stuff I missed * Add src/ directory to TypeScript starters (#264) * Bump @fastify/[email protected] * fix: install tsx into react/vue starters for typescript * fix: set allowJs to false in starters' tsconfig.json files * Bump @fastify/[email protected] * Run pnpm prep-for-release --------- Co-authored-by: Jonas Galvez <[email protected]>
npmalways tries to install transitive optionalDependencies by default, even if you don't need or use them.This means that every time someone does
npm i @fastify/vite, they will also result install these other packages into theirnode_modulesdirectory, unless they explicitly runnpm i @fastify/vite --omit=optional.This is not only wasteful of our users' HDD space, but it also can cause weird issues with tools like
snyk. For example, when I installed@fastify/vite, it came with@fastify/htmx, but it did not come with the dependencies of@fastify/htmx. Specifically, the@kitajs/htmlwas not installed.snykdidn't know what to do in this situation -- it saw@kitajs/htmlinpackage-lock.jsonbut didn't find it innode_modules, so it thought mypackage-lock.jsonwas out of sync with mypackage.jsonand threw an error.Is there any advantage we gain from adding these things in
optionalDependencies? If not, I think it's best to just delete them.Checklist
npm run testandnpm run benchmarkand the Code of conduct