Repository navigation
Major Changes
-
f70ba5a: Support Solid 2 with the new effect and lifecycle APIs. Use solid-codemirror 2.x in Solid 1 projects.
Set
createCodeMirror({ extensions })to install state fields, plugins, and other startup extensions before the view is exposed. Usevaluefor the initial document andcreateEditorControlledValueto synchronize a reactive document. A dispatch batch callsonValueChangeonce with its final document.Pass an accessor to
createExtensionto reconfigure a compartment when its value changes. Solid-codemirror tracks the accessor for you. Returnundefinedto clear the compartment. For an extension that loads as reactive inputs change, pass a Solid 2 async memo. For a one-time load, usecreateLazyCompartmentExtension.Read-only editors remain keyboard focusable and report their read-only state to CodeMirror commands.
Use
setEditorStateto switch between document states while retaining the view's current configuration. Tag programmatic transactions withExternalChangeto skiponValueChange, or usecreateEditorControlledValuewith{ notify: false }.See the migration guide for upgrade steps and examples.