Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

2.3 KB
Raw Blame

description: "Keep the web startup bundle small: views, blocks, and modals load lazily." paths: - "apps/web/src/" - "apps/web/index.html" globs: "apps/web/src/,apps/web/index.html" alwaysApply: false

Startup bundle

  • Everything statically reachable from src/index.tsx downloads and runs before the first screen. Views, block components, and modals load through lazy() / lazyNamed (@core/util/lazyNamed) inside a <Suspense>; never statically import one into a shared hub (Root, Layout, AppProviders, componentRegistry, app-router-view, routes/shells.tsx, block definition.ts, Lexical init.ts).
  • Each top-level route picks its shell in app-router-view.tsx (routes/shells.tsx): authRoute pages and booking links render without app chrome, and appRoute renders AppShell — the app's providers (AppProviders), layout/context owner (SplitLayoutProvider), chrome (AppChrome in Layout.tsx), and split content. Compose these in the route shell; keep AppChrome independent of page selection. Put state only the app's views use in AppProviders, not Root; Root keeps what every page or call needs.
  • index.html paints a boot shell before any JS runs: the saved theme's background, the rail column, and the desktop app's content card — no app content. The first shell to mount dismisses it (dismissBootShell). Keep its rail width and desktop inset in step with SidebarRail and SplitLayout.
  • Read a supported iOS notification launch intent before mounting the router; keep startup payload validators in the generated compact push-schema entry rather than importing the full service schema bundle.
  • Do not register an asset-caching service worker. Keep public/sw.js at its deployed URL so existing workers can update, clear their shell and asset caches, and unregister; it must not intercept requests.
  • The build fails if any emitted file exceeds CloudFront's 10 MB compression limit; split it rather than raising the limit.
  • The build also fails if a chunk has no source map or a map exceeds PostHog's 25 MB symbolication limit. startupChunks() in vite.base.ts splits the code the entry loads into app, vendor, and api-schemas chunks so each map stays under it; it moves only modules the entry already imports.