Skip to content

docs: add dynamic import strategy to performance checklist - #65

Open
fgfabi wants to merge 2 commits into
github:mainfrom
fgfabi:fgfabi-add-dynamic-import-strategy
Open

docs: add dynamic import strategy to performance checklist#65
fgfabi wants to merge 2 commits into
github:mainfrom
fgfabi:fgfabi-add-dynamic-import-strategy

Conversation

@fgfabi

@fgfabi fgfabi commented Aug 2, 2026

Copy link
Copy Markdown

Why: Performance and bundle size suffer when barrels and wildcard imports prevent tree-shaking and when heavy features are shipped in the initial bundle. This change adds a clear, actionable "Dynamic Import Strategy" to the performance checklist so developers know how to import icons, components, and heavy features to reduce initial bundle size (typical 20–40% reductions).

What: Adds a new section to plugins/spark/skills/spark-app-template/references/performance-checklist.md that:

  • Explains why barrel exports break tree-shaking and shows bad/good patterns
  • States the named-import requirement for lucide-react (never use import * as Icons)
  • Shows how to import custom components to avoid pulling unrelated code
  • Demonstrates dynamic imports (React.lazy/Suspense and on-demand import) for charts, editors, and other heavy features

Notes for reviewers:

  • This is a docs-only change (no code behavior change).
  • The section includes concrete code examples and practical tips for auditing bundles.

If this should also be added to other templates or repos, say so and I will follow up.

GitHub Copilot and others added 2 commits August 2, 2026 07:04
- Add comprehensive guidance on tree-shaking and bundle optimization
- Document why barrel exports prevent tree-shaking
- Provide named import patterns for lucide-react icons
- Show dynamic import examples for heavy features
- Include import configuration best practices
- Demonstrate bundle analysis techniques

This update can reduce initial bundle size by 20-40% through proper
import strategies and lazy loading of non-critical features.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant