Skip to content

Commit 9cc9ba1

Browse files
ci(release): publish latest release
1 parent 28ec802 commit 9cc9ba1

File tree

717 files changed

+26114
-10555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

717 files changed

+26114
-10555
lines changed

.cursor/rules/mobile/styling.mdc

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,7 @@ alwaysApply: false
66
# Mobile Styling Conventions
77

88
## Component Styling
9-
- Use the `styled` function from `ui/src` for consistent styling
10-
- Prefer Tamagui styling over React Native StyleSheet when possible
11-
- Use StyleSheet.create for performance-critical styles or when Tamagui isn't suitable
12-
13-
## StyleSheet Usage
14-
- Define styles outside of the component body to prevent recreation on renders
15-
- Use descriptive names for style objects
16-
- Group related styles together
17-
18-
Example:
19-
```typescript
20-
const styles = StyleSheet.create({
21-
container: {
22-
flex: 1,
23-
padding: spacing.spacing16,
24-
},
25-
header: {
26-
fontSize: 18,
27-
fontWeight: 'bold',
28-
},
29-
})
30-
```
9+
- Prefer Tamagui inline props over other methods
3110

3211
## Theme Usage
3312
- Use theme tokens from the UI package instead of hardcoded values
@@ -40,9 +19,11 @@ const styles = StyleSheet.create({
4019
- Minimize view hierarchy depth
4120

4221
## Platform Specific Code
43-
- Use `$platform-web` for platform-specific styling in Tamagui
44-
- Use `.ios.tsx` and `.android.tsx` extensions for platform-specific components
45-
- Use the `Platform.select` API for inline platform-specific code
22+
- Use `.<platform>.tsx` extensions for platform-specific components
23+
- The bundler will grab the appropriate file during the build and always fallback to `.tsx`
24+
- The `platform` variable must be one of the following: ios, android, macos, windows, web, native
25+
- Use the `Platform.select` API for inline platform-specific code. This method expects an object keyed by `platform`.
26+
- Also consider using our custom platform variables like `isMobileApp`, `isInterface`, etc. for more specific platform detection needs.
4627

4728
## Performance
4829
- Memoize complex style calculations

.cursor/rules/shared/components.mdc

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,73 @@
11
---
2-
description: Component Structure and Best Practices
3-
globs:
4-
alwaysApply: false
2+
description:
3+
globs:
4+
alwaysApply: true
55
---
66
# Component Structure and Best Practices
77

88
## Component Organization
99
- Place state and hooks at the top of the component
1010
- Group related state variables together
11-
- Extract complex logic into custom hooks
1211
- Define handlers after state declarations
1312
- Place JSX return statement at the end of the component
1413

14+
## Props
15+
- Use interface for component props
16+
- Place prop interface directly above component
17+
- Complex or shared types can be moved to a types.ts file
18+
- Use descriptive prop names
19+
- Provide default props where appropriate
20+
21+
## Performance Optimizations
22+
- Memoize expensive calculations with useMemo
23+
- Memoize event handlers with useCallback or use our custom useEvent hook
24+
- Use React.memo for pure components that render often
25+
- Avoid anonymous functions in render
26+
27+
## Component Size
28+
- Keep components focused on a single responsibility
29+
- Extract complex components into smaller, reusable pieces
30+
- Aim for less than 250 lines per component file
31+
- Extract prop interfaces and types to separate files if they become complex
32+
1533
## Component Structure Example
34+
1635
```typescript
36+
interface ExampleComponentProps {
37+
prop1: string;
38+
prop2: () => void;
39+
}
40+
1741
export function ExampleComponent({ prop1, prop2 }: ExampleComponentProps): JSX.Element {
1842
// State declarations
1943
const [state1, setState1] = useState(false)
2044
const [state2, setState2] = useState<string>('')
2145

22-
// Custom hooks
23-
const { data, loading } = useCustomHook()
46+
// Queries and mutations
47+
const { data, isPending } = useQuery(exampleQueries.getData(prop1))
48+
const mutation = useMutation({
49+
mutationFn: () => exampleService.submit(prop1),
50+
onSuccess: prop2
51+
})
2452

2553
// Derived values
2654
const derivedValue = useMemo(() => {
27-
return someCalculation(state1, prop1)
28-
}, [state1, prop1])
55+
return someCalculation(state1, data)
56+
}, [state1, data])
2957

3058
// Event handlers
3159
const handleClick = useCallback(() => {
3260
setState1(!state1)
33-
}, [state1])
61+
mutation.mutate()
62+
}, [state1, mutation])
3463

3564
// Side effects
3665
useEffect(() => {
3766
// Effect logic
3867
}, [prop2])
3968

4069
// Conditional rendering logic
41-
if (loading) {
70+
if (isPending) {
4271
return <LoadingSpinner />
4372
}
4473

@@ -51,21 +80,3 @@ export function ExampleComponent({ prop1, prop2 }: ExampleComponentProps): JSX.E
5180
)
5281
}
5382
```
54-
55-
## Props
56-
- Use interface for component props
57-
- Place prop interface directly above component or in a types.ts file
58-
- Use descriptive prop names
59-
- Provide default props where appropriate
60-
61-
## Performance Optimizations
62-
- Memoize expensive calculations with useMemo
63-
- Memoize event handlers with useCallback
64-
- Use React.memo for pure components that render often
65-
- Avoid anonymous functions in render
66-
67-
## Component Size
68-
- Keep components focused on a single responsibility
69-
- Extract complex components into smaller, reusable pieces
70-
- Aim for less than 250 lines per component file
71-
- Extract prop interfaces and types to separate files if they become complex
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
## Data Fetching Patterns
7+
8+
### Direct Query Usage (Preferred)
9+
- Use direct `useQuery` and `useMutation` calls in components instead of wrapping them in custom hooks
10+
- Place query/mutation calls at the top of the component with other hooks
11+
- Use query factories from domain-specific files
12+
13+
```typescript
14+
// ❌ Avoid: Unnecessary custom hook
15+
function useTokenPrice(tokenAddress) {
16+
const { data, isLoading } = useQuery(tokenQueries.price(tokenAddress));
17+
return { data, isLoading }
18+
}
19+
20+
// ✅ Preferred: Direct usage
21+
function TokenPriceDisplay({ tokenAddress }) {
22+
const { data, isLoading } = useQuery(tokenQueries.price(tokenAddress));
23+
// ...
24+
}
25+
```
26+
27+
### Custom Hooks (Limited Cases)
28+
Only create custom hooks when:
29+
1. Combining multiple related queries
30+
2. Implementing complex business logic beyond data fetching
31+
3. Managing domain-specific operations that transcend data fetching
32+
33+
```typescript
34+
// ✅ Valid: Complex business logic
35+
function useUserPermissions() {
36+
const { data: user } = useQuery(userQueries.current());
37+
const { data: roles } = useQuery(roleQueries.forUser(user?.id));
38+
39+
const canEditProducts = useMemo(() => {
40+
if (!user || !roles) return false;
41+
return roles.some(r => r.permissions.includes('product:edit')) ||
42+
user.isAdmin;
43+
}, [user, roles]);
44+
45+
return { canEditProducts };
46+
}
47+
```
File renamed without changes.

.depcheckrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ignores: [
66
'i18next',
77
'moti',
88
'wrangler',
9+
'react-router',
910
# Dependencies that depcheck thinks are missing but are actually present or never used
1011
'@yarnpkg/core',
1112
'@yarnpkg/cli',

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ CLAUDE.local.md
6969

7070
# cursor
7171
.cursor/mcp.json
72+
.cursor/rules/local-workflow.mdc

.yarn/patches/@react-native-assets-registry-npm-0.76.9-8c740e2424.patch

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/settings-plugin/src/main/kotlin/com/facebook/react/ReactSettingsExtension.kt b/settings-plugin/src/main/kotlin/com/facebook/react/ReactSettingsExtension.kt
2+
index aea525747e08b811eabae78c4be486fe7b3c46ba..a70b9cd72346487d347337cc95c24a4a3d8652f8 100644
3+
--- a/settings-plugin/src/main/kotlin/com/facebook/react/ReactSettingsExtension.kt
4+
+++ b/settings-plugin/src/main/kotlin/com/facebook/react/ReactSettingsExtension.kt
5+
@@ -29,7 +29,7 @@ abstract class ReactSettingsExtension @Inject constructor(val settings: Settings
6+
settings.layout.rootDirectory.file("build/generated/autolinking/").asFile
7+
8+
private val defaultConfigCommand: List<String> =
9+
- windowsAwareCommandLine(listOf("npx", "@react-native-community/cli", "config")).map {
10+
+ windowsAwareCommandLine(listOf("node", "../../node_modules/@react-native-community/cli/build/bin.js", "config")).map {
11+
it.toString()
12+
}
13+
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
diff --git a/RNFastImage.podspec b/RNFastImage.podspec
2-
index db0fada63fc06191f8620d336d244edde6c3dba3..286fa816e47996fdff9f25261644d612c682ae0b 100644
2+
index db0fada63fc06191f8620d336d244edde6c3dba3..93d7291b183b9625ad8d50e812ae247a11bad9d3 100644
33
--- a/RNFastImage.podspec
44
+++ b/RNFastImage.podspec
55
@@ -16,6 +16,6 @@ Pod::Spec.new do |s|
66
s.source_files = "ios/**/*.{h,m}"
77

88
s.dependency 'React-Core'
99
- s.dependency 'SDWebImage', '~> 5.11.1'
10-
+ s.dependency 'SDWebImage', '~> 5.15.5'
11-
s.dependency 'SDWebImageWebPCoder', '~> 0.8.4'
10+
- s.dependency 'SDWebImageWebPCoder', '~> 0.8.4'
11+
+ s.dependency 'SDWebImage', '~> 5.21.0'
12+
+ s.dependency 'SDWebImageWebPCoder', '~> 0.14.6'
1213
end

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @uniswap/web-admins

0 commit comments

Comments
 (0)