Skip to content
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

Consider removing @vercel/node from the dependencies #154

Closed
ysgk opened this issue Mar 18, 2023 · 8 comments · Fixed by #222
Closed

Consider removing @vercel/node from the dependencies #154

ysgk opened this issue Mar 18, 2023 · 8 comments · Fixed by #222
Labels
enhancement New feature or request

Comments

@ysgk
Copy link

ysgk commented Mar 18, 2023

🐛 Bug Report

Currently, the installation size of this package is huge. This is partly due to @vercel/node, which lists an old version of typescript as its dependency, not a peer dependency. The size of turborepo-remote-cache is 202MB, of which typescript alone is more than 50MB. If your project uses a newer version of typescript, as most likely it does, two different versions will be installed, which means typescript alone will be over 100MB in size. They are discussing about moving typescript to peer dependencies, but will not happen for the time being.

However, @vercel/node is currently only used for some trivial type information in this package: VercelRequest and VercelResponse. These two type definitions are nothing but the following:

import { ServerResponse, IncomingMessage } from 'http';
export declare type VercelRequestCookies = {
    [key: string]: string;
};
export declare type VercelRequestQuery = {
    [key: string]: string | string[];
};
export declare type VercelRequestBody = any;
export declare type VercelRequest = IncomingMessage & {
    query: VercelRequestQuery;
    cookies: VercelRequestCookies;
    body: VercelRequestBody;
};
export declare type VercelResponse = ServerResponse & {
    send: (body: any) => VercelResponse;
    json: (jsonBody: any) => VercelResponse;
    status: (statusCode: number) => VercelResponse;
    redirect: (statusOrUrl: string | number, url?: string) => VercelResponse;
};

It doesn't seem to me this is worth the 50MB disk size. Therefore, I suggest that you consider removing @vercel/dev, at least for the time being.

To Reproduce

npm init -y
npm install turborepo-remote-cache typescript@4.9.5 --save-dev
du -sh node_modules # 265M
du -sh node_modules/typescript # 64M
du -sh node_modules/@vercel/node/node_modules/typescript # 58M

Expected behavior

Only one version of typescript will be installed, reducing the installation size.

Your Environment

  • os: Mac
  • any other relevant information
@fox1t fox1t added the enhancement New feature or request label Mar 20, 2023
@matteovivona
Copy link
Collaborator

@fox1t, it might make sense to remove Vercel dep

@fox1t
Copy link
Collaborator

fox1t commented Mar 21, 2023

@ysgk are you using this package as a library? If so we should extract the needed parts and make it importable/requirable. I like the idea since it will transform this package into a monorepo. We can use https://github.com/ducktors/crane and inject the monorepo.

@ysgk
Copy link
Author

ysgk commented Mar 21, 2023

@fox1t
I use it mainly as a command line tool in CI. So actually, the type information is completely unnecessary for me. But it seems like a good idea to make it a monorepo to isolate the type information.

@fox1t
Copy link
Collaborator

fox1t commented Mar 22, 2023

OK. We will work soon on this. Thanks for reporting!

@matteovivona
Copy link
Collaborator

@fox1t I'd remove the support for Vercel. It's pretty useless right now #159

@fox1t
Copy link
Collaborator

fox1t commented May 3, 2023

Might be a good solution. It will be a major bump and we need to provide an alternative. I need to think about it a little bit more.

@trm217
Copy link

trm217 commented May 3, 2023

I would really appreciate it, if Vercel could remain as a option to deploy the custom cache to. :)

@fox1t
Copy link
Collaborator

fox1t commented May 15, 2023

I agree. I don't like to cut features we already have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants