-
Notifications
You must be signed in to change notification settings - Fork 212
Expand file tree
/
Copy pathdevelopment-guidelines.mdc
More file actions
40 lines (33 loc) · 1.3 KB
/
development-guidelines.mdc
File metadata and controls
40 lines (33 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
description: Salesforce Commerce Composable Storefront Development Guidelines
globs:
alwaysApply: false
---
# Commerce Composable Storefront Development Guidelines
## Overview
Guidelines for Salesforce Commerce Composable Storefront development using PWA Kit, Retail React App, and Chakra UI.
## Core Principles
- Analyze requirements and existing codebase thoroughly
- Use existing components and hooks when possible
- Plan before implementing
- Test comprehensively with Jest
## PWA Kit Essentials
### Architecture
- Server-side rendering (SSR) for initial loads
- Client-side rendering (CSR) for interactions
- Isomorphic code (works on server and client)
- Proxy requests via `/mobify/proxy/<PROXY_PATH>`
### Special Components
- Components starting with `_` are special PWA Kit components
- `_app-config`: Top-level app configuration
- `_app`: Persistent layout (header, footer, sidebar)
- `_error`: 404 and error pages
## Development Rules
- Use kebab-case for file names (except special components with `_`)
- Use Chakra UI and existing components
- Create modular, reusable components
- Use React Hooks for state management
- Access data via commerce-sdk-react hooks
- Ensure mobile-friendly and accessible components
- Maintain consistent code formatting using project standards
- Write comprehensive test coverage