scttcper / ngx-codemirror

Codemirror Wrapper for Angular
https://ngx-codemirror.vercel.app
MIT License
279 stars 47 forks source link

Support codemirror v6 #311

Open varunpandurangaiah opened 2 years ago

varunpandurangaiah commented 2 years ago

My package.json

"@ctrl/ngx-codemirror": "^5.1.1",
"@types/codemirror": "5.60.5",
"codemirror": "^6.0.1",
Error: node_modules/@ctrl/ngx-codemirror/codemirror.component.d.ts:4:10 - error TS2305: Module '"codemirror"' has no exported member 'Editor'.

4 import { Editor, ScrollInfo, EditorFromTextArea, EditorChange } from 'codemirror';
           ~~~~~~

Error: node_modules/@ctrl/ngx-codemirror/codemirror.component.d.ts:4:18 - error TS2305: Module '"codemirror"' has no exported member 'ScrollInfo'.

4 import { Editor, ScrollInfo, EditorFromTextArea, EditorChange } from 'codemirror';
                   ~~~~~~~~~~

Error: node_modules/@ctrl/ngx-codemirror/codemirror.component.d.ts:4:30 - error TS2305: Module '"codemirror"' has no exported member 'EditorFromTextArea'.

4 import { Editor, ScrollInfo, EditorFromTextArea, EditorChange } from 'codemirror';
                               ~~~~~~~~~~~~~~~~~~

Error: node_modules/@ctrl/ngx-codemirror/codemirror.component.d.ts:4:50 - error TS2305: Module '"codemirror"' has no exported member 'EditorChange'.

4 import { Editor, ScrollInfo, EditorFromTextArea, EditorChange } from 'codemirror';
xrasod commented 2 years ago

We're having this issue to.

Edit: This resolved itself by simply downgrading codemirror 6.x, to latest 5.x. npm install codemirror@^5.65.7 should do the trick.

eriky commented 1 year ago

The docs should reflect that this works only with codemirror 5, so the install instructions should explicitly install codemirror 5.

emmamcarthur commented 1 year ago

@scttcper Do you have an approximate timeline for this work?

jpike88 commented 1 year ago

@scttcper raising the version of this package to v6 makes no sense. I updated to code mirror v6 assuming you were tracking their versioning, or at least sticking with v5 till your library could handle v6. This is a warning to others.

scttcper commented 1 year ago

that isn't how semver works

scttcper commented 1 year ago

As an update, i have no plans to upgrade this to codemirror 6 if anyone wants to take this on

nzbin commented 2 months ago

The CodeMirror v6 wrapper for Angular is here. https://github.com/acrodata/code-editor