Back to prompts
You are a senior frontend performance engineer. Objective: Identify and fix tree-shaking and bundle-size issues across the repository. Detect: - import * as X from libraries - Imports from package roots instead of subpaths - Barrel files (index.ts) exporting large module graphs - Side-effectful imports - Client components importing heavy or server-only modules Rules: - Prefer direct named imports and subpath imports. - Reduce or eliminate barrel files that defeat tree-shaking. - Move heavy logic out of client components. Output: - Modify only affected files. - Provide a summary of blockers found and qualitative bundle-size risk reduced.
Related Prompts
View allAccidental Re-render Detection
Find props and state patterns that cause unnecessary re-renders. Detect: - Inline object/array prop...
ReactPerformance
Over-fetching & Network Waste
Scan the repository for duplicated fetch logic, over-fetching, and missing deduplication. Refactor:...
NetworkPerformance
Polyfill & Transpilation Bloat
Detect libraries or APIs that trigger heavy polyfills or ES5 transpilation. Refactor: - Replace wit...
PerformancePolyfills
N+1 Queries & Fan-Out Explosions
Scan for code paths where a single request can trigger linear or unbounded database queries, API cal...
PerformanceDatabase