Slate
ExamplesGitHubSlack
main
main
  • Introduction
  • Walkthroughs
    • Installing Slate
    • Adding Event Handlers
    • Defining Custom Elements
    • Applying Custom Formatting
    • Executing Commands
    • Saving to a Database
    • Enabling Collaborative Editing
    • Using the Bundled Source
  • Concepts
    • Interfaces
    • Nodes
    • Locations
    • Transforms
    • Operations
    • Commands
    • Editor
    • Plugins
    • Rendering
    • Serializing
    • Normalizing
    • TypeScript
    • Migrating
  • API
    • Transforms
    • Node Types
      • Editor
      • Element
      • Node
      • NodeEntry
      • Text
    • Location Types
      • Location
      • Path
      • PathRef
      • Point
      • PointEntry
      • PointRef
      • Range
      • RangeRef
      • Span
    • Operation Types
      • Operation
    • Scrubber
  • Libraries
    • Slate React
      • withReact
      • ReactEditor
      • Hooks
      • Slate Component
      • Editable Component
      • Event Handling
    • Slate History
      • withHistory
      • HistoryEditor
      • History
    • Slate Hyperscript
  • General
    • Resources
    • Contributing
    • Changelog
    • FAQ
Powered by GitBook
On this page
  • Reporting Bugs
  • Asking Questions
  • Submitting Pull Requests
  • Repository Setup
  • Running Examples
  • Running Tests
  • Running integration tests
  • Testing Input Methods
  • Publishing Releases
  • Publishing Normal @latest Release
  • Publishing @next Release
  • Publishing @experimental Release
  • Running Prerelease Script
  1. General

Contributing

PreviousResourcesNextChangelog

Last updated 1 year 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 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!

Repository Setup

To run the build, 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

Running Examples

Then you can start the examples server with:

yarn start

Running Tests

Then you can rerun the tests with:

yarn test

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

If you only want to run a specific test or tests, you can run yarn run test:mocha --fgrep="slate-react rendering" flag which will filter the tests being run by grepping for the string in each test. (This is a Mocha flag that gets passed through.)

In addition to tests you should also run the linter:

yarn lint

This will catch TypeScript, Prettier, and Eslint errors.

yarn fix

This will fix Prettier and Eslint errors.

Running integration tests

Testing Input Methods

Publishing Releases

Important: When creating releases using Lerna with the instructions below, you will be given choices around how to increase version numbers. You should always use a major, minor or patch release and must never use a prerelease. If a prerelease is used, the root package will not link to the packages in the packages directory creating hard to diagnose issues.

Publishing Normal @latest Release

yarn release:latest

And follow the prompts Lerna gives you.

Note that this will automatically run the prelease script first that will build, test and lint before attempting to publish.

Publishing @next Release

If we are unsure as to the stability of a release because there are significant changes and/or particularly complex changes, release with the @next tag.

yarn release:next

And follow the prompts Lerna gives you.

Publishing @experimental Release

If you need to create an experimental release to see how a published package will behave during an actual publish, release with the @experimental tag. End users should have no expectation that an @experimental release will be usable.

yarn release:experimental

Running Prerelease Script

If we want to make sure that Slate code follows the preparations for a release but without actually publishing, run:

yarn prerelease

Which will build, test and lint Slate code.

A that reproduces the bug with a minimal setup.

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

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.

The Slate repository is a monorepo that is managed with . Unlike more traditional repositories, this means that the repository must be built in order for tests, linting, or other common development activities to function as expected.

To run the examples, start by building the monorepo as described in the section.

To run the tests, start by building the monorepo as described in the section.

To run integrations with , first run yarn start to run the examples website, then run yarn playwright in a separate session to open the Playwright test suite. Or alternatively, run just yarn test:integration-local.

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

Since we use to manage the Slate packages this is fairly easy, just run:

JSFiddle
RecordIt
JSFiddle template for Slate
Slate Slack team
♥ help
lerna
Playwright
Here's a helpful page
Lerna
Contributing
Reporting Bugs
Asking Questions
Submitting Pull Requests
Repository Setup
Running Examples
Running Tests
Testing Input Methods
Publishing Releases
Publishing Normal @latest Release
Publishing @next Release
Publishing @experimental Release
Running Prerelease Script
Repository Setup
Repository Setup