Skip to content

Codemirror 6 #88

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
mraghuram opened this issue Jan 25, 2021 · 11 comments
Closed

Codemirror 6 #88

mraghuram opened this issue Jan 25, 2021 · 11 comments

Comments

@mraghuram
Copy link

Hi, just curious to know if there is a plan to upgrade this to CodeMirror 6.

Thanks for all the amazing stuff so far.

@jaywcjlove
Copy link
Member

@mraghuram Wait for the official version to released.

@mraghuram
Copy link
Author

Thanks. Looks like final beta is out.

@addingama
Copy link

Any update on this?

@jaywcjlove jaywcjlove pinned this issue May 15, 2021
@jaywcjlove
Copy link
Member

@addingama Still waiting...

@jaywcjlove
Copy link
Member

Upgrade @uiw/react-codemirror@4.0.0-rc.4 +++

jaywcjlove added a commit that referenced this issue Sep 7, 2021
@jaywcjlove
Copy link
Member

jaywcjlove commented Sep 7, 2021

npm bundle size

⚠️ 3.0 cannot be upgraded to 4.0+

import CodeMirror from '@uiw/react-codemirror';
- import 'codemirror/mode/javascript/javascript';
+ import { javascript } from "@codemirror/lang-javascript";

const code = 'console.log("hello world!");';

<CodeMirror
  value={code}
-  options={{
-    mode: 'js',
-  }}
+  extensions={[
+    javascript({ jsx: true })
+  ]}
/>

@gitluck1314
Copy link

I have not found any language packs that support yaml. Can you help me?

@gitluck1314
Copy link

@jaywcjlove

@gitluck1314
Copy link

@jaywcjlove 我看这个链接,没有发现可以支持yaml的语言包,这是怎么回事呢?我需要你的帮助

@jaywcjlove
Copy link
Member

jaywcjlove commented Sep 16, 2022

@gitluck1314 https://gitee.com/uiw/react-codemirror

import { yaml } from '@codemirror/legacy-modes/mode/yaml';

import CodeMirror from '@uiw/react-codemirror';
import { StreamLanguage } from '@codemirror/language';
import { yaml } from '@codemirror/legacy-modes/mode/yaml';

const yamlLang = `yaml......`;

export default function App() {
  return (
    <CodeMirror
      value={yamlLang}
      height="200px"
      extensions={[StreamLanguage.define(yaml)]}
    />
  );
}

@ArchanaSharma95
Copy link

ArchanaSharma95 commented Dec 20, 2022

I am getting this error after adding any language extension:: Cannot read properties of null (reading 'extension')

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants