koumoul-dev / vuetify-jsonschema-form

Create beautiful and low-effort forms that output valid data. Published on npm as @koumoul/vjsf.
https://koumoul-dev.github.io/vuetify-jsonschema-form/latest/
MIT License
538 stars 154 forks source link

release of v3 alpha #420

Open albanm opened 8 months ago

albanm commented 8 months ago

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.

ocostello commented 8 months ago

Some feedback:

Fosuke commented 7 months ago

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)

obr42 commented 7 months ago

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!

albanm commented 7 months ago

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.

albanm commented 5 months ago

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.

lukas-mertens commented 5 months ago

@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

albanm commented 5 months ago

Sure, thanks.