Skip to content

Commit 60cd60b

Browse files
authored
Vue clean-ups / Drop support for Vue 2 (#502)
Vue Clean-ups / Drop support for Vue 2
1 parent 1ac85cc commit 60cd60b

File tree

15 files changed

+241
-319
lines changed

15 files changed

+241
-319
lines changed

bin/build/targets/vue/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,9 @@ export default async (ctx, target) => {
8484
formats: ['cjs', 'es'],
8585
},
8686
rollupOptions: {
87-
external: ['vue-demi', 'vue'],
87+
external: ['vue'],
8888
},
8989
},
90-
optimizeDeps: {
91-
exclude: ['vue-demi'],
92-
},
9390
plugins: [
9491
vue({
9592
isProduction: true,

bin/build/targets/vue/template.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
function template(svg) {
22
return `<script lang="ts">
3-
import { defineComponent, inject } from "vue-demi";
4-
import type { SVGAttributes } from "vue-demi";
5-
import providerKey from "../providerKey";
3+
import type { SVGAttributes } from 'vue';
4+
import { defineComponent, inject } from 'vue';
5+
import providerKey from '../providerKey';
66
7-
export default defineComponent<SVGAttributes>(() => {
8-
const context = inject(providerKey);
9-
return { context };
7+
export default defineComponent<SVGAttributes>({
8+
setup() {
9+
const context = inject(providerKey);
10+
return { context };
11+
},
1012
});
1113
</script>
1214

examples/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"lint": "next lint"
99
},
1010
"dependencies": {
11-
"next": "15.1.1",
11+
"next": "15.1.2",
1212
"react": "^19.0.0",
1313
"react-dom": "^19.0.0"
1414
},

examples/vue/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
"devDependencies": {
1616
"@iconoir/vue": "workspace:*",
1717
"@tsconfig/node22": "^22.0.0",
18-
"@types/node": "^22.9.3",
18+
"@types/node": "^22.10.2",
1919
"@vitejs/plugin-vue": "^5.2.1",
2020
"@vue/tsconfig": "^0.7.0",
21-
"npm-run-all2": "^7.0.1",
21+
"npm-run-all2": "^7.0.2",
2222
"typescript": "~5.7.2",
23-
"vite": "^6.0.1",
24-
"vite-plugin-vue-devtools": "^7.6.5",
23+
"vite": "^6.0.4",
24+
"vite-plugin-vue-devtools": "^7.6.8",
2525
"vue-tsc": "^2.1.10"
2626
}
2727
}

examples/vue/src/App.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import {
2121
'height': '2em',
2222
}"
2323
>
24-
<SomeOtherContainer>
25-
<Check />
26-
</SomeOtherContainer>
24+
<Check />
2725
</IconoirProvider>
2826
</template>

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
"semver": "^7.6.3",
5757
"types-tsconfig": "2.1.1",
5858
"typescript": "~5.7.2",
59-
"vite": "^6.0.3",
60-
"vite-plugin-dts": "^4.3.0"
59+
"vite": "^6.0.4",
60+
"vite-plugin-dts": "^4.4.0"
6161
},
6262
"pnpm": {
6363
"packageExtensions": {

packages/iconoir-flutter/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ Default values for the most common props are given below:
5757
| width | "1.5em" |
5858
| height | "1.5em" |
5959

60-
## Icon names
60+
## Icon Names
6161

6262
The Flutter widges are named as PascalCase variations of their reference names (i.e. `airplane-helix-45deg` becomes `AirplaneHelix45deg`).

packages/iconoir-react-native/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ return (
7171
);
7272
```
7373

74-
## Icon names
74+
## Icon Names
7575

7676
The React components are named as PascalCase variations of their reference names (i.e. `airplane-helix-45deg` becomes `AirplaneHelix45deg`).

packages/iconoir-react/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ return (
6565
);
6666
```
6767

68-
## Icon names
68+
## Icon Names
6969

7070
The React components are named as PascalCase variations of their reference names (i.e. `airplane-helix-45deg` becomes `AirplaneHelix45deg`).

packages/iconoir-vue/README.md

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
## Usage
1818

19-
### Vue 3
20-
2119
```html
2220
<script setup>
2321
import { Iconoir } from '@iconoir/vue';
@@ -28,24 +26,6 @@
2826
</template>
2927
```
3028

31-
### Vue 2
32-
33-
```html
34-
<script>
35-
import { Iconoir } from '@iconoir/vue';
36-
37-
export default
38-
components: {
39-
Iconoir
40-
}
41-
}
42-
</script>
43-
44-
<template>
45-
<Iconoir />
46-
</template>
47-
```
48-
4929
### Properties
5030

5131
Icons can take any standard SVG properties as optional props, e.g.
@@ -88,6 +68,6 @@ Tired of specifying the same props for every single icon, every time you use the
8868
</template>
8969
```
9070

91-
## Icon names
71+
## Icon Names
9272

9373
The Vue components are named as PascalCase variations of their reference names (i.e. `airplane-helix-45deg` becomes `AirplaneHelix45deg`).

packages/iconoir-vue/package.json

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
"require": {
3030
"types": "./dist/index.d.ts",
3131
"default": "./dist/index.js"
32-
},
33-
"default": "./dist/index.js"
32+
}
3433
}
3534
},
3635
"main": "./dist/index.js",
@@ -40,18 +39,9 @@
4039
"dist"
4140
],
4241
"peerDependencies": {
43-
"@vue/composition-api": ">=1.0.0-rc.1",
44-
"vue": "^2.6.11 || >=3.0.0"
45-
},
46-
"peerDependenciesMeta": {
47-
"@vue/composition-api": {
48-
"optional": true
49-
}
50-
},
51-
"dependencies": {
52-
"vue-demi": "^0.14.6"
42+
"vue": "3"
5343
},
5444
"devDependencies": {
55-
"vue": "^3.3.12"
45+
"@vue/tsconfig": "^0.7.0"
5646
}
5747
}

packages/iconoir-vue/src/IconoirProvider.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<script setup lang="ts">
2-
import type { SVGAttributes } from 'vue-demi';
3-
import { provide } from 'vue-demi';
2+
import type { SVGAttributes } from 'vue';
3+
import { provide, toRef } from 'vue';
44
import providerKey from './providerKey';
55
6-
interface Props {
6+
const props = defineProps<{
77
iconProps: SVGAttributes;
8-
}
9-
const props = defineProps<Props>();
10-
provide(providerKey, props.iconProps);
8+
}>();
9+
10+
const iconProps = toRef(props, 'iconProps');
11+
12+
provide(providerKey, iconProps);
1113
</script>
1214

1315
<template>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { InjectionKey, SVGAttributes } from 'vue-demi';
1+
import type { InjectionKey, Ref, SVGAttributes } from 'vue';
22

3-
const providerKey = Symbol('IconoirProvider') as InjectionKey<SVGAttributes>;
3+
const providerKey = Symbol('IconoirProvider') as InjectionKey<Ref<SVGAttributes>>;
44
export default providerKey;

packages/iconoir-vue/tsconfig.json

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
11
{
2-
"compilerOptions": {
3-
"target": "es2018",
4-
"jsx": "preserve",
5-
"lib": [
6-
"esnext",
7-
"dom",
8-
"dom.iterable"
9-
],
10-
"baseUrl": ".",
11-
"rootDir": "src",
12-
"module": "esnext",
13-
"moduleResolution": "node",
14-
// "isolatedModules": true,
15-
"types": [
16-
"vite/client"
17-
],
18-
"strict": true,
19-
"declarationMap": false,
20-
"allowSyntheticDefaultImports": true,
21-
"esModuleInterop": true,
22-
"skipLibCheck": true
23-
},
24-
"include": [
25-
"src/**/*.ts",
26-
"src/**/*.vue"
27-
]
2+
"extends": "@vue/tsconfig/tsconfig.dom.json"
283
}

0 commit comments

Comments
 (0)