yarn create next-app my-app & cd my-app & yarn dev
and be up and running in 2 minutes.
yarn create next-app my-app & cd my-app & yarn dev
and be up and running in 2 minutes.
-Is it the same thing as nuxt js but different?
- Yarn? I thought that npm was the thing to use again.
- How does yarn know that “create next-app” command? Perhaps some yarn install globally thing?
- Does it include typescript support or is it javascript only?
- Which node version is needed? And if I switch, is that create next app still available then?
- How many things are transpiled? Are there any other concepts i need to understand?
- What is the testing framework of choice these days?
- How long will this framework be hip? Am i talking about months, a few months, a year, two years? Hip is important, i (or new employees) dont want to work with software which is considered old fashioned.
- Apparently i need this layer on top of react client side rendering. Another concept.
- Full control over babel or webpack is exactly the thing which makes it complex. It is probably easy to get started and then you have to make that little tweak on a changed babel plugin to make “it” work.
- Is frontend and backend react the same? As in: will it share the same babel config and will every node function be available on the client side and vice versa?
Even if every answer is positive, it is such a huge amount of stacked concepts and technologies.
Dont get me wrong, i like programming in javascript / typescript. I think the programming is fun, but fixing the damn tooling and having debates about it sucks.
NextJS is a library for doing server-side rendering in your React app. I've never touched Vue, so I don't know if that's what nuxt js does
> Yarn? I thought that npm was the thing to use again.
They're fairly interchangeable and it doesn't matter much these days.
> How does yarn know that “create next-app” command? Perhaps some yarn install globally thing?
Yeah it checks the registry of create-* packages and installs the relevant ones.
> Does it include typescript support or is it javascript only?
Yep, by default can use TS with NextJS. I only use TS when possible. Going back to vanilla JS is a horrifying thought!
> How long will this framework be hip?
React is probably the most popular front-end framework and pretty beloved. It's used seemingly everywhere these days. Since SSR is such an important use-case for websites, I'd wager that combined with how prevalent React is, NextJS will be around for a long, long time.
> Full control over babel or webpack is exactly the thing which makes it complex. It is probably easy to get started and then you have to make that little tweak on a changed babel plugin to make “it” work.
Anecdotally, I've used the default configs for create-react-app starters, NextJS, or Electron Forge starters and haven't needed to modify anything.
Yes.
> Yarn? I thought that npm was the thing to use again.
Yarn has many features that npm doesn't - plugins, constraints, PNP, zero installs, workspaces, etc.
> How does yarn know that “create next-app” command? Perhaps some yarn install globally thing?
You can do yarn dlx or npx create-next-app. It will temporarily install and run the package or command.
> Does it include typescript support or is it javascript only?
Typescript support is as easy as changing your file names, installing typescript, and adding a tsconfig. You don't need to set up anything. Next does it for you on the first run.
> Which node version is needed? And if I switch, is that create next app still available then?
You are cool with current LTS and previous LTS (from my testing).
> How long will this framework be hip? Am i talking about months, a few months, a year, two years? Hip is important, i (or new employees) dont want to work with software which is considered old fashioned.
Next has been supported for years. Vercel is the company backing next for their platform so I would say about the same time as vercel. Given they got funding this year, don't think they will die soon.
> What is the testing framework of choice these days?
jest
> How many things are transpiled? Are there any other concepts i need to understand?
SSR. There are few concepts you will have to learn to actually take benefit of it (getServerSide props, getStaticSideProps, etc) but out of the box, you don't need to do anything different. The routing is already included so that's one less thing to worry about. Next does automatic static optimization (unless you do something stupid with your root app). You are benefiting without doing any work.
> Full control over babel or webpack is exactly the thing which makes it complex. It is probably easy to get started and then you have to make that little tweak on a changed babel plugin to make “it” work.
Most things will work via the next plugins. It will be a rare case where you have to set up your own server. You can take full control when you want.
> Is frontend and backend react the same? As in: will it share the same babel config and will every node function be available on the client side and vice versa?
Next builds your app and responds with either fully static views or via pre-hydrated views hydrating on the client-side. Look up hydration in react.
The project I work on uses gulp(probably is ancient already and I have to use soemthing cooler). With gulp sometimes when I switch branches of my project it will crash , I understand how it works and why it happens so I restart it , but someone that does not understand the "magic under the hood" will not know what to search for, what to google for etc. Same for react or angular, if you do not know what is happening under the hood you will eventually cause performance issues(similar if you don't understand how CPU/memory works)
My point is that if the abstractions are not perfect you will sooner or later (probably sooner) have to understand them , read the code etc.
But then I realised that it actually does do a lot for me, but they really managed to package it all up in a relatively (and deceptively) simple API that so far still does not seem leaky at all.
From my experience though are bad abstraction that are not consistent, like we had a web project working untouched in 1 full year and some feature stopped working one day (nobody touched anything) but I could not reproduce it on my machine. I still have no idea what triggered it but the problem was that for some reason the PHP autoloader "searching" found a different file then before (maybe it was some caching/filesystem or other low level update on the VPS that triggered this)... anyway I had to read the code and understand how the magic happens so I can elucidate the bug.
Support for others is inbuilt.
Why transpile to single files? It will be faster to have many smaller files for http2 speed up.
Bootcamp also teaches those concepts nowadays. They are different than what they used to be. Check frontend masters, egghead etc.
I can do this too: without the "modern frontend" all I had to do is open my code editor.
It's as simple as `create-react-app my-app`, then `yarn start` for development, and `yarn build` to spit out production ready code into build folder