Live data from Hacker News

Vue.js 3

github.com

61–70 of 308 posts

Re: Vue.js 3

#61
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)

Holy shit, Evan You replied to my comment.

Happy Vue user since 2016.

> TS inference works with the JS objects. There's no need to provide the generic argument here.

That's totally valid -- I am just being nitpicky and complaining because if possible I'd prefer to do it the other way: TS type -> JS object

> auto-generating runtime types from TS interface

Whoa. Well, that solves that then.

Re: Vue.js 3

#63
I am impressed with the amount of energy Evan is pouring in this open source project.

I am curious if he ever experience boredom working on Vue.

I am also curious if Patreon based income is sustainable for the long run. What if there's another new sexy JS framework in the future?

Re: Vue.js 3

#64
post #11
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's definitely not how to show that, but if you follow their link ( https://docs.google.com/spreadsheets/d/1VJFx-kQ4KjJmnpDXIEai... ), you'll see the numbers. The math is like, if it did use 100mb, and now it uses 25mb, that's 300% less, because 25mb is the "100%", and you reduced by that amount 3 times. Odd.

Thank you for the link to the spreadsheet. Exact numbers they show are:

- "120% less memory usage" - From 9.9 Mb to 4.5 Mb

- "Up to 133% faster updates" - 13.18 (ms?) to 5.64

In both cases, the formula to calculate the percentage is:

  = ( PREVIOUS - CURRENT ) / CURRENT
Oh, actually they just changed it. For the memory usage, it's now:

  = ( PREVIOUS - CURRENT ) / PREVIOUS
..which shows a more intuitive result: -54.55%.

Re: Vue.js 3

#65
post #4

I am impressed how they redesigned both internal architecture and a public API while keeping the users happy. Many well written projects fall into the trap of being a great fit for the contemporary practices but become less relevant over time as the ecosystem changes. Well done, Vue!

curious how easy it will be to move from vue 2 to vue 3

The migration guide [1] lists breaking changes. If you use many Vue 2 libraries you'll want to wait until they're updated to Vue 3. (I reminds me of the Python situation where if you used lots of Python 2 libraries you'd write your new code in Python 2 instead of Python 3, until those libraries migrated to Python 3)

[1]: https://v3.vuejs.org/guide/migration/introduction.html#break...

Re: Vue.js 3

#66
Can I use it by including it with a script-tag?

Vue 2 was kind of possible to get up and running with a script-tag to get components in a pre-existing app.

Re: Vue.js 3

#67
post #38

I still don't see a reason why one would use Vue or React. I agree that templating of data is something you should use a library for. But there are great templating libraries. Handlebars for example. Can someone give a short example of code that would be more elegant using Vue then just a simple template engine?

A short example, no, because if all you need is a simple website, then you don't need Vue either :) If you're building complex user interfaces or a large-scale web app, then hell yeah, you want to use React or Vue.

You can use vue, because for most web-applications with vue3 you will only add an additional 15kb to it. I'd wager kilobyte counts that low are worth it when you consider how much easier it is to add on additional functionality when you need it. A well-built build system can do so much automatically for you, including but not limited to automatically minifying your code, cleaning up dead code, html and styles or compressing your images in the build step.

For reference: I recently built a really large scale website with react, including a content-management-system, custom fonts, around 50 pictures and a ton of tracking. It weighs 1,1MB total. The first request without lazy-loaded resources only uses around 200KB. Can't really argue against that.

Re: Vue.js 3

#68
post #63

I am impressed with the amount of energy Evan is pouring in this open source project. I am curious if he ever experience boredom working on Vue. I am also curious if Patreon based income is sustainable for the long run. What if there's another new sexy JS framework in the future?

> What if there's another new sexy JS framework in the future?

That's how a market works. It's a strong incentive to keep Vue sexy.

Re: Vue.js 3

#69
post #59

Earlier quoted context omitted.

One example is building an application like minesweeper. Would you really want to tackle that with jQuery and templating engine? I'd rather break everything into components, have them talk to each other through a state manger like vuex or redux, and only phone home to my API for important things, like the final game score.

I would neither need jQuery nor a templating engine to write Minesweeper.

It's great you applied your vanilla JS skills to his totally metaphorical example.

I still don't get why it's okay for every other programming language to use the STL or huge dependencies, but doing so with javascript is frowned upon for some people. You wouldn't write a JSON parser yourself in CPP, you'd install something from conan or use the STL or boost for that. Why is it so bad to do the same with js?

Re: Vue.js 3

#70
post #39

Earlier quoted context omitted.

curious how easy it will be to move from vue 2 to vue 3

Its very easy for users, quite difficult for library maintainers

This is a great tradeoff actually. It sucks to break backwards compatibility, but often that's the only way to move forward. If you have to break something, affecting the least number of developers is best.

This also gives a chance for a refresh of the ecosystem: libraries that are no longer relevant (eg, their functionality has been incorporated or otherwise made obsolete) can go away, and they get a nice "out" so no one has to feel bad about shuttering a project.

It also gives a chance for keeping the libraries using newer APIs, or even newer libraries to gain traction.

Very similar to doing a controlled burn in a forest: Worse than no fire at all, but orders of magnitude better than an actual wildfire.

Post reply on HN