Skip to content

Instantly share code, notes, and snippets.

@fcsonline
Created March 4, 2026 13:58
Show Gist options
  • Select an option

  • Save fcsonline/823d61a9d5d78e3dd1cffc95b61cee39 to your computer and use it in GitHub Desktop.

Select an option

Save fcsonline/823d61a9d5d78e3dd1cffc95b61cee39 to your computer and use it in GitHub Desktop.
Outgoing edges from app chunk — hash cascade analysis

Outgoing Edges from app Chunk — Full Report

Summary

Total outgoing edges to module chunks: 46

The app chunk is a "hub" with 46 outgoing static imports to module chunks AND ~108 incoming static imports from module chunks. Rollup computes a chunk's hash from its own content + the hashes of its imported chunks. Any change to any of those 46 modules cascades through app to all ~108 dependents.

By Source Category

Source Edges Exclusive edges Notes
Non-chunkable module cross-imports 45 9 The dominant source. 15 non-chunkable modules importing from chunkable module chunks
Tracking events (core/lib/Tracking/events.ts) 28 0 All overlap with non-chunkable edges
Navigation (core/lib/navigation/index.ts) 23 0 All overlap with non-chunkable edges
Core other (components, lib, testing) 10 0 All overlap
Manifests (core/lib/manifests/*) 5 0 All overlap
GraphQL type policies 2 0 All overlap

Key Insight

No category has exclusive edges except non-chunkable modules. The 9 edges that only exist because of non-chunkable modules:

  • ai
  • app_store
  • command_bar
  • comments
  • cronofy
  • custom_resources
  • integrations
  • personal_settings
  • questionnaires

Even if navigation, tracking, manifests, and type policies were replaced with virtual modules using dynamic imports, app would still have 45 outgoing edges through non-chunkable module cross-imports.

Non-chunkable Module Cross-imports

These 15 modules are not chunkable (they have "offenses" — eager cross-module imports) so all their code lands in the app chunk. Each one imports from chunkable module chunks, creating outgoing edges.

Module Edges Target Chunks
attendance 17 app_store, approvals, billing, compensations, contracts, custom_resources, employees, engagement, layout, payroll_bundle, shift_management, surveys, teams, time_categories_settings, timeoff, upsell, upselling_kit
trainings 15 ai_reports, approvals, cronofy, documents, employees, engagement_surveys, forms, insights, layout, legal_entities, personal_settings, questionnaires, universal_importer, upsell, upselling_kit
finance 13 ats, cost_centers, documents, employees, layout, payroll_bundle, product_updates, profile, software_management, universal_exports, universal_importer, upsell, upselling_kit
expenses 11 approvals, comments, cost_centers, employees, inbox_tasks, integrations, layout, payroll_bundle, universal_exports, upsell, upselling_kit
performance_process 10 ai, documents, employees, layout, one_on_ones, performance_cycles, performance_feedbacks, questionnaires, upsell, upselling_kit
project_management 8 command_bar, documents, employees, layout, tasks, universal_exports, upsell, upselling_kit
banking 6 approvals, employees, layout, universal_exports, upsell, upselling_kit
marketplace 6 employees, layout, marketplace_modules, payroll_integrations_datev_lauds, upsell, upselling_kit
procurement 6 approvals, comments, documents, employees, forms, layout
performance_analytics 5 engagement, layout, profile, upsell, upselling_kit
permissions 5 authentication, employees, layout, teams, timeoff
goals 3 employees, layout, performance_cycles
external_users 2 authentication, layout
talent 2 ai_reports, forms
operations 1 timeoff

Core Aggregator Files Detail

Navigation (core/lib/navigation/index.ts) — 23 edges

Statically imports navigation objects from ~60 modules. Assembles them into a single navigation tree used by NavigationProvider.

Target chunks: ai_reports, approvals, ats, authentication, billing, compensations, dashboard, documents, employees, engagement, insights, marketplace_modules, one_on_ones, payroll_bundle, performance_cycles, performance_feedbacks, profile, shift_management, software_management, tasks, time_categories_settings, timeoff, upsell

Tracking Events (core/lib/Tracking/events.ts) — 28 edges

Statically imports event string constants from ~80 modules. Assembles them into trackingEvents object used in 1,784 call sites across the codebase.

Target chunks: approvals, ats, billing, compensations, dashboard, employees, engagement, inbox_tasks, insights, legal_entities, marketplace_modules, one_on_ones, payroll_bundle, payroll_integrations_datev_lauds, performance_cycles, performance_feedbacks, product_updates, profile, shift_management, software_management, surveys, tasks, teams, time_categories_settings, timeoff, universal_exports, universal_importer, upsell, upselling_kit

Manifests (core/lib/manifests/*) — 5 edges

Imports activity components and module manifests (sidebar items).

Target chunks: approvals, dashboard, engagement_surveys, forms, inbox_tasks

GraphQL Type Policies (core/lib/graphql/buildClient.ts) — 2 edges

Imports Apollo type policies from modules. These are needed synchronously at InMemoryCache construction time.

Target chunks: cost_centers, inbox_tasks

Implications for Virtual Modules Approach

Virtual modules (as in the POC at fcsonline/factorial-specs) with dynamic imports would theoretically remove the core aggregator edges. But since non-chunkable modules contribute 45/46 edges (and 9 exclusive ones), the cascade would persist unless those modules are also made chunkable.

The path forward requires addressing both:

  1. Core aggregators → virtual modules with dynamic imports (removes 0 exclusive edges but reduces coupling)
  2. Non-chunkable modules → fix offenses to make them chunkable (removes 9 exclusive edges and eliminates the 45-edge overlap)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment