remove gridsome

This commit is contained in:
Philipp Kühn
2021-09-16 14:41:25 +02:00
parent e012a29240
commit 2f15a11572
311 changed files with 157 additions and 10308 deletions

View File

@@ -0,0 +1,38 @@
---
tableOfContents: true
---
# Contributing
## toc
## Introduction
tiptap would be nothing without its lively community. Contributions have always been and will always be welcome. Here is a little bit you should know, before you send your contribution:
## Welcome examples
* Failing regression tests as bug reports
* Documentation improvements, e. g. fix a typo, add a section
* New features for existing extensions, e. g. a new configureable option
* New extensions, which dont require changes to the core or other core extensions
* Well explained, non-breaking changes to the core
## Submit ideas
Make sure to open an issue and outline your idea first. Well get back to you quickly and let you know if there is a chance we can merge your contribution.
## Set up the development environment
Its not too hard to tinker around with the official repository. Youll need [Git](https://github.com/git-guides/install-git), [Node](https://nodejs.org/en/download/) and [Yarn](https://classic.yarnpkg.com/en/docs/install/#mac-stable) installed. Here is what you need to do then:
1. Copy the code to your local machine: `$ git clone git@github.com:ueberdosis/tiptap.git`
2. Install dependencies: `$ yarn install`
3. Start the development environment: `$ yarn start`
4. Open http://localhost:3000 in your favorite browser.
5. Start playing around!
## Our code style
There is an eslint config that ensures a consistent code style. To check for errors, run `$ yarn run lint`. Thatll be checked when you send a pull request, too. Make sure its passing, before sending a pull request.
## Testing for errors
Your pull request will automatically execute all our existing tests. Make sure that they all pass, before sending a pull request. Run all tests locally with `$ yarn run test` or run single tests (e. g. when writing new ones) with `$ yarn run test:open`.
## Futher questions
Any further questions? Create a new issue or discussion in the repository. Well get back to you.

View File

@@ -0,0 +1,187 @@
---
tableOfContents: true
---
# Upgrade Guide
## toc
## Reasons to upgrade to tiptap 2.x
Yes, its tedious work to upgrade your favorite text editor to a new API, but we made sure youve got enough reasons to upgrade to the newest version
* Autocompletion in your IDE (thanks to TypeScript)
* Amazing documentation with 100+ pages
* Active development, new features in the making
* Tons of new extensions planned
* Well-tested code base
## Upgrading from 1.x to 2.x
The new API will look pretty familiar to you, but there are a ton of changes though. To make the upgrade a little bit easier, here is everything you need to know:
### Uninstall tiptap 1.x
The whole package structure has changed, we even moved to another npm namespace, so youll need to remove the old version entirely before upgrading to tiptap 2.
Otherwise youll run into an exception, for example “looks like multiple versions of prosemirror-model were loaded”.
```bash
# with npm
npm uninstall tiptap tiptap-commands tiptap-extensions tiptap-utils
# with Yarn
yarn remove tiptap tiptap-commands tiptap-extensions tiptap-utils
```
### Install tiptap 2.x
Once you have uninstalled the old version of tiptap, install the new Vue 2 package and the starter kit:
```
# install with npm
npm install @tiptap/vue-2 @tiptap/starter-kit
# install with Yarn
yarn add @tiptap/vue-2 @tiptap/starter-kit
```
### Explicitly register the Document, Text and Paragraph extensions
tiptap 1 tried to hide a few required extensions from you with the default setting `useBuiltInExtensions: true`. That setting has been removed and youre required to import all extensions. Be sure to explicitly import at least the [`Document`](/api/nodes/document), [`Paragraph`](/api/nodes/paragraph) and [`Text`](/api/nodes/text) extensions.
```js
import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'
new Editor({
extensions: [
Document,
Paragraph,
Text,
// all your other extensions
],
})
```
And we removed some settings: `dropCursor`, `enableDropCursor`, and `enableGapCursor`. Those are separate extensions now: [`Dropcursor`](/api/extensions/dropcursor) and [`Gapcursor`](/api/extensions/gapcursor). You probably want to load them, but if you dont, just ignore this.
### New names for most extensions
We switched to lowerCamelCase, so theres a lot type names that changed. If you stored your content as JSON you need to loop through it and rename them. Sorry for that one.
| Old type | New type |
| --------------------- | ---------------------- |
| ~~`bullet_list`~~ | `bulletList` |
| ~~`code_block`~~ | `codeBlock` |
| ~~`hard_break`~~ | `hardBreak` |
| ~~`horizontal_rule`~~ | `horizontalRule` |
| ~~`list_item`~~ | `listItem` |
| ~~`ordered_list`~~ | `orderedList` |
| ~~`table_cell`~~ | `tableCell` |
| ~~`table_header`~~ | `tableHeader` |
| ~~`table_row`~~ | `tableRow` |
| ~~`todo_list`~~ | `taskList` (new name!) |
| ~~`todo_item`~~ | `taskItem` (new name!) |
### Removed methods
We removed the `.state()` method. No worries though, its still available through `editor.state`.
### New extension API
In case youve built some custom extensions for your project, youre required to rewrite them to fit the new API. No worries, you can keep a lot of your work though. The `schema`, `commands`, `keys`, `inputRules` and `pasteRules` all work like they did before. Its just different how you register them.
```js
import { Node } from '@tiptap/core'
const CustomExtension = Node.create({
name: 'custom_extension',
defaultOptions: {
},
addAttributes() {
},
parseHTML() {
},
renderHTML({ node, HTMLAttributes }) {
},
addCommands() {
},
addKeyboardShortcuts() {
},
addInputRules() {
},
// and more …
})
```
Read more about [all the nifty details building custom extensions](/guide/custom-extensions) in our guide.
### Renamed settings and methods
[We renamed a lot of settings and methods](/api/editor). Hopefully you can migrate to the new API with search & replace. Here is a list of what changed:
| Old name | New name |
| --------------- | ----------- |
| ~~`autoFocus`~~ | `autofocus` |
### Renamed commands
All new extensions come with specific commands to set, unset and toggle styles. So instead of `.bold()`, its now `.toggleBold()`. Also, we switched to lowerCamelCase, below are a few examples. Oh, and we renamed `todo_list`, to `taskList`, sorry for that one.
| Old command | New command |
| ------------------------ | ------------------------------- |
| `.redo()` | `.redo()` (nothing changed) |
| `.undo()` | `.undo()` (nothing changed) |
| ~~`.todo_list()`~~ | `.toggleTaskList()` (new name!) |
| ~~`.blockquote()`~~ | `.toggleBlockquote()` |
| ~~`.bold()`~~ | `.toggleBold()` |
| ~~`.bullet_list()`~~ | `.toggleBulletList()` |
| ~~`.code()`~~ | `.toggleCode()` |
| ~~`.code_block()`~~ | `.toggleCodeBlock()` |
| ~~`.hard_break()`~~ | `.toggleHardBreak()` |
| ~~`.heading()`~~ | `.toggleHeading()` |
| ~~`.horizontal_rule()`~~ | `.toggleHorizontalRule()` |
| ~~`.italic()`~~ | `.toggleItalic()` |
| ~~`.link()`~~ | `.toggleLink()` |
| ~~`.ordered_list()`~~ | `.toggleOrderedList()` |
| ~~`.paragraph()`~~ | `.toggleParagraph()` |
| ~~`.strike()`~~ | `.toggleStrike()` |
| ~~`.underline()`~~ | `.toggleUnderline()` |
| … | … |
### MenuBar, BubbleMenu and FloatingMenu
Read the dedicated [guide on creating menus](/guide/menus) to migrate your menus.
### Commands can be chained now
Most commands can be combined to one call now. Thats shorter than separate function calls in most cases. Here is an example to make the selected text bold:
```js
editor.chain().toggleBold().focus().run()
```
The `.chain()` is required to start a new chain and the `.run()` is needed to actually execute all the commands in between. Read more about [the new tiptap commands](/api/commands) in our API documentation.
### .focus() isnt called on every command anymore
We tried to hide the `.focus()` command from you with tiptap 1 and executed that on every command. That led to issues in specific use cases, where you want to run a command, but dont want to focus the editor.
With tiptap 2.x you have to explicitly call the `focus()` and you probably want to do that in a lot of places. Here is an example:
```js
editor.chain().focus().toggleBold().run()
```
### Event callbacks have fewer parameters
The new event callbacks have fewer parameters. The same things should be available through `this.` now. [Read more about events here.](/api/events)
### Collaborative editing
The reference implementation for collaborative editing uses Y.js now. Thats a whole different thing. You still can use the tiptap 1 extension, but its up to you to adapt it to the new extension API. If youve done this, dont forget to share it with us so we can link to it from here!
Read more about [the new collaborative editing experience](/guide/collaborative-editing) in our guide.
### Marks dont support node view anymore
For marks, node views are [not well supported in ProseMirror](https://discuss.prosemirror.net/t/there-is-a-bug-in-marks-nodeview/2722/2). There is also [a related issue](https://github.com/ueberdosis/tiptap/issues/613) for tiptap 1. Thats why we removed it in tiptap 2.
### Become a sponsor
tiptap wouldnt exist without the funding of its community. If you fell in love with tiptap, dont forget to [become a sponsor](/sponsor) and make the maintenance, development and support sustainable.
In exchange, well take you into our hearts, invite you to private repositories, add a `sponsor ♥` label to your issues and pull requests and more.