[HN Gopher] Vue 3 as the New Default ___________________________________________________________________ Vue 3 as the New Default Author : tosh Score : 80 points Date : 2022-02-07 21:03 UTC (1 hours ago) (HTM) web link (blog.vuejs.org) (TXT) w3m dump (blog.vuejs.org) | tambourine_man wrote: | >From a Library to a Framework | | What I liked about Vue was that it was a simple view library. | Yeah, there it goes. | | There seems to be a hatred towards simple tools in our generation | that I can't fathom | npunt wrote: | Good news! I hope the focus can shift to the ecosystem now. Two | friends of mine have big projects that are stuck on Vue 2 because | of Vuefire. | ramesh31 wrote: | I've got a real sour taste in my mouth over Vue. React is the | industry standard, and it's what the overwhelming majority of | libraries, frameworks, documentation, and tooling around front | end web development is geared towards supporting. People use | React because it's the right tool for the job, and they have no | real strong opinions about it either way. | | But people use Vue for ideological reasons. For some opinionated | reason or another, they take issue with using a framework created | by Facebook or they have some silly little nitpick about a | particular detail of the API. And my company is now full of these | "loud minority" ideologues that have successfully lobbied the | entire engineering organization against React. Now we're | rewriting perfectly functional software to be more "standardized" | with the rest of the company in Vue. It's insanity. | DaiPlusPlus wrote: | Some day, eventually, after all the dust settles in the JS | ecosystem, there will be a stable framework for managing UI state | in a sane, sensible, predictable and well-understood manner - and | someone at the WHATWG/W3C will _finally_ write up a spec and the | functionality will be baked-into Chrome, Edge, Firefox, etc. | | And we'll be free from having to learn a new JS framework every 6 | months. And maybe even npm hell too. | | Until then, time to buy another Pluralsign training course... | turndown wrote: | What do you think of htmx[0]? It feels like something that | could actually fit into the HTML standard. | | 0: https://htmx.org/ | irrational wrote: | This is me. I really don't like using frameworks/libraries and | want it to get baked into the standard library. | whalesalad wrote: | I use Vue 3 without the new composition api. It looks and feels | more or less like the old Vue. | | I actually think things are pretty great these days. Even | amongst the different frameworks and tools, things are settling | into a common set of ideas and concepts. | | If you made the choice to build an app on React/Vue a year or | two ago, that decision is still valid today and I think that | speaks a lot for how far things have come. | themacguffinman wrote: | Why are people so obsessed with finding one true way to do | everything until the end of time. Things change, things become | more diverse, and the world is richer for it. There already are | sane, sensible, predictable and well-understood frameworks for | it, it's called Vue, it's called React, etc. You don't need a | committee to bless it before you can enjoy such a stable | environment. _It 's your choice_ to learn a new JS framework | every 6 months. | | Just make something valuable and use what suits your needs. | That's all that has ever mattered. | slig wrote: | And then it will become "old", exactly like Django/Rails feels | today and the wheel will be reinvented with something "better" | and more complex. | nikanj wrote: | Meanwhile my Swing skills from the 1990s remain relevant today. | Java might not be hip, but it sure does get the job done for | enterprise apps | topicseed wrote: | NPM hell is what got me to move from beloved TypeScript to | Golang. Coming back to pet projects a few months later was true | excruciating pain every single time. | | Today, it's Go in the backend and Svelte in the frontend, or | vanilla JS for very small and simple tools. | jrib wrote: | are you leveraging a framework on the backend for Go? | ashishb wrote: | As someone who programs on backend, frontend, and Android | apps, I can't agree more. Javascript frameworks and NPM hell | is terrible. You rarely have the problems in Go/Kotlin/Java | world that are considered normal in the NPM world. | powersurge360 wrote: | I have been _very_ bullish and excited on LiveView and its | cousins from other platforms. Hotwire was the first time it's | entered my personal dev world and I've been working on a hobby | trivia app since Christmas and it has been an absolute _joy_. | | It's obviously not a one to one replacement for an honest to | god frontend application, especially one that can be recompiled | into an offline capable native app, but where you can use it, | it does a lot of lifting. | root_axis wrote: | This comment is just low-effort complaining that we see on | every JS thread on this site. Vue 3 is an option you don't have | to use, same as React, Svelte or just jQuery. The implied | suggestion that nobody should ever publish new code is tiring. | DaiPlusPlus wrote: | Yes, that was half of my post - but the first half is my hope | that eventually the functionality from React/Vue will be | built-in to the DOM (or at least baked-in to the browser). | We're already half-way there with WebComponents (though I'm | not a fan of WebComponents as-is, but that's a tangent). | | Also, I still believe that web-pages should be functional | without JavaScript. For all of my traditional SSR / non-SPA | projects I definitely put effort into ensuring my projects | exhibit graceful degradation. | | There's already a lot of things we can do without any | scripting at all: animations and dynamic content, for example | - and we can even use CSS trigger-tricks for basic | interactivity (e.g. show/hide toggles) all without scripting. | What I'd love to see next is something like WPF/XAML's | declarative data-binding in HTML (but in a less broken | way...) - and I'd like to be able to submit a <form> element | directly as JSON, as well as AJAX-like <form> submissions | that don't replace the current document, all without | scripting - that's the dream (oh, and CSS positioning | relative to an arbitrary named element, I could go on...). | arnvald wrote: | Is is really that bad? | | I'm not very up-to-date with JS frameworks, so please bear with | me. I know that new libraries pop up here and there, but if I'm | not wrong, React is by far the most popular, and React has been | around for almost 10 years. Vue's not much younger, and now | it's 3rd major version. | | Is there such a big difference between JS front-end frameworks | and the rest of the world? | svachalek wrote: | Things were really a mess for a while, maybe 6-7 years ago. | Nothing was compatible with anything else, even itself from | last month. But nowadays things are pretty stable, if you | stay away from the hotness of the month which will be | forgotten next month. | bussyfumes wrote: | I think it's a bit of an outdated stereotype from back in the | day when this kind of frameworks started popping up left and | right. It was a major shift from jquery-based sites/apps | which scared many people away from diving deeper into front | end. Nowadays you can stick to one of the major three and | you'll be fine for the foreseeable future. This new Vue | version is the most disruptive change we've had since a long | time ago in the fe framework space and it's still ok to get | used to. | FinalBriefing wrote: | Yea, most of my Vue 3 components look just like my Vue 2 | components (which look a lot like Vue 1 components). Really | easy transition for devs. | qbasic_forever wrote: | I think a lot of people got a bad taste from webpack, gulp, | etc. projects ~5 years ago that immediately mired you in deep | config complexity to do anything. Nowadays there's a lot more | documentation and emphasis on zero config / convention / CLI | tooling to remove a lot of that complexity. Things are a lot | better nowadays, especially if you're doing something | greenfield and can use the latest tooling like vite, esbuild, | etc. | e12e wrote: | >... especially if you're doing something greenfield and | can use the latest tooling like vite, esbuild, etc. | | Well, kinda? I tried to set up typescript, storyboard and | tailwind the other day, via create-react-app - and it's not | really clear if I can/should use npm or yarn, and what, if | any bundles like webpack or esbuild/craco I need... Nor did | any of the documentation/tutorials "just work" - and as | final punishment I think I had to download more than a gig | of dependencies. | | I get that there are many layers of tooling, but when I | can't seem to get half the features of qt, nor a gui for | 4gl development - it does seem like there's a lot of churn | and pain for limited gain. | [deleted] | grayrest wrote: | The ecosystem largely settled out in 2014 when everybody was | "javascript fatigue" complaining. The developments since have | mostly been refinements on details of the development setup | or state management. There's new stuff but I'm pretty sure | anybody who wrote React at the time would be comfortable with | the slight modifications in the patterns of how things fit | together. | | We're kind of into the next generation of frameworks (Solid, | Svelte 3, Vue 3) and that's more about how much JS is getting | delivered to the client. The current area of exploration is | "partial hydration" where the goal is to write stuff using | the component model but do server rendering and only send JS | for the parts of the page that'll change client side. For | quite a few classes of application this would substantially | reduce the size of JS over the wire. All this is less of a | benefit than the state control React brought so I expect | slower/partial adoption. | | More broadly, there's been a resurgence of the render | everything on the server and send html diffs approach in the | form of alpine and htmx. The other potential area for change | on the horizon is web assembly getting host bindings support | so it doesn't have to bridge through JS to affect the DOM and | other browser APIs. | EMM_386 wrote: | > Is is really that bad? | | It's not that bad. I am lead on a large Angular 13 project | and we love it, easy to work with, build, deploy. We have | literally no issues at the moment. .Net 6 C# APIs on the | back-end, Oracle database. It just works. | | Take everything with a grain of salt. | oblio wrote: | How is internationalization? | | Last I asked, it was still a tire fire, even after more | than a dozen versions and after a fully mature previous | framework that was replaced :-( | FinalBriefing wrote: | Yea...Angular made a huge (and hardly documented) change | to their internationalization library that forced us to | migrate to a third-party one. | | Basically, they now (as of Angular 12) force you to build | a difference version of your app for each language you | support, and either serve them up at different URLs or | use cookies to serve up the right version to each user. | The technical reasons make sense...your translations | occur at build-time, rather than at run-time, but it's a | pretty drastic change that occurred out of nowhere. | | Not a fan. | Alex3917 wrote: | I feel the same way about Angular. There some minor bugs | that have had open issues for 5+ years and may well never | get fixed, but by and large the day-to-day experience of | writing and maintaining code is pretty great. | | I just don't get the concept of people being like, I'm | going to start a project that's likely going to take the | ten years to become successful, but I'm not willing to | spend the twenty hours to read the documentation so that it | will be successful. | dham wrote: | It's already invented. It's called HTML. You then use whatever | language you want to generate it. We were doing it a long time | ago with Java Server Faces. Now there's stuff like Liveview and | Turbo (Rails community) | visarga wrote: | That's how great humans are at generalization, just 10 years of | collective search and we reached the web UI enlightenment. /s | lmarcos wrote: | I don't think that's gonna happen. The same way modern | browser's don't come with a java runtime to run servlets. | | Something better (and different) will come after SPAs, and the | cycle will start again. | DaiPlusPlus wrote: | > The same way modern browser's don't come with a java | runtime to run servlets. | | Servlets run on the server, I think you meant applets? If so, | I'd argue a counter-point: WASM and <canvas>. | ioseph wrote: | What new framework is being widely adopted that was released in | the last 6 months? The most recent one I can think of is Svelte | which came out 2016. | randomsearch wrote: | Worth noting that major frameworks have yet to update for Vue 3. | Make sure you check all your dependencies before embarking on | that course. I like Vue 3 so am finding this seemingly slow | adoption to be a real pain. | FinalBriefing wrote: | Hopefully now that it is the default, more UI libraries will | focus their efforts on it. | spuzvabob wrote: | If you are considering upgrading from Vue 2 with Vuex note that | store getters caching is not working in Vuex for Vue 3, | potentially hindering performance significantly. | | The issue was reported multiple times but it's not yet fixed: | https://github.com/vuejs/vuex/issues/2102 | https://github.com/vuejs/vuex/pull/1883 | FinalBriefing wrote: | Still! That's surprising. | greencore wrote: | Vue 3 perhaps is ready but not its ecosystem. Important libraries | (like form management) port to v3 is still in alpha. It was one | of the most painful development experiences because of that. | The_rationalist wrote: | newsbinator wrote: | I can't use Vue 3 in production until Vuetify is close to ready | (which it's currently not). | bussyfumes wrote: | This is great news, Vue 3 looks much better than its predecessor. | | However, I had to migrate a Vue 2 + TS app to Vue 3 and their | guide at the time was pretty underwhelming. Props to Evan for | dedicating time to migrate a sample app and publish the migration | as commits, but the app was quite basic and dependency-free so I | had to figure out a lot of stuff on the go. The compatibility | build actually slowed down my progress as it took me a lot to | figure out that I didn't actually benefit much from it and could | just drop it. Till this day I don't have a clear idea about what | @vue/compat is for. | | Hopefully, with them pushing Vue 3 as the new default, there will | be more detailed how-tos available. | FinalBriefing wrote: | That's been my experience, as well. I got everything working | because I'm very familiar with Vue, but I did end up removing a | lot of TypeScript from my app just to make it all easier. | Luckily, Vue makes it easy to mix and match JS and TS (for | better or for worse). | hendry wrote: | I was dumb enough to use https://unpkg.com/vue on my projects and | now I have to deal with "Uncaught TypeError: Vue is not a | constructor" this morning. | numbsafari wrote: | Folks shouldn't use unpkg.com. | | The only relevant discussion you can find regarding a privacy | policy is a twitter thread that ends with the developer saying | "I really should discourage adoption because it's getting too | big." | | No dig on them, but, really... at some point we need to start | doing a better job of owning this stuff. | tosh wrote: | Same here, this is how I found out about Vue 3 | | related: The mess we're in (a talk by Joe Armstrong) | | https://www.youtube.com/watch?v=lKXe3HUG2l4 | | (yes, I know, I should have vendored the dependency in the | first place) | phil-martin wrote: | Same here, I wonder how many apps around the world silently | stopped working today. | | It was my own fault for not self hosting or not pinning the | version, but it was still a surprise! | ramesh31 wrote: | Can someone make a convincing argument for me to adopt Vue that | doesn't involve "it isn't React"? | Rodeoclash wrote: | I've used both extensively now. Out of the two I prefer React. | I'd describe Vue as more bells and whistles, less safeguards. I | think developers prefer Vue because it doesn't get in your way | like React does (despite React having very good reasons for | getting your way!) | The_rationalist wrote: | dham wrote: | It's more sane. It does fine grained updates without having to | manually optimize like in React - | useCallback/useMemo/React.memo/splitting components. Think of a | list view where you want to update a single item in a list. | | People generally understand Vue better because you can just | push to an array and it reacts to it properly without having to | commit to the React immutable data religion. | | Basically if you were to competently build a framework you | would have Vue, if you were trying to impress your colleagues | and bring up bullshit comp sci principals so you can write 50x | more lines of code while spending 100 hours trying to optimize | a list re render, you would have React. | keithnz wrote: | I recommend looking at Vitesse :- | https://github.com/antfu/vitesse | | Even if you don't like the exact setup , you can customize it to | your liking (and there are a number of forks that do exactly | that), but it puts together quite a few things that you often | want as an "out of the box" experience. | jmull3n wrote: | Thank you, I was looking for something exactly like this | yesterday. How does it compare to Nuxt 3? | FinalBriefing wrote: | Different tools, I think. Nuxt is like a framework for your | framework. vitesse looks like it is just a template to start | any Vue 3 project with. | FinalBriefing wrote: | Thanks! I like having these to compare my projects to. | jackconsidine wrote: | I get the impression that Vue 3 was a greater effort than | expected. It was talked about for years before beta release (on | Full Stack Radio, for example). March of 2020, I was at Vue Conf | (days before Covid lockdowns began), and I heard a few people | complaining that this wasn't the expected official Vue 3 release. | Here we are almost two years after that and it's _just_ becoming | the default. | | That said, I understand that there were monumental under-the-hood | improvements, some of which spawned off Vite. | FinalBriefing wrote: | I'm surprised, too. I'm happy they took their time as Vue 2 | was/is still a great framework, but I probably would have | chosen Vue 2 for some projects had I known it would take this | long to get Vue 3 out the door. ___________________________________________________________________ (page generated 2022-02-07 23:00 UTC)