Skip to content

Commit

Permalink
feat(TS): switch from vue2 and 3 directly to vue-demi
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Ackermann committed Aug 24, 2024
1 parent ba2af71 commit 848027e
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 115 deletions.
70 changes: 40 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,14 @@
},
"homepage": "https://github.com/AckermannJan/single-spa-vue#readme",
"peerDependencies": {
"@vue/composition-api": "^1.7.2",
"vue": "^2.7.0 || >=3.0.0"
},
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
}
},
"devDependencies": {
"@babel/core": "^7.22.5",
"@babel/preset-env": "^7.25.3",
Expand Down Expand Up @@ -73,5 +79,8 @@
"vue": "^3.4.23",
"vue-tsc": "^2.0.13",
"vue2": "npm:[email protected]"
},
"dependencies": {
"vue-demi": "^0.14.10"
}
}
7 changes: 4 additions & 3 deletions src/parcel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, h } from "vue";
import * as Vue from "vue";

interface RenderedComponentProps {
ref: string;
Expand All @@ -20,7 +20,7 @@ interface Parcel {
getStatus: () => string;
}

export default defineComponent({
export default Vue.defineComponent({
props: {
config: [Object, Promise],
wrapWith: String,
Expand All @@ -32,7 +32,8 @@ export default defineComponent({
},
parcelProps: Object,
},
render() {
render(h: typeof Vue.h | undefined) {
h = typeof h === "function" ? h : Vue.h;
const containerTagName: string = this.wrapWith || "div";
const props: RenderedComponentProps = { ref: "container" };

Expand Down
Loading

0 comments on commit 848027e

Please sign in to comment.