Earlier quoted context omitted.
You can create isolated functions instead of nested functions wherever you want. Just pass in params instead of using closures. This is entirely up to the developer.
You can, yes. But the developer working on the codebase you’re going to inherit might not. Class components are usefully opinionated in that way.
React v17.0 Release Candidate: No New Features
61–70 of 120 posts
Re: React v17.0 Release Candidate: No New Features
#62Earlier quoted context omitted.
So glad Angular is dying off. It looks nice on the surface but as soon as you try to do something outside the tutorial it gets nutty. React is at a great level of abstraction between code and UI framework. It reminds me of the MVC frameworks of olde, which by all accounts were great, just limited because they relied on page refresh for everything
>So glad Angular is dying off. Uh, I'm gonna challenge you to give a source on that. Your comment sounds extremely biased towards React and dismissive towards Angular. None of those are dying out, I wouldn't we even say they compete directly.
Versus 2016: http://2016.stateofjs.com/2016/frontend/
Angular is 100% fading, albeit slowly. Seems like a lot of slow moving enterprise companies are still going with it anecdotally. I'd bet on very few new projects opting for it currently, and probably near zero within 2-3 years.
As to why, IMO Vue ate Angular's lunch. Single file components did everything angular's MVC wanted without all the failures like $scope and other things. React and Vue can coexist, but I think Vue and Angular are direct competition. Also see those developer surveys and the massive growth of popularity of Vue along with angular's fading.
Re: React v17.0 Release Candidate: No New Features
#63"It has been two and a half years since the previous major release of React, which is a long time even by our standards!" As a mostly Python and only occasional JavaScript developer, it always felt like the biggest challenge in the JavaScript community was how fast everything moved - new libraries, frameworks and ideas would tumble past at the rate of one every few weeks, and it felt impossible to keep up. I've been…
I second you on that. The number of times I've had to rewrite code because a framework decided to break everything with little warning.. I don't even want to think about it actually. I get wanting to make code better but gesh people, do some planning and figure out a direction to move a project. Also it seems JS devs don't understand semver either. Massive breaking changes in patch or minor versions are just evil.
I have published a library myself and experienced it, going from 2.x to 3.x to 4.x.
After you just do it for the sake of semver though, the resistance vanished for me.
And the second thing: Never use 0.x.x versions, I think those should have been omitted from semver completely, as they circumvent the entire concept.
Re: React v17.0 Release Candidate: No New Features
#64It's refreshing to see a major release of a frontend library that doesn't completely redo the API (React Router and Angular, take note). I remember there was a time when a bunch of features were being considered to be bolted on to JSX which was going to be called JSX 2.0[0]. I'm glad that never happened. Maybe the next version of React can even remove features, like hooks. 0. https://github.com/facebook/jsx/issues/65
I'd still _loooove_ to have "prop punning", ie, shorthand passing of props based on local variable names equivalent to ES6 object literal shorthand: Doesn't seem too likely to happen at this point, though.
Re: React v17.0 Release Candidate: No New Features
#65It's refreshing to see a major release of a frontend library that doesn't completely redo the API (React Router and Angular, take note). I remember there was a time when a bunch of features were being considered to be bolted on to JSX which was going to be called JSX 2.0[0]. I'm glad that never happened. Maybe the next version of React can even remove features, like hooks. 0. https://github.com/facebook/jsx/issues/65
Re: React v17.0 Release Candidate: No New Features
#66Earlier quoted context omitted.
React won the spa crowd. Lags behind in server side frameworks adoption over Vue. React won the enterprise crowd pushing angularjs out. React hasn't won over the JQuery crowd If you do primary js it probably has. If you only do some js and other things it probably hasn't yet.
Next.js is a very decent React based SSR framework imo, and not sure vue is more popular
Re: React v17.0 Release Candidate: No New Features
#67"It has been two and a half years since the previous major release of React, which is a long time even by our standards!" As a mostly Python and only occasional JavaScript developer, it always felt like the biggest challenge in the JavaScript community was how fast everything moved - new libraries, frameworks and ideas would tumble past at the rate of one every few weeks, and it felt impossible to keep up. I've been…
Those of us who were doing Python web dev in the years 2000s might remember that Python went through a similar period where it seemed that every week a new backend framework came out: Zope, CherryPy, web2py, Pylons, Django, repoze.bfg, TurboGears... to name a few. Nowadays it seems that everybody has settled for either Django or Flask. It might not have been as crazy as what happened with JavaScript in the years 2010s but still I tend to see a similar pattern. People try a lot of different things, going in slightly different directions and eventually interesting approaches get identified and communities build up around a couple of solutions.
Meanwhile the Ruby community was able to build consensus around Ruby on Rails, with just Sinatra on the side for small projects.
I'm wondering if this ability to try many different things might have been the cause for Python building numpy and eventually winning the scientific computing area as well.
Re: React v17.0 Release Candidate: No New Features
#68No new feature, yet contains breaking changes.
Re: React v17.0 Release Candidate: No New Features
#69"It has been two and a half years since the previous major release of React, which is a long time even by our standards!" As a mostly Python and only occasional JavaScript developer, it always felt like the biggest challenge in the JavaScript community was how fast everything moved - new libraries, frameworks and ideas would tumble past at the rate of one every few weeks, and it felt impossible to keep up. I've been…
> As a mostly Python and only occasional JavaScript developer, it always felt like the biggest challenge in the JavaScript community was how fast everything moved Those of us who were doing Python web dev in the years 2000s might remember that Python went through a similar period where it seemed that every week a new backend framework came out: Zope, CherryPy, web2py, Pylons, Django, repoze.bfg, TurboGears... to name…
Re: React v17.0 Release Candidate: No New Features
#70It's refreshing to see a major release of a frontend library that doesn't completely redo the API (React Router and Angular, take note). I remember there was a time when a bunch of features were being considered to be bolted on to JSX which was going to be called JSX 2.0[0]. I'm glad that never happened. Maybe the next version of React can even remove features, like hooks. 0. https://github.com/facebook/jsx/issues/65
Do you actually think hooks are worth dropping? I see the appeal of classes, but I really enjoy hooks too.
I really dislike the way they can be abused to litter state and side effects all over React code so easily (e.g. hiding it layers deep in helper functions). And I feel they've made the API worse, such as `this` being replaced with the more clumsy `useRef`, or requiring an empty array to change the behavior of `useEffect`. These are things that break the Principal of Least Astonishment and have consequently led to countless blog posts that try to explain how to do things that were much more straight forward without hooks.
I've written about hooks before in past comments: https://news.ycombinator.com/item?id=19357068
It's been a couple of years since they've been added, and I don't feel the ecosystem has improved because of it. So to me it was a mistake.
I know they will likely not be removed from React, so what I said was more tongue-in-cheek.