-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vuejs 3 #81
Comments
Hi, Yes, I want to provide a Vue v3 version. There have been some changes to Vue's render function's syntax in v3. VFJS uses the render functions under the hood and the same syntax is used in the We also need to replace Vue as an event bus with something else. That's about it in terms of changes. It's not a lot of work to get it running on Vue v3, but it would require a bump in VFJS version from 2 to 3, and with that I was hoping to introduce some other changes with that version bump. With that said however I could release a pre-release version with Vue v3 support, I'll look into it this week and see if I can get it running. I'll keep you posted. |
Thanks you! |
Hey @ViPErCZ Just a quick update. I've managed to get a simple demo to render using Vue 3, as you can see in the gif below. There are a few differences between how Vue 2 and 3 handles things but in order to preserve compability with Vue 2 I have to write some logic to perform actions differently based on what version of Vue is used. Right now I just updated the code to work with Vue 3, but that will break things for Vue 2. Here's a demo of an input rendered using Vue 3: I will try to put some time into this over the weekend. There are a couple of errors and warnings thrown in the console and performance is bad, but it works. It will probably take some time to iron out the kinks but I aim to publish a Vue 3 compatible version of VFJS as soon as it is good enough. |
OK thank you. I will be looking forward and I will wait ... ;-) |
Hi again, Another update. There are quite a few differences between vue2 and vue3 and I'm trying to build a compability layer to make the upgrade transition as easy and smooth as possible, however it takes quite a bit of time to find out all the nuances in how the two versions behave. I didn't have any more time last weekend to make any more progress on the vue3 version, however this weekend I have quite the open schedule, so hopefully I can provide a status update in a few days with more progress made. |
Great news. I look forward to... |
Hello @jarvelov, I'm interested in using this on a vue3 project. I tried copying one of the demos into my project and it failed spectacularly (form didn't render and error was I'll gladly lend a hand, if you show me where to start. Just to make sure there's nothing wrong on my end I made this demo repo of what I tried. I copied the "minimal demo" and yanked out the pretty print component. |
Hi @chriscauley! Unfortunately there's no public branch yet. I have't had time to make any more progress on a vue 3 compatible build. I could publish the code tweaked for vue 3 if you still wish to try it out and see if you can fix some of the bugs. I'll be uploading the code tomorrow either way in a new branch if someone else also wants to take a shot at it. |
@jarvelov that would be great. I'll see if I can help. |
Hi @chriscauley Thanks for offering your help. I just pushed the I think clues to the answer lies somewhere in Vue 3's documentation regarding its reactivity API. I haven't yet had time to understand the new concepts in vue 3 with Best of luck and let me know if you find anything. |
Hi all! Life's gotten in the way and I have to spend my time away from VFJS for the next couple of weeks. More info here. I expect to be back in January 2021. |
Is VFJS now working with Vue3, actually? |
There seem to be some import/export errors. I did get the basic example to work by changing |
@Taaitaaiger What I did try:
that was running for a while then I got
did I anything wrong? I'm on windows. |
Looks like the NODE_ENV is interpreted literally in the command and Windows doesn't understand it. I know too little about Windows to help with that, sorry. |
got example 1 running by changing
to
in package.json I had also to change |
@jarvelov hope you're doing well! Sorry for disturbing you, but I was just wondering if you could give a small update on Vue 3 compatibility / roadmap? We have a project that is Vue 2 based today using VFJS, and we plan on upgrading to Vue 3 in the near future. And to do that we need a plan for how to deal with all of our JSON schemas. I really hope we can continue to use VFJS, it's been a joy to use. |
Thanks for reaching out. Glad to hear you've found VFJS useful. There exists a Vue 3 compatible version, however I haven't really had a lot of time to test it out and as such I haven't released it yet. However, it's better that people can test it out and report back so I will release it as There are some issues I have yet to come to a solution to though. They are not so much an issue for users of VFJS but rather for me as the maintainer. I would like to continue supporting Vue 2, however there are some internal breaking changes in Vue which makes it a bit challenging to use the same code base for both Vue 2 and Vue 3. It is not impossible to support both 2 and 3, but it will take some effort to set up. Another thing is that I'm not really sure as to the future of continuing to publish UMD builds, seeing as the Vue 3 docs doesn't seem to mention them anywhere, or maybe I've just missed it. Overall I'm not sure whether anyone actually uses the UMD version either so I might drop support for it and just have the ESM build. Anyway this might be subject to change. I will post an update about this when I've made up my mind. For now at least VFJS will support Vue 2 (both ESM and UMD builds) and Vue 3 (ESM build, at first at least). |
|
@jarvelov Thank you so much! Look forward to testing it out! |
Hello @jarvelov Thank you So Much For Updating the Awesome Package. I was stuck for the last two days due to validation and state and not being updated in the vue3. Also, I have one more question So now can I use this package in my latest project? |
Hello @jarvelov, |
Dear @jarvelov and all other interested folks, I'd like to share my VFJS Vue3 experiments with you: https://github.com/miguelzapaton/vue3-form-json-schema I took the 3.0.0-alpha.0 as a base and it looks quite promising that VFJS will also work very soon in fancy Vue3 projects. For more information please check the README. @jarvelov please feel free to cherry pick everything you like for the official version from my fork repo. As @semiaddict pointed out the way to go for Vue3 could be either using vue-demi or having a two separate libs:
Please try out the refactored examples. I've not yet found out why example4 is not working .. hints and feedback are welcome. Miguel |
@miguelzapaton do you have a UMD version of your fork or is it possible to build one? |
@Bruno17 Yes, but untested as the fork is still experimental. Just clone and build the fork. Please check the README for instructions. You can find the resulting UMD lib file under /lib/dist/.. Feel free to adapt the lib build in vite.config.js to your needs. I would be happy to know if UMD works. |
@miguelzapaton |
Yes, this has to do with the lib name and the -not- included dependencies (currently neither lodash-es nor ajv - which are not loaded separetly in example-1 either) I have to dive in further - in the meantime a quick version of ./lib/vite.config.js that allowed me to build a fork lib that works with example-1 (use import {defineConfig} from 'vite';
import * as path from 'path';
import visualizer from 'rollup-plugin-visualizer';
export default defineConfig({
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.js'),
name: 'Vue3FormJsonSchema',
// formats: ['es'], /* default es+umd -> UMD has no code-splitting ! */
fileName: (format) => `vue3-form-json-schema.${format}.js`
},
rollupOptions: {
external: ['vue'],
output: {
globals: {
vue: 'Vue'
},
exports: 'named'
},
plugins: [
visualizer({
filename: path.resolve(__dirname, 'dist/stats.html'),
template: 'treemap' // sunburst|treemap|network
})
]
}
},
esbuild: {
minify: false // optimize here (vite doc says no for libs!) or better not and let users optimize in their projects?
}
}) If you build the fork lib with Miguel |
Thank you, @miguelzapaton. That works! Do you think, it is possible to get that working within a setup like that? : |
You mean the UMD example-1 from my latest commit here? This was the necessary change to make the model update working in the umd/example-1 (and all other vue3 examples):
I don't see any reason why the integration in the Quasar-UMD-Template shouldn't work. Just give it a try starting with the integration of the umd/example-1 ... |
@miguelzapaton |
At first sight es/example-4 with external bootstrap-vue components is fine now. @Bruno17 Are Quasar compononents working too? |
@miguelzapaton |
I am using the v3.0.0.alpha tagged version on a vue 3 app.
Any ideas how to fix this? |
Feel free to check out my Vue3 fork: https://github.com/miguelzapaton/vue3-form-json-schema It's based on 3.0.0-alpha.0 Feedback welcome! |
@miguelzapaton you've done quite some work on your fork. Could it be possible to propose a pull request, now that vue3 is mature ? |
@trollfot and all other interested people Two reasons why there's no pull request:
Feel free to link it as local dependency in your project. pnpm makes it very easy:
At the moment I'm trying to further optimize it, especially for SSR. First experiments are promising that even complex forms could get rendered on the server 😁 |
would be cool to have a version which works without SSR released as npm package! |
@miguelzapaton I'm quite interested in this. Is there a way to get a build of your fork up on npm? |
In case anyone else ends up here like me... Here is a very good implementation in vue: https://jsonforms.io/ |
Are you planning a version for vuejs 3?
The text was updated successfully, but these errors were encountered: