Skip to content

perf: replace the octokit meta-package with @octokit/core - #105

Merged
cletqui merged 1 commit into
mainfrom
petithub-slim-octokit
Sep 2, 2026
Merged

cletqui merged 1 commit into
mainfrom
petithub-slim-octokit

Conversation

@cletqui

@cletqui cletqui commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Follow-up B from the review. The app only uses octokit.request() (core) and octokit.rest.repos.* / octokit.rest.users.getAuthenticated (rest-endpoint-methods plugin). Swapping the umbrella octokit package for @octokit/core + @octokit/plugin-rest-endpoint-methods drops @octokit/app, oauth-app, webhooks, plugin-retry, plugin-throttling, plugin-paginate-* and their transitive deps.

  • Worker bundle 558 kB → 484 kB (gzip 138 → 118 kB), 202 → 183 packages.
  • src/utils/octokit.tsx now builds Octokit = Core.plugin(restEndpointMethods) and exports it (value + type); other files import the type from there.
  • One type fix: @octokit/request@10 types some ids as number | bigintgetMaxId now coerces with Number().

Verified: bun run typecheck clean, bun run build OK, wrangler pages dev dist boots and /, /api (401), /api/swagger (200), /github/login (302) all respond. Live GitHub calls couldn't be exercised offline — worth a glance at the first deploy that repos still load and login works.

Further cut possible later: drop plugin-rest-endpoint-methods too and use raw octokit.request("GET /repositories") strings (~200 kB of endpoint metadata), at the cost of the typed helpers.

Only @octokit/core (for .request) and @octokit/plugin-rest-endpoint-methods
(for .rest.repos / .rest.users) are used. Dropping the umbrella `octokit`
package removes @octokit/app, oauth-app, webhooks, plugin-retry,
plugin-throttling, plugin-paginate-* and their deps.

Worker bundle 558 kB -> 484 kB (gzip 138 -> 118), 202 -> 183 packages.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying petithub with  Cloudflare Pages  Cloudflare Pages

Latest commit: de98078
Status: ✅  Deploy successful!
Preview URL: https://d3737b28.petithub.pages.dev
Branch Preview URL: https://petithub-slim-octokit.petithub.pages.dev

View logs

@cletqui
cletqui merged commit 1a0d3ee into main Sep 2, 2026
5 checks passed
@cletqui
cletqui deleted the petithub-slim-octokit branch September 2, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant