Skip to content

Commit 84cb705

Browse files
committed
Add code recipes
1 parent 7c61905 commit 84cb705

21 files changed

+12239
-6
lines changed

docs/404-not-found.md

Lines changed: 649 additions & 0 deletions
Large diffs are not rendered by default.

docs/README.md

Lines changed: 88 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,93 @@
11
# Documentation
22

3-
**General**
3+
Welcome to the Universal Router documentation! This guide covers everything from basic setup to advanced patterns.
44

5-
- [Getting Started](https://github.com/kriasoft/universal-router/blob/master/docs/getting-started.md)
6-
- [Universal Router API](https://github.com/kriasoft/universal-router/blob/master/docs/api.md)
5+
## Getting Started
76

8-
**Recipes**
7+
- **[Getting Started](./getting-started.md)** - Installation and basic usage
8+
- **[API Reference](./api.md)** - Complete API documentation
99

10-
- [Redirects](https://github.com/kriasoft/universal-router/blob/master/docs/redirects.md)
11-
- [Request a recipe](https://github.com/kriasoft/universal-router/issues/new)
10+
## Core Concepts
11+
12+
Essential concepts for understanding how Universal Router works.
13+
14+
- **[Nested Routes](./nested-routes.md)** - Building route hierarchies with shared layouts
15+
- **[Route Matching Order](./route-priorities.md)** - Understanding which route matches first
16+
- **[URL Parameters](./query-params-hash.md)** - Path params, query strings, and hash fragments
17+
18+
## Navigation Patterns
19+
20+
Different approaches to implementing navigation in your application.
21+
22+
- **[Single Page Navigation](./spa-navigation.md)** - Client-side routing with History API
23+
- **[Isomorphic Routing](./isomorphic-routing.md)** - Universal routing (server + client)
24+
- **[Declarative Routing](./declarative-routing.md)** - Custom resolvers for declarative definitions
25+
26+
## Authentication & Authorization
27+
28+
Protecting routes and managing user access.
29+
30+
- **[Authorization](./authorization.md)** - Protected routes and role-based access control
31+
- **[Redirects](./redirects.md)** - Handling redirects
32+
33+
## Navigation UI
34+
35+
Building navigation components for your application.
36+
37+
- **[URL Generation](./url-generation.md)** - Named routes and the `generateUrls` helper
38+
- **[Active Links](./active-links.md)** - Highlighting the current route in navigation
39+
- **[Breadcrumbs](./breadcrumbs.md)** - Building navigation breadcrumbs from route hierarchy
40+
- **[Scroll Behavior](./scroll-behavior.md)** - Managing scroll position on navigation
41+
42+
## Error Handling
43+
44+
Dealing with errors and edge cases.
45+
46+
- **[404 Not Found](./404-not-found.md)** - Error handling and catch-all routes
47+
48+
## User Experience
49+
50+
Enhancing the navigation experience.
51+
52+
- **[Page Transitions](./page-transitions.md)** - Animated transitions between routes
53+
54+
## Performance
55+
56+
Optimizing your routing setup for better performance.
57+
58+
- **[Code Splitting](./code-splitting.md)** - Lazy loading routes with dynamic imports
59+
- **[Synchronous Mode](./synchronous-routing.md)** - Using `UniversalRouterSync` for sync resolution
60+
61+
## Framework Integration
62+
63+
Integrating Universal Router with popular frameworks and tools.
64+
65+
- **[React & Redux](./react-redux.md)** - Redux-first routing patterns
66+
- **[Server Methods](./server-methods.md)** - Handling GET/POST/PUT/DELETE on the server
67+
- **[Hot Module Replacement](./hmr.md)** - Development setup with Vite and Webpack
68+
69+
## Advanced Topics
70+
71+
Advanced patterns and specialized use cases.
72+
73+
- **[TypeScript](./typescript.md)** - Type-safe routes, parameters, and URL generation
74+
- **[Internationalization](./i18n.md)** - Localized URLs and multilingual applications
75+
76+
---
77+
78+
## Quick Reference
79+
80+
| Recipe | Use Case |
81+
| --------------------------------------------- | ------------------------------------------ |
82+
| [SPA Navigation](./spa-navigation.md) | Client-side routing in the browser |
83+
| [Isomorphic Routing](./isomorphic-routing.md) | Server-side rendering with React |
84+
| [Code Splitting](./code-splitting.md) | Lazy loading for better performance |
85+
| [Authorization](./authorization.md) | Protecting routes from unauthorized access |
86+
| [TypeScript](./typescript.md) | Type-safe routing with full IntelliSense |
87+
| [URL Generation](./url-generation.md) | Building URLs from route names |
88+
89+
---
90+
91+
## Request a Recipe
92+
93+
Don't see what you need? [Request a recipe](https://github.com/kriasoft/universal-router/issues/new) and we'll add it to the documentation.

0 commit comments

Comments
 (0)