82% code reused
Surfix | Size | Percentage |
---|---|---|
.js | 39.9 KLOC | 82% |
.web.js | 4.3 KLOC | 9% |
.native.js | 4.1 KLOC | 8% |
.ios.js | 0.2 KLOC | < 1% |
.swift | 0.7 KLOC | |
.kt | 0.6 KLOC |
react-xp, react-primitives, react-native-web, react-native-dom are not used
react-native-web is the best option among them. Pretending web to be React Native is not the right option
In-house solution is decided good for flexibility, control of abstractions and performance.
1 | app/ |
1 | index.js |
1 | - Babel |
In-house abstraction layer
Styles are separated, constants are shared
Abstraction layer based on concrete host components
1 | <Touchable /> |
1 | if (platform.isWeb) { |
// utils/getTargetValue/index.web.js
1 | const getTargetValue = (e): string => e.target.value |
// utils/getTargetValue/index.native.js
1 | const getTargetValue = (e): string => e.nativeEvent.text |
More sharing between CSS and StyleSheet
Animation
Webpack vs Metro
List virtualization
Drag & drop
Navigation
WYSIWYG (Gutterberg from WordPress)
e2e testing: Cypress vs Detox
This information is presented at Sep 7, 2019, check it out from Youtube