Skip to content

Conversation

@Ashutosh0x
Copy link

What does this PR do?

This PR addresses issue #23104 by converting eager import() calls in generated app store files to lazy getter functions.

Problem

When any page loaded that imported the app store maps, all 110+ app modules would be compiled by Next.js even if only 1-2 were needed. This caused 10-12s initial page load times in local development.

Solution

Convert eager imports to lazy getter functions that only trigger the import when accessed.

Changes

  • Modified build.ts to generate lazy getter functions for non-.tsx imports
  • Updated all consumer utilities:
    • getCrm.ts
    • getCalendar.ts
    • getAnalytics.ts
    • getVideoAdapters.ts
    • apps/web/pages/api/integrations/[...args].ts

Expected Impact

80%+ reduction in local dev page load times (target: < 2s, down from 10-12s).

How should this be tested?

  1. Run yarn app-store:build to regenerate the app store files
  2. Start local dev with yarn dev
  3. Measure initial page load times - should be significantly faster
  4. Test app integrations (Calendar, CRM, Payment, Video) to ensure they still work correctly

Fixes #23104

@vercel
Copy link

vercel bot commented Jan 5, 2026

Someone is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLAassistant commented Jan 5, 2026

CLA assistant check
All committers have signed the CLA.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Jan 5, 2026
@github-actions github-actions bot added $2K app-store area: app store, apps, calendar integrations, google calendar, outlook, lark, apple calendar High priority Created by Linear-GitHub Sync performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive 🐛 bug Something isn't working 💎 Bounty A bounty on Algora.io labels Jan 5, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 6 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app-store area: app store, apps, calendar integrations, google calendar, outlook, lark, apple calendar 💎 Bounty A bounty on Algora.io 🐛 bug Something isn't working community Created by Linear-GitHub Sync High priority Created by Linear-GitHub Sync performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive size/M $2K

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local dev crazy slow

2 participants