Slate
ExamplesGitHubSlack
v0.47
v0.47
  • Introduction
  • Walkthroughs
    • Installing Slate
    • Adding Event Handlers
    • Defining Custom Block Nodes
    • Applying Custom Formatting
    • Using Plugins
    • Saving to a Database
    • Saving and Loading HTML Content
  • Guides
    • Commands & Queries
    • Data Model
    • Plugins
    • Rendering
    • Schemas
  • General
    • Plugins
    • Resources
    • Contributing
    • Changelog
    • FAQ
    • Glossary
  • Slate Core
    • Block
    • Commands
    • Data
    • Decoration
    • Document
    • Editor
    • Inline
    • Mark
    • Node
    • Operation
    • Plugins
    • Point
    • Range
    • Schema
    • Selection
    • Text
    • Utils
    • Value
  • Slate React
    • Editor
    • Plugins
    • Rendering
    • Utils
  • Other Packages
    • slate-html-serializer
    • slate-hyperscript
    • slate-plain-serializer
    • slate-prop-types
Powered by GitBook
On this page
  • Reporting Bugs
  • Asking Questions
  • Submitting Pull Requests
  • Running Examples
  • Running Tests
  • Running Benchmarks
  • Run Selected Benchmarks
  • Adding Browser Support
  • Testing Input Methods
  • Debugging Slate Methods
  • Publishing Releases
  1. General

Contributing

PreviousResourcesNextChangelog

Last updated 5 years ago

Want to contribute to Slate? That would be awesome!

Reporting Bugs

If you run into any weird behavior while using Slate, feel free to open a new issue in this repository! Please run a search before opening a new issue, to make sure that someone else hasn't already reported or solved the bug you've found.

Any issue you open must include:

  • A that reproduces the bug with a minimal setup.

  • A GIF showing the issue in action. (Using something like .)

  • A clear explanation of what the issue is.

Asking Questions

Please use the Slack instead of asking questions in issues, since we want to reserve issues for keeping track of bugs and features. We close questions in issues so that maintaining the project isn't overwhelming.

Submitting Pull Requests

Please include tests and docs with every pull request!

Running Examples

Running Tests

To run the tests, you need to have the Slate repository cloned to your computer. After that, you need to cd into the directory where you cloned it, and install the dependencies with yarn and build the monorepo:

yarn install
yarn build

Then run the tests with:

yarn test

To keep the source rebuilding on every file change, you need to run an additional watching command in a separate process:

yarn watch

If you need to debug something, you can add a debugger line to the source, and then run yarn test debug.

If you only want to run a specific test or tests, you can run yarn test --fgrep="slate-react rendering" flag which will filter the tests being run by grepping for the string in each test.

Running Benchmarks

To run the benchmarks, first make some changes to the source that you want to benchmark. Now that you're ready, you need to save a "baseline" for what the performance was before you made you change.

To do that, stash your changes and save the benchmarks:

git stash
yarn benchmark:save

Then once the reference has been saved, unstash your changes and run the benchmarks to see a comparison:

git stash pop
yarn benchmark

There will be some subtle changes in iteration speed always, but the comparison reporter will highlight any changes that seem meaningful. You can run benchmark multiple times to ensure the speed up persists.

Run Selected Benchmarks

To run selected benchmarks, create tmp/benchmark-config.js with module.exports.include. For example, to run slate-core benchmarks only with get-*, we can create a tmp/benchmark-config.js as

module.exports.include = {
  slate: /^get/
}

Adding Browser Support

Testing Input Methods

Debugging Slate Methods

Publishing Releases

npm run release

And follow the prompts Lerna gives you.

Here's a to get you started:

We've also got a where you can ask questions and get answers from other people using Slate:

All pull requests are super welcomed and greatly appreciated! Issues in need of a solution are marked with a label if you're looking for somewhere to start.

Check out the to see how to get the examples running locally!

Slate aims to targeted all of the modern browsers, and eventually the modern mobile platforms. Right now browser support is limited to the latest versions of , , and , but if you are interested in adding support for another modern platform, that is welcomed!

detailing how to test various input scenarios on Windows, Mac and Linux.

Slate makes use of to log information about various methods. You can by setting localStorage.debug = "*" (to log methods on all modules) or to a single namespace (e.g. slate:editor). Look for const debug = Debug('<namespace>') to get the namespace of various modules.

Since we use to manage the Slate packages this is fairly easy, but you must make sure you are using npm to run the release script, because using yarn results in failures. So just run:

JSFiddle template for Slate
Slate Slack team
♥ help please
Examples readme
Chrome
Firefox
Safari
Here's a helpful page
debug
enable the logger in the browser
Lerna
JSFiddle
RecordIt
Reporting Bugs
Asking Questions
Submitting Pull Requests
Running Examples
Running Tests
Running Benchmarks
Adding Browser Support
Testing Input Methods
Debugging Slate Methods
Publishing Releases