Releases: riccardoperra/solid-codemirror
[email protected]
Patch Changes
- e3daa5a: Fix type exports in package.json.
[email protected]
Breaking Changes
Warning This version could cause breaking changes due to @codemirror/state and @codemirror/view version update.
Updating @codemirror/state to ^6.2.0 and @codemirror/view to ^6.12.0 it's highly recommended
- Update minimum version of @codemirror/view and @codemirror/state
Minor Changes
[email protected]
Patch Changes
- 6a103b3: chore: fix ci
[email protected]
What's Changed
- Patch for editorView lifecycle by @AsherJingkongChen in #18
- Version Packages by @github-actions in #19
New Contributors
- @AsherJingkongChen made their first contribution in #18
Full Changelog: https://github.com/riccardoperra/solid-codemirror/compare/[email protected]@2.2.2
[email protected]
This version of solid-codemirror introduces a new helper: createLazyCompartmentExtension
. This new helper will not introduce any magic at all, it will just provide a cleaner syntax to support extensions returning a Promise.
// ✅ 1. Remove the static import
// import { largeExtension } from './large-extension';
import { createLazyCompartmentExtension } from './createLazyCompartmentExtension';
import { Show } from 'solid-js';
function App() {
const [code, setCode] = createSignal("console.log('hello world!')");
const { ref, createExtension } = createCodeMirror({ onValueChange: setCode });
// ✅ 2. Call the helper providing a Promise<Extension>
// The extension will be configured only after the Promise resolves
const largeExt = createLazyCompartmentExtension(
() => import('./large-extension').then(res => res.largeExtension)
);
return (
<div>
<div ref={ref} />
{/*✅ 3. You can read the pending state of the Promise*/}
<Show when={largeExt.loading}>
Loading...
</Show>
</div>
)
}
Minor Changes
- 06762fe: feat: add support for lazy compartment extensions
[email protected]
Breaking Change
- solid-codemirror now requires solid 1.6.0
What's Changed
- fix: extensions are not applied #12 by @riccardoperra in #13
Full Changelog: https://github.com/riccardoperra/solid-codemirror/compare/[email protected]@2.1.0
[email protected]
This version of solid-codemirror has many breaking changes due to the update to official v6 release and support for compartments. For more detailed informations about CodeMirror6 and extension/compartments, see the official documentation
What's Changed
- Refactor
createCodeMirror
with extension modularity andcompartments
support - Allows to control editor value with
createEditorControlledValue
extension helper - Allows to observe and update focused state with
createEditorFocus
helper - Allows to update the readOnly state with
createEditorReadonly
helper
Breaking Changes
- Remove
CodeMirror
component (BREAKING!!)
The createCodeMirror
has been refactored removing the setOptions
function which allowed to do a top-level reconfiguration. Instead, it has been relpaced with the createExtension
function which create a compartment for the given extension/s.
Old
const {setOptions} = createCodeMirror();
setOptions({extensions: [
basicSetup(),
EditorView.theme([]),
lineNumbers()
]})
New
const {createExtension} = createCodeMirror();
// Single-extension compartment
const reconfigurebasicSetup = createExtension(basicSetup());
const reconfigureTheme = createExtension(EditorView.theme([]);
const reconfigureLineNumbers = createExtension(lineNumbers());
// Multi-extension compartment
const configureExtensions = createExtension([
basicSetup(),
EditorView.theme([]),
lineNumbers()
])
Full Changelog: https://github.com/riccardoperra/solid-codemirror/compare/[email protected]
v1.1.0
1.1.0 (2022-06-12)
Features
- add support for CodeMirror 6.0.0 (b47dfad)
Full Changelog: v1.0.3...v1.1.0