Open albanm opened 8 months ago
Some feedback:
We weren't passing options in our implementation on Vue 2 so with the update and on Vue 3 I had to use the option readOnly : false
to be able to input data to string and array fields, it doesn't look like it's the default although the docs state it is
After the upgrade our app wouldn't build, with errors like
ERROR in ./node_modules/@json-layout/core/src/state/state-node.js 2:0-95
Module not found: Error: Default condition should be last one
@ ./node_modules/@json-layout/core/src/state/index.js 5:0-69 304:27-45 330:13-27
@ ./node_modules/@json-layout/core/src/index.js 2:0-33 2:0-33
@ ./node_modules/@koumoul/vjsf/src/compat/v2.js 4:0-48 74:2-13
So I had to switch this
"import": {
"default": "./src/index.js",
"types": "./types/index.d.ts"
}
to
"import": {
"types": "./types/index.d.ts",
"default": "./src/index.js"
}
in all of the package.json files for @koumoul/vjsf
and @json-layout
I'm not sure if it's meant to still be supported but we had a schema using an array of items defined by a $ref which now works differently; as each input blurs it looks readonly and can only be edited by clicking a button
Hey, when I try using this on a vite project I am getting this error:
Uncaught SyntaxError: The requested module '/node_modules/ajv-formats/dist/formats.js?v=67c67aed' does not provide an export named 'fullFormats' (at validate.js?v=67c67aed:1:10)
Hey, when I try using this on a vite project I am getting this error:
...
This has to do with ESM vs CommonJS problems. This is because ajv-formats
doesn't have type:module
in its package.json (maybe there's a new version that does, I didn't look). Vite automatically converts direct dependencies into ESM for you. But since its not a direct dependency it is not getting converted. You can tell Vite to pre-bundle certain CommonJS dependencies, and it will convert them to ESM for you. I added the following to my vite.config.ts
and V3 VJSF is working beautifully for me (optimizeDeps
for dev and build.commonjsOptions
for prod):
export default defineConfig({
...
optimizeDeps: {
include: ['ajv', 'ajv-formats', 'ajv-formats/dist/formats.js', 'ajv-i18n', 'ajv-errors', 'markdown-it', 'rfdc', 'debug'],
},
build: {
...
commonjsOptions: {
include: [/ajv/, /ajv-formats/, /ajv-formats\/dist\/formats.js/, /ajv-i18n/, /ajv-errors/, /markdown-it/, /rfdc/, /debug/, /node_modules/],
},
},
});
This V3 VJSF came at the best timing for me. So stoked to be able to use this. Thank you!!
Vuetify has released 3.4.0 which moves everything from labs
into "core", which is a breaking change (for my app, but also for VJSF - labs/VDatePicker
dependency). Hopefully VJSF can update to Vuetify 3.4 in the near future!
I didn't have as much time as I wanted to work on vjsf these last few weeks. But still, I just released v3.0.0-alpha.1. It solves some build issues, add few missing functionalities and some improvements to the doc site. I am quite happy with the new editor (https://koumoul-dev.github.io/vuetify-jsonschema-form/next/editor), it looks like bidirectional reactivity works pretty well in this version compared to the previous one as I was hoping to achieve. This is still a work in progress and there is a ton of missing stuff.
Concerning the management of the commonjs dependencies I just added a section in the getting-started, and an example application based on a standard Vite template here.
@albanm I was struggling with it still not working until I learned that vite actually caches the commonjs conversion stuff. Make sure to do vite --force
after changing these settings to ignore caches. Maybe you could add this info to the docs as well, might be helpful for some people
Sure, thanks.
I just released version 3.0.0-alpha.0. Its documentation is published in the "next" subfolder here. It is published on npm with the "next" tag (npm instal @koumoul/vjsf@next).
This is a very early release, there is still a ton of work to be done. But if some people are willing to test installation, run a few simple cases, provide feedback on the overall design, etc, that would be helpful.
The core is almost done I think, the remaining work is mostly in the ui components and in the v2compat function. I ported all the examples from v2 and the priority is now to make as many of them as possible work again.