Przejdź do treści
Biblioteka skilli
Programowanie · Przegląd i audyt

vite-react-best-practices

/vite-react-best-practices

Wytyczne wydajności, architektury i wdrażania SPA w React 19 i Vite 8: hosting statyczny, dzielenie tras i TanStack Query.

Licencja
MIT
Ostatnia zmiana repozytorium
01.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
7
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 01.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Wytyczne wydajności, architektury i wdrażania SPA w React 19 i Vite 8: hosting statyczny, dzielenie tras i TanStack Query.

Oryginalny opis (EN)

Comprehensive React 19 and Vite 8 SPA performance, architecture, and deployment guidelines. Use this skill when building, reviewing, or refactoring React applications built with Vite (SPA). Covers Vite 8 build and static hosting requirements, React Router 8 route-level code splitting, TanStack Query v5 server state, React Compiler memoization, and core React performance patterns.

Jak działa

  1. When to Apply
  2. Priority Table
  3. Rule Categories
  4. How to Use
  5. Full Compiled Document
Sekcje z nagłówków SKILL.md, w oryginale · 63 linii, 388 słów
Podgląd SKILL.md
---
name: vite-react-best-practices
description: Comprehensive React 19 and Vite 8 SPA performance, architecture, and deployment guidelines. Use this skill when building, reviewing, or refactoring React applications built with Vite (SPA). Covers Vite 8 build and static hosting requirements, React Router 8 route-level code splitting, TanStack Query v5 server state, React Compiler memoization, and core React performance patterns.
license: MIT
metadata:
  author: ant-gravity
  version: "2.0.0"
---

# Vite React Best Practices

A senior-level guide for building production-ready React Single Page Applications (SPAs) with Vite.

## When to Apply

Reference these guidelines when:
- Setting up a new Vite + React project
- Configuring build pipelines and CI/CD for SPAs
- Troubleshooting production build or caching issues
- Refactoring React components for performance

## Priority Table

| Impact | Rules |
| --- | --- |
| CRITICAL | [Static Rewrites](rules/vite-spa-rewrites.md), [Caching Strategy](rules/vite-caching-strategy.md) |
| HIGH | [Build Validation](rules/vite-build-validation.md), [Environment Variables](rules/vite-env-vars.md), [Route Splitting](rules/react-route-splitting.md), [Server State](rules/react-server-state.md) |
| MEDIUM | [Memoization](rules/react-memoization.md), [Image Optimization](rules/react-image-optimization.md), [Colocation](rules/react-colocation.md), [Anti-Patterns: Import from Dist](rules/anti-import-dist.md), [Troubleshooting](rules/vite-troubleshooting.md) |

## Rule Categories

### 1. Vite SPA Deployment (CRITICAL)

- [Static Rewrites](rules/vite-spa-rewrites.md) - **Mandatory** for client-side routing.
- [Caching Strategy](rules/vite-caching-strategy.md) - Immutable assets, no-cache index.html.
- [Build Validation](rules/vite-build-validation.md) - Preview before push.
- [Environment Variables](rules/vite-env-vars.md) - `VITE_` prefix and security.

### 2. React Core Performance

- [Route Splitting](rules/react-route-splitting.md) - Lazy load pages with React Router 8 `route.lazy`.
- [Server State](rules/react-server-state.md) - TanStack Query v5 for cached server data.
- [Memoization](rules/react-memoization.md) - When to use useMemo/useCallback, and what React Compiler replaces.
- [Image Optimization](rules/react-image-optimization.md) - LCP and CLS prevention.

### 3. Architecture & Cleanup

- [Colocation](rules/react-colocation.md) - Feature-based structure.
- [Anti-Patterns: Import from Dist](rules/anti-import-dist.md) - Avoid bundling twice.
- [Troubleshooting](rules/vite-troubleshooting.md) - Common Vite 8 fixes.

## How to Use

1. Pick the rule that matches the task from the categories above, or from the priority table if you need to know what must not be skipped.
2. Open the rule file in `rules/`. Each file is self-contained: frontmatter with `impact` and `tags`, the rationale, an incorrect example, a correct example, and a References section.
3. Load only the rules relevant to the task. CRITICAL rules apply to every Vite SPA; HIGH rules apply to most production apps; MEDIUM rules apply when the area is being changed.
4. When a rule references another rule, follow the relative link inside `rules/`.

| Stack | Version |
| --- | --- |
| React | 19.3.1 |
| Vite | 8.3.5 (Rolldown + Oxc) |
| React Router | 8.5.1 |
| TanStack Query | 5.105.1 |
| React Compiler | `babel-plugin-react-compiler` 1.x |
| Node (Vite 8) | `^20.19.0 || >=22.12.0` |

## Full Compiled Document

For the complete guide with all rules expanded: `AGENTS.md` (also available as `CLAUDE.md`).
Pliki w paczce (7)
  • AGENTS.md 55 KB
  • CHANGELOG.md 3 KB
  • CLAUDE.md 1 KB
  • README.md 3 KB
  • SKILL.md 3 KB
  • marketplace.json 1 KB
  • metadata.json 1 KB

Wersje

W bazie nie ma innych skilli o nazwie vite-react-best-practices.

Migawka bazy z 13.11.2026 · wersja paczki eea818d43cf8 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 1 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100react-vite-best-practices
    Zawiera wytyczne wydajności dla React z Vite: konfiguracja, optymalizacja buildu, code splitting, lazy loading, HMR i rozmiar bundla.
  • 95tanstack-query-best-practices
    Podpowiada dobre praktyki TanStack Query w React: pobieranie danych, cache, mutacje i zarządzanie stanem serwera.
  • 100react-best-practices
    Podpowiada wzorce wydajności React dla SPA: dane, bundle, rendering i interakcje, z pominięciem wskazówek Next.js.
  • 100react-ts-vite
    Buduje, rozbudowuje i refaktoryzuje aplikacje React w TypeScript i Vite, od komponentów i hooków po TanStack Query i Tailwind CSS.
  • 90tanstack-react-query-best-practices
    Pilnuje konwencji TanStack Query w React: zapytań, mutacji, kluczy i aktualizacji pamięci podręcznej stanu serwera.
  • 100tanstack-router
    Konfiguruje typowany routing plikowy TanStack Router dla React w aplikacjach SPA, z integracją TanStack Query, Cloudflare Workers i rozwiązywaniem błędów devtools oraz bundlowania Vite.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.