Skip to content

Commit 9bdd833

Browse files
committed
feat: v6.0.0
1 parent 69773f3 commit 9bdd833

File tree

4 files changed

+49
-18
lines changed

4 files changed

+49
-18
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
## CHANGELOG
22

3+
### v6.0.0 (2022-06-13)
4+
5+
**Breaking changes**
6+
7+
1. The package no longer depends on the codemirror package and now requires you to install the codemirror dependency manually.
8+
9+
e.g. `npm install codemirror vue-codemirror`
10+
11+
2. The package no longer exports the original codemirror package. If you need import interface from codemirror, you now need to make codemirror explicitly dependent in your `package.json`.
12+
13+
e.g.
14+
15+
```json
16+
"dependencies": {
17+
"@codemirror/state": "6.x"
18+
}
19+
```
20+
21+
```ts
22+
import { EditorView } from 'codemirror'
23+
import { EditorState } from '@codemirror/state'
24+
```
25+
326
### v5.1.0 (2022-06-12)
427

528
- Upgrade codemirror dependencies to 6.x

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
[CodeMirror(6)](https://codemirror.net) component for Vue(3).
1414

15-
**vue-codemirror** v5 has been released. This is a new version based on [CodeMirror@6](https://codemirror.net) and is available to Vue3 only. Since CodeMirror@6 is developed with native ES Modules, the new version will no longer support direct browser references to UMD modules. In short, the new version is ⚠️ **completely NOT compatible** with previous versions. If you wish to continue using Vue2 or a lower version of CodeMirror, please refer to the legacy versions below.
15+
**vue-codemirror** v5/v6 has been released. This is a new version based on [CodeMirror@6](https://codemirror.net) and is available to Vue3 only. Since CodeMirror@6 is developed with native ES Modules, the new version will no longer support direct browser references to UMD modules. In short, the new version is ⚠️ **completely NOT compatible** with previous versions. If you wish to continue using Vue2 or a lower version of CodeMirror, please refer to the legacy versions below.
1616

1717
This [**example site**](https://github.surmon.me/vue-codemirror) contains most of what you want.
1818

@@ -44,11 +44,11 @@ This [**example site**](https://github.surmon.me/vue-codemirror) contains most o
4444
#### Install
4545

4646
```bash
47-
yarn add vue-codemirror
47+
yarn add codemirror vue-codemirror
4848
```
4949

5050
```bash
51-
npm install vue-codemirror --save
51+
npm install codemirror vue-codemirror --save
5252
```
5353

5454
#### Depending on your actual needs, you may need to install more CodeMirror packages
@@ -65,6 +65,20 @@ yarn add @codemirror/theme-one-dark
6565
# more CodeMirror packages...
6666
```
6767

68+
#### If you need import API/interface from codemirror, you need to make codemirror explicitly dependent in your `package.json`
69+
70+
e.g.
71+
72+
```json
73+
"dependencies": {
74+
"@codemirror/state": "6.x"
75+
}
76+
```
77+
78+
```ts
79+
import { EditorState } from '@codemirror/state'
80+
```
81+
6882
#### local component
6983

7084
```vue
@@ -75,7 +89,7 @@ yarn add @codemirror/theme-one-dark
7589
:style="{ height: '400px' }"
7690
:autofocus="true"
7791
:indent-with-tab="true"
78-
:tabSize="2"
92+
:tab-size="2"
7993
:extensions="extensions"
8094
@ready="log('ready', $event)"
8195
@change="log('change', $event)"
@@ -111,8 +125,8 @@ yarn add @codemirror/theme-one-dark
111125

112126
```javascript
113127
import { createApp } from 'vue'
128+
import { basicSetup } from 'codemirror'
114129
import VueCodemirror from 'vue-codemirror'
115-
import { basicSetup } from '@codemirror/basic-setup'
116130

117131
const app = createApp()
118132

@@ -156,7 +170,7 @@ app.use(VueCodemirror, {
156170

157171
### Basic Setup
158172

159-
The [basic-setup](https://codemirror.net/docs/ref/#basic-setup) extension is integrated by default in the vue-codemirror configuration, and is intended as a handy helper to quickly set up CodeMirror without having to install and import a lot of standalone packages. If you want to override the default behavior of the config, just pass the empty array when installing the component globally.
173+
The [basic-setup](https://codemirror.net/docs/ref/#basic-setup) extension is integrated by default in the vue-codemirror configuration and is intended as a handy helper to quickly set up CodeMirror without having to install and import a lot of standalone packages. If you want to override the default behavior of the config, just pass the empty array when installing the component globally.
160174

161175
```js
162176
app.use(VueCodemirror, {

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "vue-codemirror",
3-
"description": "CodeMirror component for Vue",
4-
"version": "5.1.0",
3+
"description": "CodeMirror code editor component for Vue",
4+
"version": "6.0.0",
55
"homepage": "https://github.com/surmon-china/vue-codemirror#readme",
66
"license": "MIT",
77
"keywords": [
88
"vue-codemirror",
99
"vue codemirror",
1010
"vue code editor",
11-
"vue web ide"
11+
"web IDE vue"
1212
],
1313
"author": {
1414
"name": "Surmon",
@@ -42,17 +42,18 @@
4242
"release": ". ./scripts/release.sh"
4343
},
4444
"peerDependencies": {
45-
"vue": "3.x"
45+
"vue": "3.x",
46+
"codemirror": "6.x"
4647
},
4748
"dependencies": {
48-
"codemirror": "6.x",
4949
"@codemirror/commands": "6.x",
5050
"@codemirror/language": "6.x",
5151
"@codemirror/state": "6.x",
5252
"@codemirror/view": "6.x",
5353
"csstype": "^2.6.8"
5454
},
5555
"devDependencies": {
56+
"codemirror": "6.x",
5657
"@codemirror/lang-cpp": "^6.0.0",
5758
"@codemirror/lang-html": "^6.0.0",
5859
"@codemirror/lang-java": "^6.0.0",

src/index.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ import { injectGlobalConfig } from './config'
55
export type { Props } from './component'
66
export { DEFAULT_CONFIG } from './component'
77

8-
// Stop exports codemirror primitive interface to prevent module domain flooding naming conflicts.
9-
// export * from 'codemirror'
10-
// export * from '@codemirror/view'
11-
// export * from '@codemirror/state'
12-
// export * from '@codemirror/commands'
13-
// export * from '@codemirror/language'
14-
158
export const Codemirror = Component
169
export const install: Plugin = (app, defaultConfig?: Props) => {
1710
app.component(Component.name, Component)

0 commit comments

Comments
 (0)