Skip to content

Commit

Permalink
remove the slate-schema package (#3291)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianstormtaylor authored Dec 10, 2019
1 parent 9d4a9d7 commit e68a5cd
Show file tree
Hide file tree
Showing 68 changed files with 40 additions and 1,892 deletions.
13 changes: 6 additions & 7 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,12 @@ If you're maintaining a translation, feel free to pull request it here!

Slate's codebase is monorepo managed with [Lerna](https://lernajs.io/). It consists of a handful of packages—although you won't always use all of them. They are:

| **Package** | **Version** | **Size** | **Description** |
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| [`slate`](./packages/slate) | [![](https://img.shields.io/npm/v/slate.svg?maxAge=3600&label=version&colorB=007ec6)](./slate/package.json) | [![](http://img.badgesize.io/https://unpkg.com/slate/dist/slate.min.js?compression=gzip&label=size)](https://unpkg.com/slate/dist/slate.min.js) | Slate's core data model logic. |
| [`slate-history`](./packages/slate-history) | [![](https://img.shields.io/npm/v/slate-history.svg?maxAge=3600&label=version&colorB=007ec6)](./slate-history/package.json) | [![](http://img.badgesize.io/https://unpkg.com/slate-history/dist/slate-history.min.js?compression=gzip&label=size)](https://unpkg.com/slate-history/dist/slate-history.min.js) | A plugin that adds undo/redo history to Slate. |
| [`slate-hyperscript`](./packages/slate-hyperscript) | [![](https://img.shields.io/npm/v/slate-hyperscript.svg?maxAge=3600&label=version&colorB=007ec6)](./slate-hyperscript/package.json) | [![](http://img.badgesize.io/https://unpkg.com/slate-hyperscript/dist/slate-hyperscript.min.js?compression=gzip&label=size)](https://unpkg.com/slate-hyperscript/dist/slate-hyperscript.min.js) | A hyperscript tool to write JSX Slate documents! |
| [`slate-react`](./packages/slate-react) | [![](https://img.shields.io/npm/v/slate-react.svg?maxAge=3600&label=version&colorB=007ec6)](./slate-react/package.json) | [![](http://img.badgesize.io/https://unpkg.com/slate-react/dist/slate-react.min.js?compression=gzip&label=size)](https://unpkg.com/slate-react/dist/slate-react.min.js) | React components for rendering Slate editors. |
| [`slate-schema`](./packages/slate-schema) | [![](https://img.shields.io/npm/v/slate-schema.svg?maxAge=3600&label=version&colorB=007ec6)](./slate-schema/package.json) | [![](http://img.badgesize.io/https://unpkg.com/slate-schema/dist/slate-schema.min.js?compression=gzip&label=size)](https://unpkg.com/slate-schema/dist/slate-schema.min.js) | A plugin for enforcing constraints on Slate content. |
| **Package** | **Version** | **Size** | **Description** |
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| [`slate`](./packages/slate) | [![](https://img.shields.io/npm/v/slate.svg?maxAge=3600&label=version&colorB=007ec6)](./slate/package.json) | [![](http://img.badgesize.io/https://unpkg.com/slate/dist/slate.min.js?compression=gzip&label=size)](https://unpkg.com/slate/dist/slate.min.js) | Slate's core data model logic. |
| [`slate-history`](./packages/slate-history) | [![](https://img.shields.io/npm/v/slate-history.svg?maxAge=3600&label=version&colorB=007ec6)](./slate-history/package.json) | [![](http://img.badgesize.io/https://unpkg.com/slate-history/dist/slate-history.min.js?compression=gzip&label=size)](https://unpkg.com/slate-history/dist/slate-history.min.js) | A plugin that adds undo/redo history to Slate. |
| [`slate-hyperscript`](./packages/slate-hyperscript) | [![](https://img.shields.io/npm/v/slate-hyperscript.svg?maxAge=3600&label=version&colorB=007ec6)](./slate-hyperscript/package.json) | [![](http://img.badgesize.io/https://unpkg.com/slate-hyperscript/dist/slate-hyperscript.min.js?compression=gzip&label=size)](https://unpkg.com/slate-hyperscript/dist/slate-hyperscript.min.js) | A hyperscript tool to write JSX Slate documents! |
| [`slate-react`](./packages/slate-react) | [![](https://img.shields.io/npm/v/slate-react.svg?maxAge=3600&label=version&colorB=007ec6)](./slate-react/package.json) | [![](http://img.badgesize.io/https://unpkg.com/slate-react/dist/slate-react.min.js?compression=gzip&label=size)](https://unpkg.com/slate-react/dist/slate-react.min.js) | React components for rendering Slate editors. |

<br />

Expand Down
2 changes: 0 additions & 2 deletions config/rollup/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import Core from '../../packages/slate/package.json'
import History from '../../packages/slate-history/package.json'
import Hyperscript from '../../packages/slate-hyperscript/package.json'
import React from '../../packages/slate-react/package.json'
import Schema from '../../packages/slate-schema/package.json'

/**
* Return a Rollup configuration for a `pkg` with `env` and `target`.
Expand Down Expand Up @@ -168,5 +167,4 @@ export default [
...factory(History),
...factory(Hyperscript),
...factory(React),
...factory(Schema),
]
3 changes: 1 addition & 2 deletions docs/concepts/XX-migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,8 @@ slate-hyperscript 447 -> 345
slate-plain-serializer 56 -> 0
slate-prop-types 62 -> 0
slate-react-placeholder 62 -> 0
slate-schema 0 -> 439
total 13,807 -> 5,344 (39%)
total 13,807 -> 4,905 (36%)
```

It's quite a big difference! And that doesn't even include the dependencies that were shed in the process too.
2 changes: 1 addition & 1 deletion docs/general/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ One of Slate's core principles is that, unlike most other editors, it does **not

For the most part, this leads to increased flexbility without many downsides, but there are certain cases where you have to do a bit more work. Pasting is one of those cases.

Since Slate knows nothing about your schema, it can't know how to parse pasted HTML content (or other content). So, by default whenever a user pastes content into a Slate editor, it will parse it as plain text. If you want it to be smarter about pasted content, you need to override the `insert_data` command and deserialize the `DataTransfer` object's `text/html` data as you wish.
Since Slate knows nothing about your domain, it can't know how to parse pasted HTML content (or other content). So, by default whenever a user pastes content into a Slate editor, it will parse it as plain text. If you want it to be smarter about pasted content, you need to override the `insert_data` command and deserialize the `DataTransfer` object's `text/html` data as you wish.

### What browsers and devices does Slate support?

Expand Down
2 changes: 1 addition & 1 deletion docs/walkthroughs/04-applying-custom-formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const App = () => {

Okay, so we've got the hotkey handler setup... but! If you happen to now try selecting text and hitting `Ctrl-B`, you won't notice any change. That's because we haven't told Slate how to render a "bold" mark.

For every format you want to add to your schema, Slate will break up the text content into "leaves", and you need to tell Slate how to read it, just like for elements. So let's define a `Leaf` component:
For every format you add, Slate will break up the text content into "leaves", and you need to tell Slate how to read it, just like for elements. So let's define a `Leaf` component:

```js
// Define a React component to render leaves with bold text.
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
"slate-history": "*",
"slate-hyperscript": "*",
"slate-react": "*",
"slate-schema": "*",
"typescript": "^3.7.2"
}
}
2 changes: 1 addition & 1 deletion packages/slate-hyperscript/src/hyperscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type HyperscriptCreators<T = any> = Record<
/**
* `HyperscriptShorthands` are dictionaries of properties applied to specific
* kind of object, keyed by tag name. They allow you to easily define custom
* hyperscript tags for your schema.
* hyperscript tags for your domain.
*/

type HyperscriptShorthands = Record<string, Record<string, any>>
Expand Down
1 change: 0 additions & 1 deletion packages/slate-schema/Readme.md

This file was deleted.

38 changes: 0 additions & 38 deletions packages/slate-schema/package.json

This file was deleted.

Loading

0 comments on commit e68a5cd

Please sign in to comment.