News for hackers. Stuff that matters.
Re:Vue RFC: Expose logic-related component options via funct... by chupa-chups on Thursday June 20, 2019 @05:39PM (#20237663)
@Vue team if anyone should read this: I'd recommend to rename vue in the process (for example vueNG or whatever) in order to reduce the amount of false/outdated information when searching for a topic.
Re:Vue RFC: Expose logic-related component options via funct... by superasn on Thursday June 20, 2019 @06:45PM (#20238145)
Yes it becomes a nightmare to search Stackoverflow too.

I still get answers for Vuejs 1.0, with suggestions to use 'partials' for example, only to find out that there exists no such thing in Vue 2.0.

This would be very bad for developers if they still call it Vue with another version number.

Even if they call it VueThree, VueNext or similar then the problem can be easily mitigated I think.

Re:Vue RFC: Expose logic-related component options via funct... by julvo on Thursday June 20, 2019 @06:08PM (#20237886)
This. I like that the Vue team thinks of ways to improve on the current state of the art and welcome new ideas, but please under a different name. It needs to be succinct enough so that search engines can distinguish the two. Otherwise, there is a big risk of things becoming confusing and frustrating quickly.
Re:Vue RFC: Expose logic-related component options via funct... by stesch on Thursday June 20, 2019 @05:54PM (#20237780)
Isn't this half the fun of using JavaScript frameworks?
Re:Vue RFC: Expose logic-related component options via funct... by jspash on Thursday June 20, 2019 @06:40PM (#20238111)
No, this is the OTHER half of using them. :/
Re:Vue RFC: Expose logic-related component options via funct... by IggleSniggle on Thursday June 20, 2019 @06:00PM (#20237818)
AngularJS/Angular split community still have this problem, although less so this year than last.
Re:Vue RFC: Expose logic-related component options via funct... by tmaly on Thursday June 20, 2019 @10:25PM (#20239349)
If they won't, the community could always decide to adopt a tagging or naming standard.

Being able to find answers quickly is a big win for beginners.

Re:Vue RFC: Expose logic-related component options via funct... by luismartinezs on Friday June 21, 2019 @03:36AM (#20240651)
How about Vue 3.0?
Re:Vue RFC: Expose logic-related component options via funct... by pier25 on Thursday June 20, 2019 @06:14PM (#20237930)
Yes, that's what the React team should have done when they implemented hooks.
Re:Vue RFC: Expose logic-related component options via funct... by NewsAware on Thursday June 20, 2019 @06:27PM (#20238037)
Well, with React you can "opt in" when searching by simply adding "hooks" to the search term. Such wasn't possible with Angular back then
Re:Vue RFC: Expose logic-related component options via funct... by pier25 on Thursday June 20, 2019 @06:43PM (#20238136)
Since the majority of the community will probably be using hooks from now on it will be assumed that is the default React methodology which will break books, talks, blog posts, SO answers, etc.
Re:Vue RFC: Expose logic-related component options via funct... by ng12 on Thursday June 20, 2019 @06:52PM (#20238211)
You can mix-and-match. If you want to write an individual component as a class you can, and if you want to later convert it to using hooks there's nothing stopping you.
Re:Vue RFC: Expose logic-related component options via funct... by pier25 on Thursday June 20, 2019 @07:03PM (#20238295)
That's not the point.

The point is that most of the React literature available today will become obsolete.

Re:Vue RFC: Expose logic-related component options via funct... by ng12 on Thursday June 20, 2019 @07:04PM (#20238299)
How? It's still perfectly valid, usable, idiomatic React.
Re:Vue RFC: Expose logic-related component options via funct... by pier25 on Thursday June 20, 2019 @07:17PM (#20238401)
If you learned React with hooks the class notation won't make sense, and viceversa.
Re:Vue RFC: Expose logic-related component options via funct... by ng12 on Thursday June 20, 2019 @07:18PM (#20238415)
So they should have renamed the whole framework when they added a single a new feature so people know they need to learn it before reading the examples?
Re:Vue RFC: Expose logic-related component options via funct... by pier25 on Thursday June 20, 2019 @07:57PM (#20238666)
It's not a new feature it's a complete new methodology.
Re:Vue RFC: Expose logic-related component options via funct... by root_axis on Thursday June 20, 2019 @08:43PM (#20238890)
The point is that you don't have to use it. If you can't be bothered to learn a simple new feature then just keep doing it the old way; your code will still work. I don't even understand the complaint; are they never supposed to change anything? It's totally optional; even if most of the community goes down that direction you don't have to.

Beyond that, hooks are super simple and the complainers are just making a big deal out of nothing. They are just callback functions that you implement outside of a class instead of overloading arbitrary method identifiers like "componentDidUpdate".

You also don't have to use it.

Re:Vue RFC: Expose logic-related component options via funct... by ng12 on Thursday June 20, 2019 @08:42PM (#20238881)
That's quite hyperbolic. Functional components have existed in React for a long time, hooks are just adding existing concepts (state and lifecycle operations) to them.
Re:Vue RFC: Expose logic-related component options via funct... by pier25 on Friday June 21, 2019 @10:42AM (#20242880)
We will have to agree to disagree. IMO the compositional paradigm of hooks is radically different than using classes for example.
Re:Vue RFC: Expose logic-related component options via funct... by BigJono on Thursday June 20, 2019 @07:40PM (#20238557)
This is what I don't get about hooks. Remembering Markbages great talk on 'Minimal API Surface Area'? How is having multiple ways of doing the same thing minimal API surface area?

React is losing sight of what made it great when it came out. Do one thing, do it well, and do it the simplest way possible.

Re:Vue RFC: Expose logic-related component options via funct... by thatswrong0 on Thursday June 20, 2019 @08:08PM (#20238728)
That sort of absolutist logic will never allow a framework to progress and become better. Sometimes good ideas come around (IMO like hooks) that are worth increasing the API surface area for.

I for one loathe using class components now and not being able to share logic compositionally via hooks when I work with them. I feel more productive and I feel like my components are smaller and more focused, and I don’t repeat myself as much. It’s been a net win for me, and I think it’s well worth having two supported APIs that do roughly the same thing.. because despite this, React is still a small and focused library API-wise.

Re:Vue RFC: Expose logic-related component options via funct... by ng12 on Thursday June 20, 2019 @08:43PM (#20238889)
They've increase the surface to reduce it over time, if that makes sense. Hooks are much more natural, simplistic way to write stateful components.
Re:Vue RFC: Expose logic-related component options via funct... by zwily on Thursday June 20, 2019 @06:25PM (#20238018)
Why? Hooks are completely backwards compatible.
Re:Vue RFC: Expose logic-related component options via funct... by pier25 on Thursday June 20, 2019 @06:41PM (#20238120)
What about books, talks, blog posts, SO answers, etc?

Is everyone going to rewrite all React literature with hooks?

Re:Vue RFC: Expose logic-related component options via funct... by pests on Thursday June 20, 2019 @08:31PM (#20238811)
No rewriting needed. Hooks are just another way to do what was already possible in a more well-defined way. All the content written is still applicable. Now there is just a new way to do things too.

The developers and documentation even advises against rewriting old components with hooks unless you need to.

Re:Vue RFC: Expose logic-related component options via funct... by pier25 on Thursday June 20, 2019 @09:07PM (#20239005)
> All the content written is still applicable.

Technically yes, but what if someone only uses hooks and has never used classes?

And, viceversa, since there is now a lot of people moving to hooks and producing React literature for hooks what if you only have used classes?

So now, to be able to read all the React literature one has to understand both methodologies.

> The developers and documentation even advises against rewriting old components with hooks unless you need to.

It doesn't matter. A big chunk of the JS community is hype-based.

Re:Vue RFC: Expose logic-related component options via funct... by pests on Saturday June 22, 2019 @07:23PM (#20252289)
You're gonna have to learn it eventually to work with other code bases and so on. But the point was it doesn't change existing knowledge, just something new to learn.
Re:Vue RFC: Expose logic-related component options via funct... by fourthark on Friday June 21, 2019 @12:59AM (#20239978)
So don't listen?
Re:Vue RFC: Expose logic-related component options via funct... by ng12 on Thursday June 20, 2019 @06:26PM (#20238029)
Hooks are additive.