form icon indicating copy to clipboard operation
form copied to clipboard

The installation size is large due to the dependency on `@remiux-run/node`.

Open L4Ph opened this issue 11 months ago • 3 comments

The current install size of @tanstack/react-form is 24MB. https://packagephobia.com/result?p=@tanstack/react-form

Image

Someone has already asked me about this on my behalf and I understand that you have also responded about it. https://x.com/tannerlinsley/status/1897323043510431970

It's 11.8kb min. Don't use packagephobia or bundlephobia.

What's the problem?

I see the problem as being that it is just a form and a package of wrappers for it, which is such a large installation size. Just doing the npm i @tanstack/react-form generates about 30 MB of communication. This is not very desirable for CI or for developers who have pipelines in place for builds.

In fact, I have not been able to employ this in a new product I am creating because I am afraid of it.

What is this package used for?

That's it. Just those three lines. https://packagephobia.com/result?p=%40remix-run%2Fnode

import { createCookie } from '@remix-run/node'

export const _tanstackInternalsCookie = createCookie('_tanstack_form_internals')

https://github.com/TanStack/form/blob/main/packages%2Freact-form%2Fsrc%2Fstart%2Futils.ts

This improvement alone will reduce the package installation size to about 1 MB. Perhaps hopefully the post-bundle size can be further reduced as well.

L4Ph avatar Mar 06 '25 04:03 L4Ph

About the questions that will probably come up.

Q. Why not just use a cache (in CI/CD)? A. Yes, of course I agree, and I am sure everyone is already doing so. But it's not very nice for developers to have to allocate so much disk space and network bandwidth, even temporarily, just for the form library and its wrappers. If the installation size can be kept small, it should be.

L4Ph avatar Mar 06 '25 04:03 L4Ph

This is great research, we'll remove that dep in favor of something else.

At the same time please do not tag specific maintainers - it's in poor taste.

crutchcorn avatar Mar 06 '25 06:03 crutchcorn

Tanner was the one who answered this in X, and since I was new to sending an issue to a repository of this size and organization, I felt it would be quicker to ask Tanner, so I was menshoning... I am so sorry... I will turn it off.

L4Ph avatar Mar 06 '25 06:03 L4Ph

Image

https://packagephobia.com/result?p=@tanstack/react-form

For everyone in this thread, this is a great visualization!

ryoppippi avatar Apr 12 '25 13:04 ryoppippi