Building Backwards Compatible Vue Libraries

Rate this content
Bookmark
The video discusses the challenges of migrating from Vue 2 to Vue 3, with a focus on maintaining compatibility across different versions. It introduces the Stencil compiler, which helps in building framework-agnostic web components. The speaker explains the 'Petite' project structure, designed to aid component library authors in managing code compatible with multiple Vue versions. A monorepo setup is recommended for handling source code and configurations, utilizing sim-links for shared components. The talk also touches on the FDA's requirements for repository structure in med tech companies, emphasizing the need for robust testing strategies to ensure component compatibility. Vue 3's upcoming end-of-life in December 2023 is highlighted, urging developers to plan for future updates and migrations.

From Author:

Many organizations with component libraries are working on upgrades for their Vue 2 apps so that they can support Vue 3. Sometimes it's not easy! Ideally, you could write your code once and cross-compile it for different Vue runtimes. In this talk, we'll do exactly that. At the end, you'll have a recipe for shipping libraries that support both Vue 2 and Vue 3.

This talk has been presented at Vue.js London 2023, check out the latest edition of this Tech Conference.

FAQ

The main challenge discussed is the migration from Vue 2 to Vue 3, particularly in complex environments with multiple teams and products, each having different release cycles, which complicates maintaining compatibility across versions.

The Stencil compiler allows for the creation of web components that are framework-agnostic, enabling different teams to use Angular, React, or Vue while the design system team works with a meta language, facilitating easier maintenance and integration across frameworks.

The 'Petite' project structure is designed for component library authors to help manage and develop code that is compatible with multiple versions of a framework, specifically aimed at easing the transition between different major versions like Vue 2 and Vue 3.

The strategy involves using a monorepo setup to manage source code and configurations, leveraging sim-links for shared components, and employing robust build and test tooling to ensure components work consistently across multiple Vue versions.

Vue 3 is approaching end-of-life in December 2023, which poses challenges for developers and organizations in terms of planning for security patches and updates, as well as migration to newer versions or different frameworks.

The FDA requires med tech companies in the US to delineate different requirements by repository, affecting how code and tests are organized and reviewed, often leading to complex repo structures with multiple compilation steps using different tools.

Jessica Sachs
Jessica Sachs
31 min
12 May, 2023

Comments

Sign in or register to post your comment.

Video Transcription

1. Introduction to Vue and My Experience

Short description:

Hello, good morning. How many people use Vue in production? How many people are tired? Next talk is cool. I tailor my talks to the people in the room. I was building a library. How many people are in a Vue 2 to 3 migration? My case is the worst case. Are we building apps or libraries? This talk, we're going to change gears. A little bit about me.

♪♪♪ Hello, hello, hello, hello. All right, good morning. I mean afternoon. How... All right, we're going to do the hands thing. So get ready. Get your hands ready. How many people use Vue here in production? There we go. And this is to make sure you're awake. How many people are tired? Yeah, it's been long. Me, too. But I'm excited because the next talk, after mine, is really friggin' cool. So let's do mine. I tailor my talks to the people in the room. So when I originally wrote this talk, I wrote it because I was building a library. I was building a component design system. Hands. All right, I get hands. How many people are in a Vue 2 to 3 migration? Yeah. Yeah. Is it fun? No. Yeah? Yeah, no, it sucks. So my case is I think actually the worst case of a Vue 2 to 3 migration. And I'll show you my repo structure in a hot second. Are people building apps? Are we building apps or libraries? Shout it. Apps, all right. So this talk, we're going to change gears from what I planned. These were the questions I planned to ask. So a little bit about me. I had a really good introduction.

2. Working at Ionic on Stencil Compiler

Short description:

I work full time in open source at Ionic on the Stencil compiler. The Stencil compiler is an agnostic way to build web components and ship them to multiple teams and frameworks. Previously, I worked at Cypress, where I built the component test runner. I have been involved in the View JS ecosystem for several years and now contribute to solid JS. Recently, I transitioned back to user space to address the challenges of View 2 to 3 migrations.

I work full time in open source at Ionic on the Stencil compiler. The Stencil compiler is supposed to be an agnostic way that you can build web components, TLDR, build web components. And then ship to multiple different teams, different frameworks. Sounds cool. So team A, B, C, and D can all write Angular, React, and View. And the design system team doesn't have to care, they can write in this little meta language. That's what Stencil does.

I've been there like four weeks. So that's all I got. Previously I worked at Cypress. I worked in open source. Have people used Cypress? Shout it. Woo! Yeah, woo. And I built the component test runner. Also did the faker JS core thing. And I've been around the View JS ecosystem for a hot second, three, four years. And I'm now a solid JS contributor. I love Reactivity. So that's me.

And then I did a brief stint in user space again. So I went from Cypress for two and a half years in open source full time to Path AI in Boston. Actually in Cambridge. I call it fake Cambridge, because I'm from the US. And you guys might all be from here. So in user space, as I call it, building apps is different. And I felt like I wanted to reconnect. I wanted to reconnect after being in open source for so long. I was like, what are the real problems people face? And the answer is, View 2 to 3 migrations. I joined in July 2022. And I've spent most of that time, up until the last four weeks, in user space, trying to migrate from View 2 to 3.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Everything Beyond State Management in Stores with Pinia
Vue.js London Live 2021Vue.js London Live 2021
34 min
Everything Beyond State Management in Stores with Pinia
Top Content
State management is not limited to complex applications and transitioning to a store offers significant benefits. Pinia is a centralized state management solution compatible with Vue 2 and Vue 3, providing advanced devtools support and extensibility with plugins. The core API of Pinia is similar to Vuex, but with a less verbose version of stores and powerful plugins. Pinia allows for easy state inspection, error handling, and testing. It is recommended to create one file per store for better organization and Pinia offers a more efficient performance compared to V-rex.
Welcome to Nuxt 3
Vue.js London Live 2021Vue.js London Live 2021
29 min
Welcome to Nuxt 3
Top Content
Nux3 has made significant improvements in performance, output optimization, and serverless support. Nuxt Bridge brings the Nitro engine for enhanced performance and easier transition between Nuxt 2 and Nuxt Read. Nuxt 3 supports Webpack 5, Bytes, and Vue 3. NextLab has developed brand new websites using Docus technology. Nuxt.js is recommended for building apps faster and simpler, and Nuxt 2 should be used before migrating to Nuxt 3 for stability. DOCUS is a new project that combines Nuxt with additional features like content modules and an admin panel.
One Year Into Vue 3
Vue.js London Live 2021Vue.js London Live 2021
20 min
One Year Into Vue 3
Top Content
Vue 3 has seen significant adoption and improvements in performance, bundle size, architecture, and TypeScript integration. The ecosystem around Vue 3 is catching up, with new tools and frameworks being developed. The Vue.js.org documentation is undergoing a complete overhaul. PNIA is emerging as the go-to state management solution for Vue 3. The options API and composition API are both viable options in Vue 3, with the choice depending on factors such as complexity and familiarity with TypeScript. Vue 3 continues to support CDN installation and is recommended for new projects.
Utilising Rust from Vue with WebAssembly
Vue.js London Live 2021Vue.js London Live 2021
8 min
Utilising Rust from Vue with WebAssembly
Top Content
In this Talk, the speaker demonstrates how to use Rust with WebAssembly in a Vue.js project. They explain that WebAssembly is a binary format that allows for high-performance code and less memory usage in the browser. The speaker shows how to build a Rust example using the WasmPack tool and integrate it into a Vue template. They also demonstrate how to call Rust code from a Vue component and deploy the resulting package to npm for easy sharing and consumption.
Vue: Feature Updates
Vue.js London 2023Vue.js London 2023
44 min
Vue: Feature Updates
Top Content
The Talk discusses the recent feature updates in Vue 3.3, focusing on script setup and TypeScript support. It covers improvements in defining props using imported types and complex types support. The introduction of generic components and reworked signatures for defined components provides more flexibility and better type support. Other features include automatic inference of runtime props, improved define emits and defined slots, and experimental features like reactive props destructure and define model. The Talk also mentions future plans for Vue, including stabilizing suspense and enhancing computer invalidations.
Local State and Server Cache: Finding a Balance
Vue.js London Live 2021Vue.js London Live 2021
24 min
Local State and Server Cache: Finding a Balance
Top Content
This Talk discusses handling local state in software development, particularly when dealing with asynchronous behavior and API requests. It explores the challenges of managing global state and the need for actions when handling server data. The Talk also highlights the issue of fetching data not in Vuex and the challenges of keeping data up-to-date in Vuex. It mentions alternative tools like Apollo Client and React Query for handling local state. The Talk concludes with a discussion on GitLab going public and the celebration that followed.

Workshops on related topic

Vue3: Modern Frontend App Development
Vue.js London Live 2021Vue.js London Live 2021
169 min
Vue3: Modern Frontend App Development
Top Content
Featured WorkshopFree
Mikhail Kuznetcov
Mikhail Kuznetcov
The Vue3 has been released in mid-2020. Besides many improvements and optimizations, the main feature of Vue3 brings is the Composition API – a new way to write and reuse reactive code. Let's learn more about how to use Composition API efficiently.

Besides core Vue3 features we'll explain examples of how to use popular libraries with Vue3.

Table of contents:
- Introduction to Vue3
- Composition API
- Core libraries
- Vue3 ecosystem

Prerequisites:
IDE of choice (Inellij or VSC) installed
Nodejs + NPM
Using Nitro – Building an App with the Latest Nuxt Rendering Engine
Vue.js London Live 2021Vue.js London Live 2021
117 min
Using Nitro – Building an App with the Latest Nuxt Rendering Engine
Top Content
Workshop
Daniel Roe
Daniel Roe
We'll build a Nuxt project together from scratch using Nitro, the new Nuxt rendering engine, and Nuxt Bridge. We'll explore some of the ways that you can use and deploy Nitro, whilst building a application together with some of the real-world constraints you'd face when deploying an app for your enterprise. Along the way, fire your questions at me and I'll do my best to answer them.
Monitoring 101 for React Developers
React Summit US 2023React Summit US 2023
107 min
Monitoring 101 for React Developers
Top Content
WorkshopFree
Lazar Nikolov
Sarah Guthals
2 authors
If finding errors in your frontend project is like searching for a needle in a code haystack, then Sentry error monitoring can be your metal detector. Learn the basics of error monitoring with Sentry. Whether you are running a React, Angular, Vue, or just “vanilla” JavaScript, see how Sentry can help you find the who, what, when and where behind errors in your frontend project. 
Workshop level: Intermediate
Going on an adventure with Nuxt 3, Motion UI and Azure
JSNation 2022JSNation 2022
141 min
Going on an adventure with Nuxt 3, Motion UI and Azure
WorkshopFree
Melanie de Leeuw
Melanie de Leeuw
We love easily created and deployed web applications! So, let’s see what a very current tech stack like Nuxt 3, Motion UI and Azure Static Web Apps can do for us. It could very well be a golden trio in modern day web development. Or it could be a fire pit of bugs and errors. Either way it will be a learning adventure for us all. Nuxt 3 has been released just a few months ago, and we cannot wait any longer to explore its new features like its acceptance of Vue 3 and the Nitro Engine. We add a bit of pizzazz to our application with the Sass library Motion UI, because static design is out, and animations are in again.Our driving power of the stack will be Azure. Azure static web apps are new, close to production and a nifty and quick way for developers to deploy their websites. So of course, we must try this out.With some sprinkled Azure Functions on top, we will explore what web development in 2022 can do.
TresJS create 3D experiences declaratively with Vue Components
Vue.js London 2023Vue.js London 2023
137 min
TresJS create 3D experiences declaratively with Vue Components
Workshop
Alvaro Saburido
Alvaro Saburido
- Intro 3D - Intro WebGL- ThreeJS- Why TresJS- Installation or Stackblitz setup - Core Basics- Setting up the Canvas- Scene- Camera- Adding an object- Geometries- Arguments- Props- Slots- The Loop- UseRenderLoop composable- Before and After rendering callbacks- Basic Animations- Materials- Basic Material- Normal Material- Toon Material- Lambert Material- Standard and Physical Material- Metalness, roughness - Lights- AmbientLight- DirectionalLight- PointLights- Shadows- Textures- Loading textures with useTextures- Tips and tricks- Misc- Orbit Controls- Loading models with Cientos- Debugging your scene- Performance
Building Vue forms with VeeValidate
Vue.js London Live 2021Vue.js London Live 2021
176 min
Building Vue forms with VeeValidate
Workshop
Abdelrahman Awad
Abdelrahman Awad
In this workshop, you will learn how to use vee-validate to handle form validation, manage form values and handle submissions effectively. We will start from the basics with a simple login form all the way to using the composition API and building repeatable and multistep forms.

Table of contents:
- Introduction to vee-validate
- Building a basic form with vee-validate components
- Handling validation and form submissions
- Building validatable input components with the composition API
- Field Arrays and repeatable inputs
- Building a multistep form
Prerequisites:
VSCode setup and an empty Vite + Vue project.