5 ms·
> unlike React provides a lot of functionality out of the box. Stuff like the router, the computed properties, automatic change detection, I never studied Vue,
by danmaz74 9y ago
> unlike React provides a lot of functionality out of the box. Stuff like the router, the computed properties, automatic change detection,
I never studied Vue, but the article starts saying "Both have separate, but commonly used, router and state management libraries". This doesn't look like "out of the box" to me.
- mcintyre1994 9y agohttps://vuejs.org/v2/guide/routing.html https://vuejs.org/v2/guide/routing.html For most Single Page Applications, it’s recommended to use the officially-supported vue-router library. For more details, see vue-router’s documentation. https://github.com/vuejs/vue-router https://github.com/vuejs/vue-router -- https://vuejs.org/v2/guide/state-management.html https://vuejs.org/v2/guide/state-management.html Vue offers vuex: our own Elm-inspired state management library. https://github.com/vuejs/vuex https://github.com/vuejs/vuex -- Out of the box or not, they're part of the same github org, they're officially supported and they're documented in the official docs. I think this is just splitting hairs.
- danmaz74 9y agoRedux has been from the same github org for a very long time too: https://github.com/reactjs/redux https://github.com/reactjs/redux And react-router, while not being on the same github, is pretty much considered a standard too. It's ok to not split hairs for vue.js, but then you shouldn't do the same for react...
- wereHamster 9y agoreact-router, do you mean v1, v2, v3, or v4 (or perhaps v5 and v6, I haven't checked if there was a new release with breaking API changes during the past 12 hours).
- sheeshkebab 9y agoWhy downvote? Anyone sane can't seriously be thingking of using react-router in anything non throw away - the library gets rewritten from scratch every year and doesn't provide any backwards compatibility or migration paths. You might as well just write your own react-router implementation for every react project you work on.
- forgottenacc57 9y agoAgreed. I need to switch from react-router. I think they are now making major changes for no good reason.
- buchanaf 9y agoI mean react-router is almost a 3 year old library trying to handle a rather complex problem. The first three versions were largely the same with no major changes that I can think of except for switching from context to higher order functions. I think everyone is a little dramatic about the number of versions of the library, especially when they are going to continue to support v3.
- ricardobeat 9y agoWell, that just makes things even worse - now you have to choose which version to use, which is just proving the OPs point.
- pluma 9y agoIf you don't like having to choose which version of react-router to choose, you probably should be using a preset like create-react-app which makes this kind of decision for you. Or you should use something other than React which includes everything and the kitchen sink.
- ricardobeat 9y agoExactly! (snark aside)
- buchanaf 9y agoThis doesn't really make sense to me. You have to pick a version for literally every single library you use. And those different versions have different interfaces, which is why they have different versions...
- deleted 9y ago[deleted]
- aleksandrm 9y agoRouting is not very complex.
- pluma 9y agoI'm not a fan of React Router but this sounds like you haven't actually used any of those versions or even looked at the breaking changes. Here's what actually happened: v1: https://github.com/ReactTraining/react-router/blob/v3/upgrade-guides/v1.0.0.md https://github.com/ReactTraining/react-router/blob/v3/upgrad... v2: https://github.com/ReactTraining/react-router/blob/v3/upgrade-guides/v2.0.0.md https://github.com/ReactTraining/react-router/blob/v3/upgrad... v3 mostly just removed APIs that were deprecated in v2. v3 continues being maintained even beyond the v4.0.0 release. v4: https://github.com/ReactTraining/react-router/blob/master/packages/react-router/docs/guides/migrating.md https://github.com/ReactTraining/react-router/blob/master/pa... In my opinion it would have been clearer if react-router v4 had been released under a different name but I guess the authors didn't want to pay the cost of that. The API changes between 1 and 2 as well as 2 and 3 are mostly cosmetic. It's worth pointing out the authors released codemods which will likely be able to convert your app from one version of the library to the next as long as you don't do something exceptionally clever. The changes between 0.x and v1 were entirely expected. It seems the authors followed the common semantics that 0.x releases are considered experimental, v1 was based on the lessons learned. v2 and v3 then improved upon that design with relatively minor changes. On the other hand v4 is an entirely new library using an entirely different paradigm: routes use component semantics and are part of the component structure, rather than just some JS router that uses JSX syntax for aesthetics. But as I said: v3 is still being actively maintained, the authors have just decided that the v4 API fits React better. And for all major releases from v1 to v3 you should be able to upgrade practically for free by using codemods. I think the importance of codemods can not be understated though many people are still ignorant of them: Facebook releases codemods for every major version of React and uses them internally to upgrade their tens of thousands of components automatically. Third-party libraries like React Router have also started providing them. Codemods written well should allow app developers to migrate breaking API changes in dependencies with practically no development effort. Additionally, like React, React Router seems to have adopted the approach of deprecating APIs in the final release of a major version that is no longer going to be supported so you can upgrade your manually code before moving to the new major version with no fear of things breaking. So when upgrading from v2 to v3 you should be able to upgrade safely by simply upgrading to the latest minor version and fixing any deprecation warnings. Both codemods as well as deprecations of course assume you're doing the sensible thing and a) upgrading one major version at a time and b) actually maintaining your project rather than just spending half an hour on it once a year to implement a new feature with no test coverage. Personally I often end up doing the not so sensible thing where I end up having to migrate all third party deps to the latest version once a year or two, but libraries like React and React Router are the least of my worries because they are extremely safe and easy to upgrade -- even to the point where there's no need to upgrade beyond React Router v3 unless you also prefer the v4 API.
- coldtea 9y ago>And react-router, while not being on the same github, is pretty much considered a standard too. The kind of standard that just doesn't stop giving backwards incompatible BS releases...
- hizanberg 9y agoreact-router is one of the worst evolved software proects I've seen which keeps destroying it's knowledge base with every release with almost everything indexable on the web out of date with the latest version. It's also not as intuitive to use as vue-router (which just worked OOB) and it's root page handling behaves differently to the Routers in Angular, Aurelia and Vue. It feels like you're incurring tech debt by depending on React Router but unfortunately since it's the defacto standard there's very few other viable options. By contrast Vue feels like they care about their ecosystem and existing Customer code bases and will publish nice migration guides when they make breaking changes showing how old functionality can be migrated to their new APIs.
- pluma 9y ago> By contrast Vue feels like they care about their ecosystem and existing Customer code bases and will publish nice migration guides when they make breaking changes showing how old functionality can be migrated to their new APIs. There are migration guides for v0.13.x->v1, v1->v2 and v3->v4 right in the docs of react-router. How is this a contrast?
- acemarke 9y agoTo clarify: the ReactJS org is solely a community organization for some commonly used packages. It's not an official Facebook+React thing, even though both Dan Abramov and Andrew Clark, creators of Redux, are now actually on the React team. (I'm one of the current maintainers of Redux.)
- reaperducer 9y agoThe official Vue docs? The ones where half of the useful stuff is either missing, incomplete, or doesn't work because it's information for a deprecated version? Vue has a lot of things going for it. Documentation is not one of them.
- gustojs 9y agoVue is widely praised for its official documentation, often pointed as one of things differing it from React. But if you have other experience, I'd kindly asked you to mention the places you remember were wrong, so that I can submit a PR for them.
- kevin_thibedeau 9y agoVue is being specifically designed to work as small composable modules. That is a good thing. You get a bunch of boxes you can mix and match as you wish.
- pier25 9y agoIn separate repos, yes, but unlike React both the Router and Store are official. When using Vue CLI it configures a project for you with vue-router and vuex.