Shopify / polaris

Shopify’s design system to help us work together to build a great experience for all of our merchants.
https://polaris.shopify.com
Other
5.82k stars 1.17k forks source link

Optimize Bundle Sizes, Improve Tree-Shaking, Documentation Consistency & Support Next.js 15 & React 19 #12918

Open nguyenvanhieu1996 opened 1 week ago

nguyenvanhieu1996 commented 1 week ago

Summary

Hi Polaris team! 👋

We would like to suggest some improvements that could make it even better

  1. Optimize component bundle sizes (current TextField: 124.2k, Modal, Navigation)
  2. Better tree-shaking support for reduced build sizes
  3. Major documentation inconsistencies between platforms:
    • npm package shows deprecated components (e.g., LegacyCard)
    • Polaris website shows different implementations
    • GitHub documentation doesn't match either
  4. Support path for Next.js 15 & React 19
  5. Need more comprehensive examples of component props and variations
  6. Essential admin UI components like Modal, Navigation, Toggle, DatePicker, TimePicker, FileUpload, DataTable, TreeSelect, etc... are crucial for admin interfaces but currently are not available or deprecated in Polaris

Current challenges:

Image

Rationale

These improvements are essential for:

  1. Documentation Consistency:

    • Align documentation across all platforms:
    • NPM package documentation
    • Polaris official website
    • GitHub repository
    • Remove references to deprecated components (e.g., LegacyCard)
    • Update examples to current best practices
    • Clear indication of component deprecation status
  2. Performance & Bundle Size:

    • Optimize component sizes
    • Improve tree-shaking support
    • Reduce overall bundle impact
    • Better code splitting options
  3. Next.js 15 & React 19 Support:

    • Clear migration path for Next.js 15
    • React 19 compatibility preparation
    • Server Component optimization
    • App Router best practices
    • Performance guidelines for new React features
  4. Enhanced Documentation:

    • More comprehensive props examples
    • Real-world use cases
    • Complex component interactions
    • TypeScript implementation examples
    • Server/Client component guidelines
    • Clear component upgrade paths

These updates would significantly improve developer experience and ensure consistent, reliable documentation across all platforms while preparing for future framework updates.