تخطَّ إلى المحتوى
أمرمستورد

svelte-optimize

Optimize Svelte/SvelteKit applications for performance, including bundle size reduction, rendering optimization, and loading performance.

وصف مستورد لم يراجعه محرر بعد

جاء هذا العنصر من مستودعه الأصلي وفحصناه آلياً فقط، ولم يكتب له محرر وصفاً عربياً بعد. اقرأ محتواه بنفسك قبل أن تعتمد عليه. ولا تُفهرس هذه الصفحة في محركات البحث حتى تُراجَع.

التنزيل

الملفات: 1 · الحجم: 3.7 ك.ب

نزّل ملف ZIP

يحمل الملف ترخيص المصدر الأصلي.

التثبيت

بعد التنزيل، شغّل الأمر في الطرفية. يسأل unzip قبل أن يستبدل أي ملف موجود.

  • لهذا المشروع

    يوضع في: .claude/commands/

    mkdir -p .claude/commands && unzip ~/Downloads/svelte-optimize.zip -d .claude/commands

  • لحسابك على الجهاز كله

    يوضع في: ~/.claude/commands/

    mkdir -p ~/.claude/commands && unzip ~/Downloads/svelte-optimize.zip -d ~/.claude/commands

التعليمات

/svelte:optimize

Optimize Svelte/SvelteKit applications for performance, including bundle size reduction, rendering optimization, and loading performance.

Instructions

You are acting as the Svelte Development Agent focused on performance optimization. When optimizing:

  1. Performance Analysis:

    • Analyze bundle size with rollup-plugin-visualizer
    • Profile component rendering
    • Measure Core Web Vitals
    • Identify performance bottlenecks
    • Check network waterfall
  2. Bundle Optimization:

    Code Splitting:

    // Dynamic imports
    const HeavyComponent = await import('./HeavyComponent.svelte');
    
    // Route-based splitting
    export const prerender = false;
    export const ssr = true;
    

    Tree Shaking:

    • Remove unused imports
    • Optimize library imports
    • Use production builds
    • Eliminate dead code
  3. Rendering Optimization:

    Reactive Performance:

    // Use $state.raw for large objects
    let data = $state.raw(largeDataset);
    
    // Optimize derived computations
    let filtered = $derived.lazy(() => 
      expensiveFilter(data)
    );
    

    Component Optimization:

    • Minimize re-renders
    • Use keyed each blocks
    • Implement virtual scrolling
    • Lazy load components
  4. Loading Performance:

    • Implement preloading strategies
    • Optimize images (lazy loading, WebP)
    • Use resource hints (preconnect, prefetch)
    • Enable HTTP/2 push
    • Implement service workers
  5. SvelteKit Optimizations:

    // Prerender static pages
    export const prerender = true;
    
    // Optimize data loading
    export async function load({ fetch, setHeaders }) {
      setHeaders({
        'cache-control': 'public, max-age=3600'
      });
      
      return {
        data: await fetch('/api/data')
      };
    }
    
  6. Optimization Checklist:

    • Enable compression (gzip/brotli)
    • Optimize fonts (subsetting, preload)
    • Minimize CSS (PurgeCSS/Tailwind)
    • Enable CDN/edge caching
    • Implement critical CSS
    • Optimize third-party scripts
    • Use WebAssembly for heavy computation

Example Usage

User: "My SvelteKit app is loading slowly, optimize it"

Assistant will:

  • Run performance analysis
  • Identify largest bundle chunks
  • Implement code splitting
  • Optimize images and assets
  • Add preloading for critical resources
  • Configure caching headers
  • Implement lazy loading
  • Optimize server-side rendering
  • Provide performance metrics comparison

الملفات

  • LICENSE1 ك.ب
  • svelte-optimize.md2.7 ك.ب

التعليقات (0)

لا تعليقات بعد. كن أول من يعلّق.

سجّل الدخول لتعلّق. التعليق من المستوى 1 (عضو).

أبلغ

عناصر مشابهة

  • أمرمستورد

    accessibility-audit

    Audit web accessibility for WCAG compliance with automated axe-core tests, keyboard and screen reader checks, and remediation guidance

    MITالملفات: 1

  • أمرمستورد

    component-scaffold

    Scaffold React and React Native components with TypeScript, tests, styles, and Storybook stories

    MITالملفات: 1

  • أمرمستورد

    create-component

    Guided component creation with proper patterns

    MITالملفات: 1

  • أمرمستورد

    create-plugin

    Guided end-to-end plugin creation workflow with component design, implementation, and validation

    Apache-2.0الملفات: 1

  • أمرمستورد

    gws-events-renew

    Google Workspace Events: Renew/reactivate Workspace Events subscriptions.

    MITالملفات: 1