jsonnext / codemirror-json-schema

A JSONSchema enabled mode for codemirror 6, for json4 and json5, inspired by monaco-json
https://codemirror-json-schema.netlify.app
MIT License
57 stars 9 forks source link

.js file imports and schema loading as statefield #63

Closed acao closed 8 months ago

acao commented 11 months ago

this introduces a breaking change! with this change, you'll be able to provide schema this way:


import { jsonSchema, updateSchema } from 'codemirror-json-schema'
const state = EditorState.create({ 
// no need to pass schema here anymore
extensions: [jsonSchema()] 
})

const view = new EditorView({ state, parent: selector })

updateSchema(view, schema)

I'm going to do one more pass to change the signature of the linter extensions, where they are exported with the needsRefresh logic

changeset-bot[bot] commented 11 months ago

🦋 Changeset detected

Latest commit: 4ac83af4df0a62ff6844c1c6863cbc0936880cd8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ---------------------- | ----- | | codemirror-json-schema | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

netlify[bot] commented 11 months ago

Deploy Preview for codemirror-json-schema ready!

Name Link
Latest commit 4ac83af4df0a62ff6844c1c6863cbc0936880cd8
Latest deploy log https://app.netlify.com/sites/codemirror-json-schema/deploys/654a0fa9a62e3a00083d87f9
Deploy Preview https://deploy-preview-63--codemirror-json-schema.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

acao commented 9 months ago

@imolorhe this introduces a breaking change for anyone using the "custom" usage approach, so not bad news at all!