Skip to content

Commit 2ed2f90

Browse files
committed
feat: remove restructure transform
1 parent 9d7133f commit 2ed2f90

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+906
-1302
lines changed

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,11 @@ const foo = ref('foo')
3737
export default <Comp foo={foo} />
3838
```
3939

40-
2.Turn on the restructure option to restructure props.
40+
2.Use the `defineComponent` macro from [@vue-macros/jsx-macros](https://github.com/vue-macros/vue-macros/pull/794) to wrapping.
4141

42-
```ts
43-
// vite.config.ts
44-
export default defineConfig({
45-
plugins: [
46-
VueJsxVapor({
47-
restructure: true,
48-
}),
49-
],
42+
```tsx
43+
defineComponent(({ foo }) => {
44+
return <div>{ foo }<div>
5045
})
5146
```
5247

package.json

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,15 @@
131131
"@babel/parser": "^7.24.7",
132132
"@babel/types": "^7.24.7",
133133
"@vue-macros/common": "^1.10.4",
134-
"@vue-vapor/compiler-core": "3.20240702.0-b44ca85",
135-
"@vue-vapor/compiler-dom": "3.20240702.0-b44ca85",
136-
"@vue-vapor/compiler-vapor": "3.20240702.0-b44ca85",
137-
"@vue-vapor/runtime-vapor": "3.20240702.0-b44ca85",
138-
"@vue-vapor/shared": "3.20240702.0-b44ca85",
139-
"@vue-vapor/vue": "3.20240702.0-b44ca85",
134+
"@vue/compiler-core": "catalog:",
135+
"@vue/compiler-dom": "catalog:",
136+
"@vue/compiler-vapor": "catalog:",
137+
"@vue/runtime-vapor": "catalog:",
138+
"@vue/shared": "catalog:",
140139
"magic-string-stack": "^0.1.1",
141140
"source-map-js": "^1.2.0",
142-
"unplugin": "^1.11.0"
141+
"unplugin": "^1.11.0",
142+
"vue": "catalog:"
143143
},
144144
"devDependencies": {
145145
"@antfu/eslint-config": "^2.21.2",
@@ -162,10 +162,5 @@
162162
"vite": "^5.3.2",
163163
"vitest": "^1.6.0",
164164
"webpack": "^5.92.1"
165-
},
166-
"pnpm": {
167-
"patchedDependencies": {
168-
"@vue-vapor/[email protected]": "patches/@[email protected]"
169-
}
170165
}
171166
}

patches/@[email protected]

Lines changed: 0 additions & 13 deletions
This file was deleted.

playground/App.vue

Lines changed: 0 additions & 70 deletions
This file was deleted.

playground/for.vue

Lines changed: 0 additions & 23 deletions
This file was deleted.

playground/html.vue

Lines changed: 0 additions & 14 deletions
This file was deleted.

playground/if.vue

Lines changed: 0 additions & 28 deletions
This file was deleted.

playground/main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { createVaporApp } from 'vue/vapor'
22

3-
const modules = import.meta.glob<any>('./*.(vue|js)')
4-
const mod = (modules[`.${location.pathname}.vue`] || modules['./App.vue'])()
3+
const modules = import.meta.glob<any>('./src/*.tsx')
4+
const mod = (
5+
modules[`./src${location.pathname}.tsx`] || modules['./src/App.tsx']
6+
)()
57

68
mod.then(({ default: mod }) => {
79
const app = createVaporApp(mod)

playground/model.vue

Lines changed: 0 additions & 19 deletions
This file was deleted.

playground/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@
55
"scripts": {
66
"dev": "nodemon -w '../../src/**/*.ts' -e .ts -x vite --port 5174"
77
},
8-
"dependencies": {
9-
"vue": "npm:@vue-vapor/[email protected]"
10-
},
118
"devDependencies": {
129
"@vitejs/plugin-vue": "^5.0.5",
13-
"@vue-macros/volar": "^0.23.0",
1410
"unplugin-vue-jsx-vapor": "workspace:*",
15-
"unplugin-vue-macros": "^2.11.5",
11+
"unplugin-vue-macros": "https://pkg.pr.new/vue-macros/vue-macros/unplugin-vue-macros@b482dd9",
1612
"vite": "^5.3.2",
1713
"vite-plugin-inspect": "^0.8.4"
1814
}

0 commit comments

Comments
 (0)