Code Monkey home page Code Monkey logo

Comments (7)

ocostello avatar ocostello commented on June 11, 2024

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

from vuetify-jsonschema-form.

Fosuke avatar Fosuke commented on June 11, 2024

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)

from vuetify-jsonschema-form.

obr42 avatar obr42 commented on June 11, 2024

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!

from vuetify-jsonschema-form.

albanm avatar albanm commented on June 11, 2024

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.

from vuetify-jsonschema-form.

albanm avatar albanm commented on June 11, 2024

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.

from vuetify-jsonschema-form.

lukas-mertens avatar lukas-mertens commented on June 11, 2024

@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

from vuetify-jsonschema-form.

albanm avatar albanm commented on June 11, 2024

Sure, thanks.

from vuetify-jsonschema-form.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.