How I would pick tools for a full-stack application in 2020 ️️️2️⃣0️⃣2️⃣0️⃣
How I would pick tools for a full-stack application in 2020 ️️️2️⃣0️⃣2️⃣0️⃣
Below are my thoughts on how I would pick a stack for a web development in 2020. I value mature technologies, size of the community, "batteries included" and speed of the development.
I personally use VSCode editor, again because it's very popular these days which leads to lots of problems being solved in form of questions asked, plugins shipped and bugs fixed. One decent alternative is PyCharm/WebStorm.
React or Vue?
Why switching from React (the de-facto standard and #1) if Vue has similar metrics and less ecosystem? For instance, Vue has no mainstream Monaco wrapper. Also, React Native is fun and mature.
If you haven't worked with React since React Hooks emerged, you should totally catch up on that:
Other things to look at:
Webpack? Parcel? Create React App? Next.js? Gatsby?
Nano React App: https://hackernoon.com/create-react-app-is-way-too-bloated-5db07c3511
If project can't benefit from server-side rendering or SEO or static generation, then it's not worth going the Next.js or Gatsby way - less popular meaning less support, more traps. Sticking with CRA / ejected CRA.
Parcel may be good, but I don't know if it's easy to wire Parcel and Monaco, as well as any other dependencies. Sticking with CRA.
Anything competing with styled-components? CSS Modules? Not worth it.
Also, look at https://styled-system.com/
https://styled-components.com/docs/tooling#babel-macro
Bootstrap? Material UI? Ant?
https://ant.design/docs/react/use-in-typescript
Ant has better TypeScript support and is being very actively developed
To use:
For forms it makes sense to look into both Formik and Yup:
Storing the state inside react components should be enough for the start. Once there are significant pain points and the transition to Redux is inavoidable, we can start using Redux. Redux Toolkit is a modern official way to standardize the Redux boilerplate. And, in case there's going to be some nightmare complex multi-staged interaction back and forth
To better understand the whole necessity of such a complex system like Redux, you may want to meditate on Storeon:
To read:
@reach/router vs. React Router
@reach/router's core feature with auto focus is actually very annoying and inavoidable by design. While it may make things more accessible, it makes a hell of auto scrolling.
Features from @reach/router are slowly backported to React Router anyways. Also, not a huge difference between the two libraries, so it shouldn't be painful to switch back and forth. You may start with @reach/router and switch once you hit this auto focus trap or need more customization.
https://habr.com/ru/company/Voximplant/blog/445390/
Monaco is compatible with pre-eject CRA: https://github.com/react-monaco-editor/react-monaco-editor/issues/263 See cra-monaco/. Although this isn't maintained: https://medium.com/@kitze/configure-create-react-app-without-ejecting-d8450e96196a
React Native, Code Push, Fastlane.
Flutter is good but you already have React, so why make your stack more complex.
Unless you build games or rely on bleeding edge APIs like VR/AR, you don't need native Swift/Kotlin development. It's more technologies => more engineering effort and cost, in terms of hours and team size and team salary and communication.
Examples of large React Native projects:
Flow or Typescript?
Looks like Flow is on par with TypeScript and it's better with React - both are maintained by Facebook. One may also migrate from Flow to TypeScript later on: https://medium.com/inato/migrating-from-flow-to-typescript-why-how-worth-it-5b7703d12089
Flow is often blamed to have bad VSCode support and random bugs. Yarn and Jest migrated from Flow to TypeScript. Same for React Native's Expo.
No need to use TSLint anymore: https://medium.com/palantir/tslint-in-2019-1a144c2317a9
Looks like CRA doesn't have ES2016 support, let alone ES2020. What exactly are we missing: https://github.com/tc39/proposals/blob/master/finished-proposals.md It might make sense to enable it using customize-cra: https://2muchcoffee.com/blog/es7-decorators-how-to-use-the-decorator-syntax-in-react/
Have a look at:
Yarn 2 can fail to work with react-app-rewired, so sticking to a Yarn 1.* like 1.22 is a safe option for now.s
It looks like npm is being actively developed and is on par with Yarn these days, whereas Yarn has almost no big changes throughout 2019.
ESLint/Prettier with typescript-eslint. Pre-commit hooks running necessary tools with Husky.
Django or Express.js?
First of all, there are tons of web frameworks, and all popular languages have several of them. The most popular ones are all pretty much equal in their maturity - if you compare Django to Rails to Laravel to ASP.NET to Play. So this is a choice of a language more than a choice of a framework - the framework should be "a single most popular for your language".
Python is a winner in terms of language maturity and size of its community. It leads in all other applications - it has ML libraries, it has the support for any kind of data processing you may need to do.
So the real question is, do you want to have two languages (JS + Python) in your project, or you'd rather just have one and stick to Node.js?
You can assmeble a stack around Express.js. It's essential to use the RDBMS way for the main data storage (i.e. not to slip into the NoSQL trap), which leads to using sequelize as an ORM. And sequelize itself isn't as smooth as Django ORM - it requires more manual actions and verbose configuration. It was also hard to interact with using REPL due to async nature - maybe it's still hard.
I love Django admin panel, Django ORM, migrations, shell, dbshell, Jupyter notebooks with Django support. It's very hard to assemble such a stack on Node.js. Also, sequelize sucks, and NoSQL as a main data storage sucks way more. So - Django.
(Alternatives - async Flask equivalent is FastAPI. Why do you need an async framework though?)
Django boilerplate - cookiecutter?
Cool libraries:
Open-source Django projects:
Blog posts:
Should we use REST or GraphQL?
Django has a very mature REST framework - Django REST framework (DRF), used by 108k projects according to Github stats. It's been actively maintained since 2011 and very well documented.
GraphQL is a new technology that gives the following benefits:
While the technology itself is cool, it's way more supported in the Node.js world, where the express-graphql library has same 109k users. It's support in the Django world is young and limited: graphene_django has 3k users, it's poorly documented, not very actively maintained and has performance issues.
So for now, Django should be used with DRF. If GraphQL is a must, one should entirely switch to the Node.js stack.
No open issues yet, or sync has not completed.