Open
Conversation
|
Cursor Agent can help with this pull request. Just |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- 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.
24ab0c0 to
c2beb9e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
@iconify/json: Replaced with@iconify-json/ph(already in devDependencies), saving ~386MB.firebasewith@firebase/app+@firebase/auth: Switched from the full Firebase SDK to modular imports, reducing the bundle by ~17MB.octokitwith@octokit/core: Switched to the core Octokit package as only the.request()method was used, resulting in a smaller dependency tree.@astrojs/tailwind: Removed an unused Astro integration as Tailwind v4 is used directly with@tailwindcss/vite.Build Optimizations
react-syntax-highlighterPrismLight: Switched fromPrism(which loads all ~300 languages) toPrismLightwith only 11 specifically registered languages, dramatically reducing the client bundle size for the chat widget.manualChunksinastro.config.mjsto split large vendor dependencies (Firebase, React ecosystem) into separate, cacheable chunks, improving caching efficiency and reducing re-downloads.