Skip to content

Commit

Permalink
lucide-vue Deprecation warning (#1663)
Browse files Browse the repository at this point in the history
* Add Vue deprecation warning

* Add deprecation warning docs page

* Fix typo

* Update warning text
  • Loading branch information
ericfennis authored Nov 24, 2023
1 parent 149ee36 commit e77959e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/guide/packages/lucide-vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Implementation of the lucide icon library for Vue applications.

::: warning
This package will be deprecated end of 2023. Vue v2 will be EOF at the end of 2023 See [Announcement](https://v2.vuejs.org/lts/). We recommend to migrate to Vue 3.
The Lucide Vue package will be only maintained for Vue 3 after the deprecation.
:::

## Vue 2 or Vue 3

::: tip
Expand Down
9 changes: 9 additions & 0 deletions packages/lucide-vue/src/createVueComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Component } from 'vue';
import { Vue, VueConfiguration } from 'vue/types/vue';
import defaultAttributes from './defaultAttributes';

var showDeprecationWarning = true;

type IconNode = [elementName: string, attrs: Record<string, string>][]

/**
Expand Down Expand Up @@ -47,6 +49,13 @@ export default (iconName: string, iconNode: IconNode): Component => ({
children = [],
},
) {
if (showDeprecationWarning) {
console.warn(
'[Lucide Vue] This package will be deprecated end of 2023. Please upgrade to Vue 3 and use the latest lucide package for Vue.',
);
showDeprecationWarning = false;
}

return createElement(
'svg',
{
Expand Down

0 comments on commit e77959e

Please sign in to comment.