It when you write project that can be implemented on two or more platforms.
For example, how can we make it for iOS, Android and Windows Phone?
- we can use Xamarin, but it useless for WEB and Desktop
- there are Weex (Vue.js way) and Apache Cordova, Ionic, Native Script (Angular way). I'm not sure they can handle cross-platform case, but you can try
And in this case, React Native has huge sense, cause it's main part is React and many people don't remark this.
- WEB — React
- Mobile apps — React + React Native
- Desktop apps — React + Electron
You can even reuse platform's common JS code in single monorepo using
- ready solutions like ReactXP (Skype story)
- or find your own solution using Lerna
Note: if you write games - it's not your story, sorry
Is React mature enough for WEB? Yes, the most.
Is Electron mature enough for Desktop? If you like VSCode, Atom, Slack or some of 385 apps and believe in GitHub - Yes.
Is React Native mature enough for Mobile? Instagram, Skype, Airbnb, Walmart and other already use it and you can read how they did it. And if you believe in Facebook - I believe Yes.
No matter what your programming language or platform is - GraphQL helps your API to be consistent.
It is a comfortable way to go with the power of JS clients like Apollo, great tooling like GraphiQL and many more.
TypeScript — is JavaScript that scales.
- helps to handle this complexity, especially in big team
- is just ECMAScript with optional types, classes, modules and awesome tooling
- doesn't replace ECMAScript, it just helps you to write better
- there are alternatives, but not ECMAScript cause it's the base
Fork simple e-shop example and mock it
- Mobile WEB - https://github.com/react-cross-platform/react-shop
- iOS and Android - https://github.com/react-cross-platform/react-native-shop
- Desktop and monorepo with shared JS code - sure some sunny day!
To Be Continued...