-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.tsx
371 lines (363 loc) · 12 KB
/
App.tsx
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
import {
SafeAreaView,
ScrollView,
StyleSheet,
Text,
TouchableOpacity,
View,
} from 'react-native';
import React from 'react';
import { fontFamily } from './src/utils/fonts';
import { useNavigation } from '@react-navigation/native';
import { faker } from '@faker-js/faker';
import ChapterName from './src/components/ChapterName';
const App = () => {
const navigation = useNavigation();
var colorArray = [
'#FF6633',
'#FFB399',
'#FF33FF',
'#FFFF99',
'#00B3E6',
'#E6B333',
'#3366E6',
'#999966',
'#99FF99',
'#B34D4D',
'#80B300',
'#809900',
'#E6B3B3',
'#6680B3',
'#66991A',
'#FF99E6',
'#CCFF1A',
'#FF1A66',
'#E6331A',
'#33FFCC',
'#66994D',
'#B366CC',
'#4D8000',
'#B33300',
'#CC80CC',
'#66664D',
'#991AFF',
'#E666FF',
'#4DB3FF',
'#1AB399',
'#E666B3',
'#33991A',
'#CC9999',
'#B3B31A',
'#00E680',
'#4D8066',
'#809980',
'#E6FF80',
'#1AFF33',
'#999933',
'#FF3380',
'#CCCC00',
'#66E64D',
'#4D80CC',
'#9900B3',
'#E64D66',
'#4DB380',
'#FF4D4D',
'#99E6E6',
'#6666FF',
];
const SECTIONS = [
{
title: 'New Architecture',
data: Array(5)
.fill(0)
.map(() => ({
title: faker.commerce.productName(),
description: faker.lorem.lines(2),
price: faker.commerce.price(),
})),
},
{
title: 'Pizza',
data: Array(5)
.fill(0)
.map(() => ({
title: faker.commerce.productName(),
description: faker.lorem.lines(2),
price: faker.commerce.price(),
})),
},
{
title: 'Sushi and rolls',
data: Array(10)
.fill(0)
.map(() => ({
title: faker.commerce.productName(),
description: faker.lorem.lines(2),
price: faker.commerce.price(),
})),
},
{
title: 'Salads',
data: Array(10)
.fill(0)
.map(() => ({
title: faker.commerce.productName(),
description: faker.lorem.lines(2),
price: faker.commerce.price(),
})),
},
{
title: 'Dessert',
data: Array(10)
.fill(0)
.map(() => ({
title: faker.commerce.productName(),
description: faker.lorem.lines(2),
price: faker.commerce.price(),
})),
},
];
const randColor = () => {
return Math.floor(Math.random() * 30);
};
console.log('this is rand color --', randColor());
return (
<SafeAreaView style={{ flex: 1 }}>
<ScrollView
contentContainerStyle={{
flexGrow: 1,
justifyContent: 'space-evenly',
}}>
<View
style={{
paddingHorizontal: 30,
borderWidth: 1,
height: 200,
backgroundColor: colorArray[randColor()],
}}>
<Text style={{ color: 'black', fontFamily: fontFamily.fira_bold }}>
CHAPTER 1: New Architecture in depth
</Text>
<Text style={{ fontFamily: fontFamily.fira_regular }}>
- Codegen (Native Code Generator){'\n'}- JSI (JavaScript Interface)
{'\n'}- Hermes Engine (New JS compiler){'\n'}- Turbo Modules (New
Native Modules){'\n'}- Fabric (New Rendering Engine){'\n'}- Yoga
(Cross platform layout engine){'\n'}
</Text>
<ChapterName screenName={'Home'} chapter={'New Architecture'} />
</View>
<View
style={{
paddingHorizontal: 30,
borderWidth: 1,
flexGrow: 1,
backgroundColor: colorArray[randColor()],
}}>
<Text style={{ color: 'black', fontFamily: fontFamily.fira_bold }}>
CHAPTER 2: Debugging, Profiling & Advanced Optimization
</Text>
<Text style={{ fontFamily: fontFamily.fira_regular }}>
- iOS & Android Dev Menu{'\n'}- Chrome Dev Tools{'\n'}- Performance
Monitor - FPS (Frame Per Second){'\n'}- React Native four Threads
{'\n'}- Flipper for JS Context tracking{'\n'}- Profiling iOS by
Xcode Instruments{'\n'}- Android Profiler in Android Studio{'\n'}
</Text>
<ChapterName screenName={'Home'} chapter={'Debug Opti'} />
</View>
<View
style={{
paddingHorizontal: 30,
borderWidth: 1,
flexGrow: 1,
backgroundColor: colorArray[randColor()],
}}>
<Text style={{ color: 'black', fontFamily: fontFamily.fira_bold }}>
CHAPTER 3: Component (JS) Testing by RNTL with Jest setup
</Text>
<Text style={{ fontFamily: fontFamily.fira_regular }}>
- Brief intro with all types of RN testing{'\n'}
- React Native Testing Library (RNTL) details{'\n'}
- JEST setup & all it's config{'\n'}
- API => Render(): “queries”, “update", “debug"{'\n'}
- API => UserEvent(){'\n'}
- API => FireEvent(){'\n'}
- API => WaitFor(){'\n'}
- API => Mocking(): "jest.fn()" & "jest.mock()"{'\n'}
- Host & Composite components in RN{'\n'}
</Text>
<ChapterName screenName={'Home'} chapter={'Testing'} />
</View>
<View
style={{
paddingHorizontal: 30,
borderWidth: 1,
flexGrow: 1,
backgroundColor: colorArray[randColor()],
}}>
<Text style={{ color: 'black', fontFamily: fontFamily.fira_bold }}>
CHAPTER 4: Hermes & Static Hermes
</Text>
<Text style={{ fontFamily: fontFamily.fira_regular }}>
- Bundle Release{'\n'}
- Relation between Bundle & Hermes{'\n'}
- Hermes Bytecode (.hbc){'\n'}
- How to enable Hermes ?{'\n'}
- Oversure is Hermes working or not ?{'\n'}
- Enabling Hermes in Old RN Versions{'\n'}
- Static Hermes{'\n'}
</Text>
<ChapterName screenName={'Home'} chapter={'Hermes Engine'} />
</View>
<View
style={{
paddingHorizontal: 30,
borderWidth: 1,
flexGrow: 1,
backgroundColor: colorArray[randColor()],
}}>
<Text style={{ color: 'black', fontFamily: fontFamily.fira_bold }}>
CHAPTER 5: How to Enable New Architecture
</Text>
<Text style={{ fontFamily: fontFamily.fira_regular }}>
- Development ENV to Enable New Architecture{'\n'}
- Enable Hermes Instruction{'\n'}
- Npx Commands for Android{'\n'}
- Npx Commands for iOS{'\n'}
- Confirm New Architecture in action{'\n'}
</Text>
<ChapterName screenName={'Home'} chapter={'New Arch'} />
</View>
<View
style={{
paddingHorizontal: 30,
borderWidth: 1,
flexGrow: 1,
backgroundColor: colorArray[randColor()],
}}>
<Text style={{ color: 'black', fontFamily: fontFamily.fira_bold }}>
CHAPTER 6: Performance Optimization
</Text>
<Text style={{ fontFamily: fontFamily.fira_regular }}>
- Use New Architecture{'\n'}
- FlatList/ SectionList for List Performance{'\n'}
- Unnecessary Console{'\n'}
- Cache mechanism{'\n'}
- Image resize, Cache Image & Fast loading Image{'\n'}
- Schedule Animation & Native driver{'\n'}
- Coding standard{'\n'}
- Hermes Engine{'\n'}
- Reselect with Redux{'\n'}
- Monitor Memory usage{'\n'}
- Fast Navigation{'\n'}
</Text>
<ChapterName screenName={'Home'} chapter={'Performance Opti'} />
</View>
<View
style={{
paddingHorizontal: 30,
borderWidth: 1,
flexGrow: 1,
backgroundColor: colorArray[randColor()],
}}>
<Text style={{ color: 'black', fontFamily: fontFamily.fira_bold }}>
CHAPTER 7: Virtualization (List of Items) Optimization
</Text>
<Text style={{ fontFamily: fontFamily.fira_regular }}>
- {'<VirtualizedList/>'} optimization{'\n'}
- {'<FlatList/>'} optimization{'\n'}
- {'<SectionList/>'} optimization{'\n'}
- {'<ScrollView/>'} with Virtualization props{'\n'}
</Text>
<ChapterName screenName={'Home'} chapter={'List Optim'} />
</View>
<View
style={{
paddingHorizontal: 30,
borderWidth: 1,
flexGrow: 1,
backgroundColor: colorArray[randColor()],
}}>
<Text style={{ color: 'black', fontFamily: fontFamily.fira_bold }}>
CHAPTER 8: FlashList (Cell Re-Cycling) Optimization
</Text>
<Text style={{ fontFamily: fontFamily.fira_regular }}>
- Details about “RecyclerListView”{'\n'}
- Why Cell ReCycling ?{'\n'}
- Difference between "Blank Cell" & "Cell Recycling"{'\n'}
- FlashList Implementation{'\n'}
- All important props of FlashList{'\n'}
- Check Performance of your FlashList{'\n'}
- Reduce "Blank Space" techniques{'\n'}
- How to Migrate from "FlatList" to "FlashList" ?{'\n'}
</Text>
<ChapterName screenName={'Home'} chapter={'New Arch'} />
</View>
<View
style={{
paddingHorizontal: 30,
borderWidth: 1,
flexGrow: 1,
backgroundColor: colorArray[randColor()],
}}>
<Text style={{ color: 'black', fontFamily: fontFamily.fira_bold }}>
CHAPTER 9: Nested Virtualization & Component Call (Anti Pattern)
</Text>
<Text style={{ fontFamily: fontFamily.fira_regular }}>
- Nested VirtualizedLists Error{'\n'}
- Anti Pattern Reason{'\n'}
- SOLUTION code{'\n'}
- -------------------{'\n'}
- Component Call => Functional way{'\n'}
- Component Call => React way{'\n'}
- Functional way creates silent ERROR!{'\n'}
- Error analysis{'\n'}
- Rules of React Hooks (Violation){'\n'}
- Error Solution{'\n'}
</Text>
<ChapterName screenName={'Home'} chapter={'New Arch'} />
</View>
<View
style={{
paddingHorizontal: 30,
borderWidth: 1,
flexGrow: 1,
backgroundColor: colorArray[randColor()],
}}>
<Text style={{ color: 'black', fontFamily: fontFamily.fira_bold }}>
CHAPTER 10: IN APP PURCHASE (iOS & Android)
</Text>
<Text style={{ fontFamily: fontFamily.fira_regular }}>
- Basic Flow of Payment Gateway{'\n'}
- Sandbox Testing{'\n'}
- How GOOGLE IAP & iOS IAP works ?{'\n'}
- RevenueCat SDK{'\n'}
- Implementation instruction (iOS & Android){'\n'}
</Text>
<ChapterName screenName={'Home'} chapter={'New Arch'} />
</View>
<View
style={{
paddingHorizontal: 30,
borderWidth: 1,
flexGrow: 1,
backgroundColor: colorArray[randColor()],
}}>
<Text style={{ color: 'black', fontFamily: fontFamily.fira_bold }}>
CHAPTER 11: Higher Order Component, PROPS & Custom Hooks
</Text>
<Text style={{ fontFamily: fontFamily.fira_regular }}>
- Higher Order Component (HOC) pattern{'\n'}
- Render Props pattern{'\n'}
- Custom Hooks{'\n'}
- Lifting state to Parent Component{'\n'}
- When custom Hooks are better than HOC?{'\n'}
- Custom Hooks replaced "Render props pattern"{'\n'}
</Text>
<ChapterName screenName={'HOC'} chapter={'HOC&PROP'} />
</View>
</ScrollView>
</SafeAreaView>
);
};
export default App;
const styles = StyleSheet.create({});