add content to the upgrade guide

This commit is contained in:
Hans Pagel
2020-09-09 15:57:30 +02:00
parent 94ca32478a
commit bc36e377b3

View File

@@ -1,6 +1,35 @@
# Upgrade Guide
- reasons to upgrade to tiptap 2
- link to roadmap
## Reasons to upgrade to tiptap 2.x
## Upgrading from 1.x to 2.x
* TypeScript: auto complete, less bugs, generated API documentation
* Amazing documentation with 100+ pages
* Active maintenance, no more updates to 1.x
* Tons of new extensions planned
* Less bugs, tested code based
## Upgrading from 1.x to 2.x
The new API will look pretty familiar too you, but there are a ton of changes though. To make the upgrade a little bit easier, here is everything you should do:
### New document type
**We renamed the default `Document` type from `doc` to `document`.** To keep it like that, use your own implementation of the `Document` node or migrate the stored JSON to use the new name.
```js
import Document from '@tiptap/extension-document'
const CustomDocument = Document.name('doc').create()
new Editor({
extensions: [
CustomDocument(),
]
})
```
### New extension API
In case youve built some custom extensions for your project, youll need to rewrite them to fit the new API. No worries, though, you can keep a lot of your work though. The schema, commands, keys, inputRules, pasteRules all work like they did before. Its just different how you register them.
```js
const CustomExtension =
```