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

[BUG]: No Significant Difference with @octokit Submodules #2648

Closed
1 task done
lucioerlan opened this issue Apr 1, 2024 · 6 comments
Closed
1 task done

[BUG]: No Significant Difference with @octokit Submodules #2648

lucioerlan opened this issue Apr 1, 2024 · 6 comments
Labels
Type: Bug Something isn't working as documented Type: Support Any questions, information, or general needs around the SDK or GitHub APIs

Comments

@lucioerlan
Copy link

What happened?

Good afternoon, friends. In my project, I'm using a Lambda function to interact with GitHub via Octokit.

We place great importance on best practices regarding Lambda functions, particularly concerning the size of the ZIP package generated when packaging the Lambda function.

Running the command npx sls package locally, I noticed there doesn't seem to be a difference between using the full Octokit module and installing its submodules separately. It appears the @octokit folder installs various components that my project does not use.

This behavior seems somewhat strange to me. Is there actually an option to use submodules in the Octokit library?

Versions

Node v18 and Node v20

Relevant log output

~ ZIP size without submodules: 18.1 MB
~ ZIP size with submodules: 18.1 MB

Code of Conduct

  • I agree to follow this project's Code of Conduct
@lucioerlan lucioerlan added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Apr 1, 2024
Copy link

github-actions bot commented Apr 1, 2024

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@wolfy1339
Copy link
Member

The purpose of this package is to bundle all best practices for Octokit modules.

If you want to lower your bundle size, I would use the packages separately, and only include the ones you actually use.

If you have any specific improvement points, feel free to do a follow up PR

@kfcampbell kfcampbell added Type: Support Any questions, information, or general needs around the SDK or GitHub APIs and removed Status: Triage This is being looked at and prioritized labels Apr 1, 2024
@kfcampbell kfcampbell moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Apr 1, 2024
@lucioerlan
Copy link
Author

@wolfy1339 , thank you for the feedback.

How do you install individual submodules nowadays? I tried to install just the auth-app and rest submodules, but everything else came along too.

I used:

npm i @octokit/auth-app
npm i @octokit/rest

and nothing has changed

@wolfy1339
Copy link
Member

The @octokit/rest package doesn't have any actual code, it is simply a wrapper of different plugins to make a best practices package for interacting with the GitHub API.

It is normal that there are many packages, as things are split into different plugins to enable extensibility.

@lucioerlan
Copy link
Author

tks @wolfy1339, I'll go ahead and close this issue. 🚀

@github-project-automation github-project-automation bot moved this from 🔥 Backlog to ✅ Done in 🧰 Octokit Active Apr 2, 2024
@gr2m
Copy link
Contributor

gr2m commented Apr 2, 2024

If bundle size is a concern, but you still want the convenience of the types for all REST API endpoints, I'd suggest to use @octokit/request: https://bundlephobia.com/package/@octokit/request

If that is not enough beause you need plugins, advanced authentication, or graphql, I'd use @octokit/core: https://bundlephobia.com/package/@octokit/[email protected]

Both are a lot smaller than octokit: https://bundlephobia.com/package/[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as documented Type: Support Any questions, information, or general needs around the SDK or GitHub APIs
Projects
Archived in project
Development

No branches or pull requests

4 participants