r/javascript • u/magenta_placenta • Nov 15 '18
Vue 3.0 Updates
https://docs.google.com/presentation/d/1yhPGyhQrJcpJI2ZFvBme3pGKaGNiLi709c37svivv0o/preview#slide=id.p28
u/gin_and_toxic Nov 16 '18
Any video of the talk yet? I can't find it on youtube
1
u/jomogalla Nov 19 '18 edited Nov 19 '18
I believe they didn't record the talks from the first day of the conference :(
(edit) here's the slides tho: https://docs.google.com/presentation/d/1yhPGyhQrJcpJI2ZFvBme3pGKaGNiLi709c37svivv0o/edit#slide=id.p
8
21
u/ddrjm Nov 16 '18
This may seem like a rant or off-topic, but why the heck is everyone switching to typescript for everything now?
46
Nov 16 '18
Benefits on big projects are too good to ignore.
Software written with TypeScript is just generally easier to support and it's especially easier to go back to functions written months or years ago as the code is somewhat self documenting.
On most smaller projects differences aren't profound enough to warrant writing stricter and more verbose code.
23
u/madcaesar Nov 16 '18
People will kill me for this, but I think typescript removes the need to write a bunch of simple tests.
3
u/vivab0rg Nov 16 '18
Please elaborate.
18
Nov 16 '18 edited Aug 05 '23
"The Death of the Author" (French: La mort de l'auteur) is a 1967 essay by the French literary critic and theorist Roland Barthes (1915–1980). Barthes's essay argues against traditional literary criticism's practice of relying on the intentions and biography of an author to definitively explain the "ultimate meaning" of a text.
5
u/Baryn Nov 16 '18
In addition to other reasons people have mentioned, it's because everyone switched to VS Code, which, naturally, has amazing TypeScript integration.
23
5
u/bheklilr Nov 16 '18
Types inherently make things safer. You also get really nice intellisense, especially if you can work with some of the more advanced type features. It comes with essentially no runtime cost, can be automatically converted to human readable Javascript if you want to abandon typescript, and has excellent tooling. It can be easier to write code in typescript because it holds your hand, without getting in the way. It's like bumper guards in bowling. It may look a little silly, but you no longer have to worry about gutter balls (type errors).
-13
Nov 16 '18
Types inherently make things safer.
Not true, it's staticly typed, not strongly, which means that as soon as you have a production bundle all bets are off.
It can be easier to write code in typescript because it holds your hand, without getting in the way.
How can it hold your hand? It's like saying french is easy to learn cause it will hold your hand, it means nothing.
Typescript is dangerous cause it advocates a false sense of security
7
u/bheklilr Nov 16 '18
Not true, it's staticly typed, not strongly, which means that as soon as you have a production bundle all bets are off.
It's true that the runtime code is not strongly typed, but at some level no code really is. That's also saying that because a tool only helps some, you shouldn't use it at all and have no help.
It can be easier to write code in typescript because it holds your hand, without getting in the way.
How can it hold your hand? It's like saying french is easy to learn cause it will hold your hand, it means nothing.
I don't think your point makes much sense... But it holds you hand with the type system. You don't get random type errors at runtime (often, anyway). You don't have nearly as many issues once the code compiles.
Typescript is dangerous cause it advocates a false sense of security
No, not really. I've still run into runtime errors in my code. I still code cautiously, but I can do it more confidently and with more IDE help than I could otherwise.
1
u/geordano Nov 17 '18
dynamic typing vs static typing, for one, the benefit is quite evident when it comes to larger projects.
1
12
u/Buckwheat469 Nov 16 '18
I see it's moving to Typescript, which is exciting. What was the reason to move from Flow to Typescript? Anyone know?
30
u/LynusBorg Nov 16 '18
The decision makers sense for us because flow isn't really used in the Vue ecosystem.
We receive hardly any feedback asking for flow typings etc, while typescript support is in high demand.
In my opinion this reflects the trend in the JavaScript ecosystem as whole: many more packages have Typescript typings than have flow typings, and from my subjective experience, many more projects are written in TS than in Flow.
So when we decided that Vue 3 needed first-class Typescript support, doing the rewrite itself in TS was the obvious choice
2
u/Buckwheat469 Nov 16 '18 edited Nov 16 '18
Nice to hear. How long did the rewrite take if you don't mind me asking? Was it difficult?
2
u/LynusBorg Nov 18 '18
I can tell you when we are done :D
So far we have a prototype that's working well but isn't feature-complete, some important things are still missing.
So far it has been a joy for the people that worked on it (I didn't so far) from what I have heard. Typescript was a big help, plus being able to use ES6 as a supported baseline was quite liberating. Plus we had learned a lot of lessons from Vue 2.0, so the things to make better this time around came naturally.
2
u/Buckwheat469 Nov 18 '18
Thanks for the reply. It'd be great to have a follow-up when it's done. Maybe a blog article about the process, difficulties, feelings from the developers, and time involved. I've seen a ton of articles about moving to Typescript but few talk about the time involved and other concerns. It'd be great to hear from a fairly large project because it could guide decisions in large corporations that require examples for cost/benefit analysis.
2
u/HIMISOCOOL Nov 18 '18
yeah it would also be awesome to hear which patterns stuck, and how it was configured.
1
u/LynusBorg Nov 20 '18
Well, it's not so much a move, since Vue 3 will be a coplete re-write from scratch.
So we started with a blank slate and chose a different typing syste, this time.
Plus we also have a lot of team members that already worked with typescript a lot, while most had little experience with Flow, which we used for Vue 2.
But yeah, we will most probably do such a writeup.
5
u/ParasympatheticBear Nov 16 '18
That’s the most exciting aspect to me. Typescript is a revolution for front end development.
4
1
u/karatetoes May 12 '19
I think what would have helped with the slides imo would be some before and Afters on the slides they're describing the new speed optimizations so I can understand better HOW these are improvements
59
u/avenp Nov 15 '18
Neat. Those performance gains look awesome and improved hints and logging will be great. I wonder why they are going more towards React like APIs like renderTriggered and hooks though. Part of the reason I love Vue is because it _isn't_ React.