3.49.0 • Published 3 months ago

@vonage/vivid-bindings-vue v3.49.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 months ago

vivid-bindings-vue

Typescript bindings for Vivid 3 web components to be used with VueJS 3

What's in the box(i.e. batteries included):

  • Few lines of code convergent initialization routine for Vivid design system
  • 100% Vivid components covered with bindings
  • ~100% automated process for NPM package generation & release. @vonage/vivid package is the release driver/trigger
  • Enhanced DevEx (VS Code intellisense) + Fully sound Typescript type checking for Vivid web components props/events/slots/cssProps/cssParts/etc. contracts
  • Abstraction layer for easier migration to future major versions of Vivid

How to integrate with VueJs App

Vivid can be initialized as easy as few lines of code

main.ts

import { createApp } from 'vue'
import App from './App.vue'
import { vivid3 } from '@vonage/vivid-bindings-vue'

const app = createApp(App)
app.use(vivid3, {
  font: 'oss',
  theme: 'dark'
})
app.mount('#app')

vite.config.ts

import { isCustomElement } from '@vonage/vivid-bindings-vue'

...

  plugins: [
    vue(
      {
        template: {
          compilerOptions: {
            isCustomElement
          },
        },
      }
    )
  ]

...

How to import components

Each Vivid component should be imported using single import statement. The Vivid major version is a part of the import v3. This enables seamless side by side usage of different major versions in a single project for pay as you go future migration path

<script setup lang="ts">
import { Connotation } from '@vonage/vivid'
import VwcButton from '@vonage/vivid-bindings-vue/v3/VwcButton'
import VwcIcon from '@vonage/vivid-bindings-vue/v3/VwcIcon'

function handleClick(e:PointerEvent) {}
</script>

<template>
  <VwcButton
     iconTrailing
     icon="github-mono"
     @click="handleClick"
     appearance='filled'
     label="I'm a Vivid button" />
  <VwcIcon
     name="key-solid"
     :connotation=Connotation.Alert
     :size=5 />
</template>

Releases

This package has a pipeline workflow which is checking for a new Vivid version on a dayly basis and if it detects that new version is out The new bindings are generated and published automatically, reflecting the same package version @vonage/vivid has. So the release driver is @vonage/vivid package itself.

Repository structure

The entire repository is a pure Typescript code, divided onto two main parts

  • ./src - is the Deno territory, contains the generator code, which is effectively generates the NPM package contents on top of the existing template
  • ./package - is the NPM package template

Rationale

  • Vivid web components since version 3.0 are shipped with the custom elements meta data alongside the code itself. Which allows to employ code generation practice to build near 100% automated typescript type safe bindings for VueJs components
  • Maintenance cost should be linear, it's always one component to be rendered, no matter how many elements there are actually in Vivid design system
  • Adds an abstraction layer to mitigate the custom web components namespacing conflicts issue, to enable usage of several major versions of Vivid components in the single application more info here, and how Salesforce Lightning web components are solving that issue here

Official bindings for Vue 2.x/3.x

https://github.com/Vonage/vivid-vue

3.49.0

3 months ago

3.48.0

3 months ago

3.47.0

3 months ago

3.46.0

4 months ago

3.45.0

4 months ago

3.44.0

5 months ago

3.43.0

5 months ago

3.42.1

5 months ago

3.41.0

6 months ago

3.41.1

6 months ago

3.22.0

10 months ago

3.24.0

10 months ago

3.22.1

10 months ago

3.36.0

8 months ago

3.36.1

8 months ago

3.38.0

7 months ago

3.31.0

9 months ago

3.35.0

8 months ago

3.26.0

10 months ago

3.28.2

9 months ago

3.26.6

10 months ago

3.40.0

6 months ago

3.40.1

6 months ago

3.42.0

5 months ago

3.40.2

6 months ago

3.40.3

6 months ago

3.40.4

6 months ago

3.40.5

6 months ago

3.40.6

6 months ago

3.39.5

7 months ago

3.39.6

7 months ago

3.39.7

7 months ago

3.39.8

6 months ago

3.39.9

6 months ago

3.37.0

7 months ago

3.37.1

7 months ago

3.39.0

7 months ago

3.39.1

7 months ago

3.39.2

7 months ago

3.39.3

7 months ago

3.39.4

7 months ago

3.30.0

9 months ago

3.32.0

9 months ago

3.34.0

8 months ago

3.40.7

6 months ago

3.25.0

10 months ago

3.29.0

9 months ago

3.20.5

11 months ago

3.20.0

11 months ago

3.13.0

12 months ago

3.12.0

12 months ago

3.15.0

11 months ago

3.14.0

11 months ago

3.17.0

11 months ago

3.16.1

11 months ago

3.14.3

11 months ago

3.19.0

11 months ago

3.18.1

11 months ago

3.18.0

11 months ago

3.11.0

1 year ago

3.10.0

1 year ago

3.9.0

1 year ago

3.8.0

1 year ago

3.7.0

1 year ago

3.6.0

1 year ago

3.4.0

1 year ago

3.3.0

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago