News for hackers. Stuff that matters.
[dead]
Re:Show HN: A renderless and extendable rich-text editor for... by jeremyjh on Saturday May 25, 2019 @09:59AM (#20009084)
So you are getting downvoted because you are shitposting some off-topic stuff. I don't know why we have to talk about React in every thread about Vue. But I'll respond anyway.

I like both React and Vue. I used React first, but I've used Vue for longer now. React introducing a new feature doesn't change anything about what makes Vue.js good. One thing I like about Vue.js is that basic data binding is a job that is done by the framework, instead of the programmer. Another thing that I like is that async methods are supported everywhere that methods are supported. So async mounted works great for data loading. We do not "know that lifecycle is a bad pattern". Its just a pattern, and implementations can be good or bad.

As for react, I don't think hooks are the end of the story:

https://twitter.com/ryanflorence/status/1095455632335921152

Re:Show HN: A renderless and extendable rich-text editor for... by billconan on Saturday May 25, 2019 @10:10AM (#20009141)
Ya, I also could not understand why lifecycle is bad, because not only vue has it, other frameworks, like iOS sdk also has this concept.

And I have never had trouble using them.

I googled “lifecycle bad pattern. And found https://hackernoon.com/problematic-react-lifecycle-methods-a...

But I didn’t see it explaining why it is bad.

Re:Show HN: A renderless and extendable rich-text editor for... by revskill on Saturday May 25, 2019 @10:11AM (#20009150)
Lifecycle is not to be reused. Hooks could be reused and used everywhere you want.
Re:Show HN: A renderless and extendable rich-text editor for... by jeremyjh on Saturday May 25, 2019 @10:34AM (#20009285)
In Vue nothing prevents you from reusing a common function in or as a lifecycle method. I’m sure you think mixins are bad too, since Dan does, but you can also just use plain functions and bind this.
Re:Show HN: A renderless and extendable rich-text editor for... by revskill on Saturday May 25, 2019 @11:09AM (#20009451)
You're reusing a function, not a lifecycle.
Re:Show HN: A renderless and extendable rich-text editor for... by jeremyjh on Saturday May 25, 2019 @10:30AM (#20009267)
The react community has decided reacts implementation of lifecycle methods has some downsides. Every pattern has pros and cons, which may play out differently in different implementations.
Re:Show HN: A renderless and extendable rich-text editor for... by revskill on Saturday May 25, 2019 @10:08AM (#20009131)
Hooks of course is not the end of story. It's just an evolution of how we do UI/UX.

My comment is due to the fact that, the OP editor uses a lifecycle, which relates to me, on the fact that i DID NOT choose Vue.

Now i'm happy with ReactJS, Hook, Suspense, and more.

Re:Show HN: A renderless and extendable rich-text editor for... by steve_adams_86 on Saturday May 25, 2019 @09:52AM (#20009044)
Perhaps you're just most comfortable with react and vue seeming inferior is only a product of that. Both are great at what they do and allow people to be very productive. I personally like both and don't agree that vue only copies react. I definitely prefer how react manages state and redrawing, but both approaches have merits. As always, pick what suits the problem you need to solve.
Re:Show HN: A renderless and extendable rich-text editor for... by revskill on Saturday May 25, 2019 @09:55AM (#20009062)
For a software project, library/framework choice is the most critical thing one must do.

For the VueJS case, i did really want to adopt it for my projects, but there's a fact that i'm not confident. They're not just "function".

And as i said above, in React case, they're moving away from "component lifecycles", so if i chose VueJS, i'll get stuck in that paradigm.

Re:Show HN: A renderless and extendable rich-text editor for... by rymate1234 on Saturday May 25, 2019 @10:18AM (#20009196)
React still has a "component lifecycle" -- it's just with hooks the way you interact with that lifecycle is different [1].

> Hooks are a more direct way to use the React features you already know — such as state, lifecycle, context, and refs. They don’t fundamentally change how React works, and your knowledge of components, props, and top-down data flow is just as relevant.

And if you like functional components, VueJS has them as well [2]

[1]: https://reactjs.org/docs/hooks-faq.html#how-much-of-my-react... [2]: https://vuejs.org/v2/guide/render-function.html#Functional-C...

Re:Show HN: A renderless and extendable rich-text editor for... by jeremyjh on Saturday May 25, 2019 @10:01AM (#20009094)
You should try software engineering instead of chasing fads. You cannot go wrong choosing either framework.
Re:Show HN: A renderless and extendable rich-text editor for... by revskill on Saturday May 25, 2019 @10:12AM (#20009161)
It's about the HOW.

How we think, how we code. Yes, you can't go wrong choosing one or another, but you can't change anything in your mind about software engineering.

Re:Show HN: A renderless and extendable rich-text editor for... by cuddlecake on Saturday May 25, 2019 @10:38AM (#20009305)
Hopefully, your mind can change when presented with new information.
Re:Show HN: A renderless and extendable rich-text editor for... by alangibson on Saturday May 25, 2019 @10:50AM (#20009361)
> library/framework choice is the most critical thing one must do

This is officially trolling.

Re:Show HN: A renderless and extendable rich-text editor for... by yladiz on Saturday May 25, 2019 @09:50AM (#20009033)
I’m not sure what you mean by “lifecycle”, but just to be clear, hooks are tied to the component lifecycle.
Re:Show HN: A renderless and extendable rich-text editor for... by revskill on Saturday May 25, 2019 @09:52AM (#20009040)
They're "didMount", "didX",...
Re:Show HN: A renderless and extendable rich-text editor for... by azangru on Saturday May 25, 2019 @02:24PM (#20010438)
> as we know that `lifecycle` is a bad pattern.

What ever do you mean by this? Hooks are more ergonomic in some scenarios, react's class methods in others.

Re:Show HN: A renderless and extendable rich-text editor for... by going_to_800 on Saturday May 25, 2019 @01:25PM (#20010159)
You're getting downvoted for a good reason, your comment has no place here, this is not a react vs vue debate.
Re:Show HN: A renderless and extendable rich-text editor for... by ceejayoz on Saturday May 25, 2019 @09:54AM (#20009057)
IMO, the biggest appeal of Vue is the same PHP's had for a long time - the ability to just drop a file on a server and see it working. Embedding Vue via <script> tag works beautifully - no Webpack, no plugins, etc.

Great way to get started and experiment. Sure, once you want to do more, you'll want build tooling etc., but that initial ease is really compelling for someone who's learning.

Re:Show HN: A renderless and extendable rich-text editor for... by tazard on Saturday May 25, 2019 @11:23AM (#20009526)
I mean, I prefer Vue for reasons, but I'm pretty sure you can do that with React too...
Re:Show HN: A renderless and extendable rich-text editor for... by homarp on Saturday May 25, 2019 @12:12PM (#20009773)