Live data from Hacker News

Vue.js 3

github.com

121–130 of 308 posts

Re: Vue.js 3

#121
post #48

My only wish now is for the TSX experience to be rounded out. From a reactivity standpoint, Vue has a much more ergonomic/easy to use API for handling component state, effects, and computed values (in my opinion) than React. But in the last 6-8 months, I've leaned away from Single-File Components because when you want to do something like define a bunch of small components, it's a lot more difficult to do than with m…

> Having to write two type definitions for Component Props: one TS interface/type, and one as the JS object sucks. Uh, you don't have to? TS inference works with the JS objects. There's no need to provide the generic argument here. Also check out this: https://github.com/vuejs/rfcs/blob/sfc-improvements/active-r... (auto-generating runtime types from TS interface)

I just looked at the sample code you provided. Having no experience with Vue (only React and Angular), but heavy TS user, something came to my eye:

Is it correct that `declare const props` will not only get used to type-check stuff but also emit code based on that?

I think thats unintuitive. TS basically means "take away all the static types and you get what the compiler emits". A lot of developers won't be able to distinguish between TS and the magic that some framework does. I've made similar observations when working with Angular devs.

Correct my if I've mistaken something. /2c

Re: Vue.js 3

#122
post #98

Earlier quoted context omitted.

The market also isn't as volatile as people make it out to be. The top most used js frameworks (React, Angular and Vue) have been in the top spots for 5 to 7 years now. I guess the market might as well be settled. Of course there are some new comers every year, but they don't enjoy a large market share. Hell, I've not even seen VueJS used once in any serious project in the industry. React and Angular are here to stay…

Angular seems to be dying. Svelte is an interesting contender. I think it will be React's main competitor given a year or two.

Angular is massive - MASSIVE - within large orgs you will have heard of but which I cannot name for obvious reasons.

The twitterati and hobbyist crowd seem to love react, but anecdotally I've yet to see it used seriously at a BigCo, but Ng+TS is everywhere.

Re: Vue.js 3

#124
post #90
post #80

Earlier quoted context omitted.

Sure, you can use HBS (or even vanilla) to render a piece of dynamic HTML. That's not really the problem these libraries are solving. You could also create your own components with HBS templates and figure out how compose them to render a tree of components. That's not too hard to figure out either. The problem is really in updating the DOM when state changes somewhere in your application. In the jQuery days we had t…

You say updating the DOM becomes messy but give no arguments why that would be the case. Say a function changes the cars array. All it has to do to update the DOM is: document.querySelector('#cars').innerHTML=carsTemplate(cars); Where carsTemplate is a HandleBars template that on page load has been initialized with the html to render the list of cars.

That's an imperative approach, rather than a declarative one. You can't track where the state is being changed if #cars is being changed in many places. Templates are fine for smaller apps but in larger apps it's more difficult, and there'll be more spaghetti code and bugs due to that.

Re: Vue.js 3

#125
post #9
post #6

> Vue 3 has demonstrated significant performance improvements over Vue 2 in terms of bundle size (up to 41% lighter with tree-shaking), initial render (up to 55% faster), updates (up to 133% faster), and memory usage (up to 120% less). What does 120% less memory usage mean, really?

It doesn't need memory anymore. Writes raw to spinning disk. 2% faster -50% of the time

It also goes ahead and downloads some extra RAM for you.

Re: Vue.js 3

#126
Vue is the only one of the most popular 3 frameworks that can easily be used on a minimal basis to sort of "spruce up" old applications by selectively adding it here and there in the templates.

Seems like they should try more marketing and community outreach toward that end.

Gradual adoption is a feature / selling point not many web development frameworks can claim.

Re: Vue.js 3

#127
post #98

Earlier quoted context omitted.

Angular seems to be dying. Svelte is an interesting contender. I think it will be React's main competitor given a year or two.

Angular is massive - MASSIVE - within large orgs you will have heard of but which I cannot name for obvious reasons. The twitterati and hobbyist crowd seem to love react, but anecdotally I've yet to see it used seriously at a BigCo, but Ng+TS is everywhere.

Your comment seems to present anecdotal evidence as facts about $framework's popularity. I think that's misleading.

I'm wondering if there's a scraper out there crawling Alexa TOP 1xxx pages for use of specific libraries, frameworks? Maybe that would present a more accurate picture about this.

Also it's often misleading since in any company with more than a few employees there seems to be more than one team of developers which often leads to different frameworks being used in different parts of the company. In $dayJob we use Angular in some legacy internal stuff, React in a rewritten consumer-facing project and preact or jQuery in a different consumer-facing project.

It's not that simple to determine marketshare of frameworks I think. We can just present different numbers and draw different conclusions from it, e.g. number of job postings mentioning specific frameworks, number of downloads in a registry, number of domains using it (assuming one app per domain), number of stars on github or number of people claiming to use it in the stackoverflow survey.

Re: Vue.js 3

#128
post #120
post #110

Earlier quoted context omitted.

What are you talking about? You're just talking about simple class manipulation which has nothing to do with actual reactivity, especially 2-way data binding. How would you support that with your "templating engines" you keep mentioning, which to me doesn't mean anything at all, in my understanding of what a templating engine is like handlebars.

As I said, I would not use a template engine to write Minesweeper.

So when I click a tile you have some code on the onclick handler to go update the counter at the top? Sounds messy if there are multiple things you need to update when some data changes.

Re: Vue.js 3

#129
I was surprised to see an update to a contemporary JavaScript framework to be welcomed rather than boo’d by the average HN reader. That in itself is an accomplishment.
Post reply on HN