Techpill me on React

Techpill me on React

Attached: 1200px-React-icon.svg.png (1200x848, 56K)

Other urls found in this thread:

vanilla-js.com/
twitter.com/NSFWRedditVideo

Imo, it's the most intuitive way of piecing together webpages. Easy to separate GUI appearance from business logic. Easy to code, easy to maintain. Unironically a great framework. you know it's good because Jow Forums rails against it and JS so hard.

t. Zoomer

Wouldn't that make angular even more superior? It seems Jow Forums hates it a lot.

it makes webshit marginally less painful.

Better than other JavaScript frameworks but still should be avoided

This. It's JavaScript with OOP. It's also kind of hard to get used to and requires a different solution to a lot of basic things (for example forms need to be hooked on to state for input to work).

Create React App is the most based thing I've ever used

It's disgusting like all JS shit

>state can be only managed by the top class
>every little thing requires a JS library that downloads half of all NPM packages
>all tutorials for it are basedshit that don't explain anything
>() => () => ()

Not sure how long you’ve been doing react but it’s not based

It is a million times better than trying to do it in jquery though

Honestly if you can avoid JavaScript you should, just generate HTML server side and avoid all the complexity.

>state can be only managed by the top class
this, this right here. parent-child relationships are way too strict.

Kids react to

Don't succ the lord Zucc, go with Angular my friend. Comparing Angular to React feels like comparing ray gun to a wooden stick.

this, but realistically, you're probably using JavaScript anyway.

go with Mithril instead tho

use vue + nothing else

/thread

>It's JavaScript with OOP
What the fuck are you even talking about?

React was the first time for him where he used the class keyword in JS.

this. jekyll html build scripts through gulpjs

If you want to push 150KB huge JavaScript bundles down to your clients without having any written any single line of code on your own that actually does something, go ahead. Get create-react-app right now.

and its pointless. ideally you should never use the class keyword. it was only added to please Java pajeets and OO worshippers

>he thinks of paradigm is better than the other
ok kid

For big stuff and teams React is great, for smaller weekend projects Vue is better and more fun.

If they were lax the tree wouldn't update that quickly.

Use a state manager if you must but not fucking redux. Redux is a meme.

>Redux is a meme
Why would you say that?

>150KB
>huge

>Comparing Angular to React feels like comparing ray gun to a wooden stick.

Because Angular is a framework, whereas React is just a library.
Both have advantages and disadvantages.

Brainlets hate it because they cannot into functional programming.

that is huge for a .js bundle

>() => () => ()
kek, its hilarious how true this is, i am working with node and 3/4 of my code is =>

Attached: 3468843344.png (469x443, 275K)

But it's small for a .jpeg image.
Most people have >100Mbps internet now.

>Most people have >100Mbps internet now
This is the mentality that made the web such a pile of shit today

I know this might blow your mind, but a .js file is not the same thing as a .jpeg file

also, at least in the US, most people are still relegated to

Techpill you out of it. Just do your job and learn how to program in other langs.

React is great, the only missing part is a good routing library. react-router is a piece of shit, do you know any good alternatives?

The mobile web is a thing.
If you deliver kilobytes of JS and have a website that won't to anything until all of that is downloaded, parsed and executed, you automatically have a slow, unusably shitty website on mobile.

dogshit.

literally any other framework is better.

class uses prototypes under the hood anyways so why does it fucking matter? the class syntax is easier to read

React is advertised as framework.

Redux is verbose for no good reason. You need THREE different files just to get something done. You need to do SO MUCH just to access state. Thank god the Context API is now official. There is no reason to use redux. If redux was simple maybe it would have taken off.

>three files
>alot
spot the jquerylet

You are seriusly retarded, I am web developer for years, doing ecommerce solutions, I have around 1mb of JS on my sites, they run really fast, they are compressed, minified, and cached, does it need 1MB of JS? nah it would probably work with 100Kb if it was all custom coded, but guess what, just the translations alone are around 300kb, so get the fuck out you indian piece of shit, go back to your wordpress meme, leave the big boys out to play for dosh you broke ass pajeet

You obviously have never heard of defered loading, or caching, even if it is slow, its slow on first request, after that is read from disk/cache so its irrelevant even if it is 1mb

vanillaJS is the best framework
if you disagree you are a nigger

vanilla-js.com/

except its not easier to read. it matters because its unnecessary bloat and introduces a new way to do something we were always able to do for no reason but to appease noobs.

> JS + OOP
LMFAO, zoomers wanting their meme tech to be taken seriously

I'm not the guy you replied to, but holy fuck you are definitely what is wrong with modern day web development. if you would like to prove me wrong, please provide a link to some of your work.

>25 bytes
Sure thing, buddy.

Attached: 2018-11-07-231142_711x371_scrot.png (711x371, 57K)

Yes, it sure runs fine on your fucking I7 desktop with its 100 mbit/s cable.
It doesn't on a non-insanely priced phone and not when you have to download the site over 3g or 2g.
How can you seriously consider yourself a web developer when all you do is amalgamate overweight JS libraries into a fucking large blob held together by the duct tape that is your code?
Any company that's serious about building great web applications wouldn't want anything to do with developers who distribute 1mb of JavaScript.
It's a disgrace.

That hardly helps when your main bundle depends on 200kb of library code that needs to be downloaded, parsed, compiled and executed before your code.
If there's one thing the web didn't need, it was loading animations for website because the overweight shit bundles don't get loaded fast enough.
>BUT IT WORKS FAST WHEN I RUN IT ON MY DESKTOP OVER 127.0.0.1 WITH THE I7! I DON'T KNOW WHAT THOSE POORFAGS ARE TALKING ABOUT! LEL

You lose 10% of users for every second your page takes to load. Have fun with that.

>You need THREE different files just to get something done.

My current project is more than a hundred files.
Get on my level faggot.

>React is advertised as framework.

React homepage:
>React
>A JavaScript library for building user interfaces

You know there's a thing called code-splitting right?
End user result is the same as static pages. You'll even end up using less bandwidth in the end because each file is cached individually along with the API calls, so if you get a notification and refresh the page you'll need to re-download everything on a server-rendered site while with a React+API approach you'd only need a few KB.

Yes. And I've seen how code splitting looks in reality - either, there's a 700MB "main" bundle with small 1KB bundles per route that at that point might as well have been merged into the main bundle because it's already beyond saving so you'd at least save on the round trip time or there's a 150Kb main bundle (which is still too much, but that's the absolute minimum you need to use react with redux and co on a page) and every single route bundle is also like 100 kb because the libraries are all duplicated.

Modern web developers import way more than shit than they need and the result are pages that are fat in one of two ways.
You very, very rarely come across websites with well-split bundles that also don't import needlessconvenience libraries for every little thing.
Usually only from large companies who can afford to pay their developers to optimize that strongly. Certainly not from the average webdev on Jow Forums.

I usually use ui-router, mostly cause I'm familiar with it from AngularJS. I came to react after AngularJS end of life was announced and I refuse to use a later version of Angular, because fuck TypeScript.

>or there's a 150Kb main bundle (which is still too much
Just the markup of a Wikipedia page is around 30-50kb, and this would be for every page you visit, an SPA site would only need to download most of that once, rest is pure content.
>but that's the absolute minimum you need to use react with redux and co on a page)
React+ReactDOM+Redux is ~42KB gzipped

And yes, I know some developers are retarded and don't put in any effort, but don't hate on React because of it.

React took Angular, cut out all the unnecessary shit, and made a library that lets you put together websites by defining UI elements.

It's incredibly easy to build modular UI elements and systems via React, due to how flexible a single js file can be, and how easy it is to manage state/props between elements.

It's pretty goddamn lightweight (~45kb gzipped) - and if even that's too much for you, Preact does some of the same with even more fat cut out (3.3kb gzipped).

React is built with modularity in mind. Want some other state management solution like Flux or Redux? React won't stop you or get in your way. Want to use an animation library that's not built for React? React won't complain at all unless it severely hampers performance, in which case it'll throw red flags all over the place.

Simply put, it's a performant, modular solution to building a front-end. Most of the 'bad elements' of React listed in this thread are on the developers themselves, and how they approach solving a problem using React.

>what is code splitting
I speed test all my React sites on an ancient thinkpad with a Pentium 3, and I don't run into any issues. I think you're just taking ads into account - those'll fuck up a well designed site beyond belief.

> React took Angular, cut out all the unnecessary shit.

Not even close

Why don't you use a Samsung S2 instead to make sure that it runs fast?

Are you bots?

> I’m okay with 1mb of JavaScript because I have 300kb of translations

Literally the stupidest comment on this thread

>I could have had a 400kb site but instead I have a 1300kb site so FUCK YOU

Attached: 0d0884d3325e791aafa08834079c5095bdbe937ba4693de9da29d5fbb82a2879-v.jpg (1080x1080, 737K)

Avoid webdev at all costs

Webdev is honestly a bubble at this point. So many fucking "developers" who are exactly that, developers. They aren't engineers, they just hobble together whatever meme framework comes out just to push code.

Stick to the basics and learn clean software architecture, dependency inversion, and how to maximize performance.

No can do Paco, they want everything done in 4 weeks.

I don't know what's worse, "Developers" or the hipster faggots with daddy's trust fund money who call themselves "investors" and push for these projects.

Vue is better, that's all you need to know.
React is opinionated bloatware

Vuex is useful too when you get any serious amount of state to keep track of.

>Imo, it's the most intuitive way of piecing together webpages.
I think VueJS is WAY more intuitive. SFC is a blessing

SV definitely is... you can go there and literally get paid twice what you're worth. It's obviously a bubble but brainlets don't see it, and when the bubble bursts they'll be out of a job with no savings because they spent all their money on overinflated rent and toys.

>You need THREE different files just to get something done
no you don't, nothing's stopping you from having your store, actions and reducers in the same file

i will agree that there's more boilerplate than there should be

Attached: 1475040492144.png (600x600, 366K)