From e77959e1a6fa8fabb6299921c4c3a4c098daef46 Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Fri, 24 Nov 2023 08:14:47 +0100 Subject: [PATCH] `lucide-vue` Deprecation warning (#1663) * Add Vue deprecation warning * Add deprecation warning docs page * Fix typo * Update warning text --- docs/guide/packages/lucide-vue.md | 5 +++++ packages/lucide-vue/src/createVueComponent.ts | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/docs/guide/packages/lucide-vue.md b/docs/guide/packages/lucide-vue.md index aaa9892d4e..efdc8f42aa 100644 --- a/docs/guide/packages/lucide-vue.md +++ b/docs/guide/packages/lucide-vue.md @@ -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 diff --git a/packages/lucide-vue/src/createVueComponent.ts b/packages/lucide-vue/src/createVueComponent.ts index e41aaf13dc..0a236d8f74 100644 --- a/packages/lucide-vue/src/createVueComponent.ts +++ b/packages/lucide-vue/src/createVueComponent.ts @@ -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][] /** @@ -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', {