📜 ⬆️ ⬇️

What is it, in fact, writing JavaScript in 2016

This text is a translation of the response of Christian Ristovski to the article "How to teach JavaScript in 2016"

I need to create a page that displays recent actions from users, so I just need to get data from REST and display them in some filtered table, well, update it if something changes on the server. I thought maybe using jQuery to extract and display data?

- Of course, you can still use jQuery. But if you are going to write something more complicated in the future, then you probably should try React. He will be very useful to you in the future.

- Sounds good. How to start working with React?
')
- The easiest way is to write npm install create-react-app -g in the terminal and you can immediately start working on the project.

- Cool, i.e. Are you saying that I should not install anything extra?

- Nope.

- Do I need to install any special IDEs like Visual Studio, Android Studio, or Xcode?

- Not. Just cd to the folder with the application and start with npm start . That's all.

- But I have to build my application and wait a long time until it is rebuilt every time I change something?

- Nope. If you make changes on the page, it will automatically update for you. If you change the CSS a bit, it will be reloaded on the fly, without a full page refresh.

- It looks very useful. It looks like it might speed things up a bit. But wait, what if I want to publish my website? Just no one else publishes index.html, app.css, main.js is not minified, right?

- Yeah, you're right. If you ever want to publish your site, just run npm run build and all you need to do is put in your / build folder. Minified, optimized and fully ready for publication.

- Thank you, it was very informative.

* The curtain falls, applause, screams from the audience. Our 2 developers bow, shake hands and fly away on the dragons in the sunset *

Let's have fun and share some positive and joyful moments in the JS community.

» Original Answer

Source: https://habr.com/ru/post/313964/


All Articles