Skip to content

Package and build size#366

Open
gregnazario wants to merge 9 commits intomainfrom
cursor/package-and-build-size-5e91
Open

Package and build size#366
gregnazario wants to merge 9 commits intomainfrom
cursor/package-and-build-size-5e91

Conversation

@gregnazario
Copy link
Collaborator

Optimize dependencies and build configuration to significantly reduce bundle size and improve caching.

This PR implements several optimizations to shrink the application's overall size and improve load performance:

Dependency Optimizations

  • Remove @iconify/json: Replaced with @iconify-json/ph (already in devDependencies), saving ~386MB.
  • Replace firebase with @firebase/app + @firebase/auth: Switched from the full Firebase SDK to modular imports, reducing the bundle by ~17MB.
  • Replace octokit with @octokit/core: Switched to the core Octokit package as only the .request() method was used, resulting in a smaller dependency tree.
  • Remove @astrojs/tailwind: Removed an unused Astro integration as Tailwind v4 is used directly with @tailwindcss/vite.

Build Optimizations

  • react-syntax-highlighter PrismLight: Switched from Prism (which loads all ~300 languages) to PrismLight with only 11 specifically registered languages, dramatically reducing the client bundle size for the chat widget.
  • Vite manual chunks: Configured manualChunks in astro.config.mjs to split large vendor dependencies (Firebase, React ecosystem) into separate, cacheable chunks, improving caching efficiency and reducing re-downloads.

Open in Cursor Open in Web

@cursor
Copy link

cursor bot commented Feb 6, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aptos-docs Ready Ready Preview, Comment Feb 7, 2026 4:55pm

Request Review

@gregnazario gregnazario marked this pull request as ready for review February 6, 2026 15:11
@gregnazario gregnazario requested review from Copilot and moonclavedev and removed request for Copilot February 6, 2026 15:11
Copilot AI review requested due to automatic review settings February 6, 2026 15:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

- Replace firebase (32MB) with modular @firebase/app + @firebase/auth (~15MB)
- Remove @iconify/json (390MB) - @iconify-json/ph (4.4MB) already covers all used icons
- Replace octokit with lighter @octokit/core (only .request() method needed)
- Remove unused @astrojs/starlight-tailwind and @astrojs/tailwind (using @tailwindcss/vite)
- Optimize react-syntax-highlighter: use PrismLight with only needed languages + ESM imports
- Add Vite manual chunks for Firebase and React vendor splitting
…ighlighting

Replace the move->rust fallback with a proper Move language grammar that
handles Move 2.x syntax: modules, structs, enums, abilities, address
literals, annotations, and common control flow keywords.
- Convert Firebase app and auth initialization to async with dynamic imports.
  The vendor-firebase chunk (~155KB) is now only fetched when a user
  interacts with auth (Faucet page), not eagerly on every page.
- Lazy-load ChatMessage via React.lazy() so react-markdown,
  react-syntax-highlighter, remark-gfm, and Prism language grammars
  are deferred until chat messages are actually rendered.
- Both changes reduce the initial page load for the vast majority of
  users who never use the Faucet or the chat widget.
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.

3 participants