• Stars
    star
    234
  • Rank 171,630 (Top 4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Open source React components made with ❤️ by Doist

Reactist

Open source React components made with ❤️ by Doist.

npm version MIT Licence code style: prettier PRs Welcome

Check out our live demo. It includes all currently implemented components plus a live playground to interact with them in different states.

How to use reactist

You can add Reactist to your project by installing it from npm:

npm install @doist/reactist

To import a component within your code:

import { Loading } from '@doist/reactist'
//OR
import Loading from '@doist/reactist/dist/Loading'

You also need to load the CSS file of reactist somewhere in your app. For instance:

<link rel="stylesheet" type="text/css" href="./node_modules/@doist/reactist/styles/Loading.css" />

If you prefer to include static files grab the minified build from the dist folder.

<script src="./node_modules/@doist/reactist/dist/reactist.cjs.production.min.js"></script>
<link rel="stylesheet" type="text/css" href="./node_modules/@doist/reactist/styles/reactist.css" />

Changelog

You can find our changelog here.

Development

We leverage package.json's engines field to specify the node/npm versions to be used while in development. The easiest way to switch quickly is through fnm.

It's worth noting that fnm can automatically switch to a project's specified node version when it encounters a .nvmrc file. To do so, use the --use-on-cd flag when generating your shell's config script with fnm env.

Once fnm is installed, clone the repository. Then, switch to the required node version, and run its setup task:

git clone https://github.com/doist/reactist.git
cd reactist
fnm install
fnm use
npm run setup

The setup task will install dependencies and run various validations (linting, type checking, tests).

We identified two major modes of development for Reactist. First, running an interactive storybook and see the changes you make to a component in an isolated environment. This is especially helpful when developing new components. And second, improving existing components in real-life applications.

Creating new components

The development of new components is streamlined by the ability to generate new component templates using plop:

npm run plop component

This command will prompt you to provide all the information needed to create a new component template. The most important piece of information needed is the component name, which you can provide even as a phrase (e.g. "dropdown select" will generate a DropdownSelect component template).

The generated source files include the component implementation with sample props and styles, plus a small test file and storybook source files as well.

You also need to export your new component by adding a reference to it in the top-level index file.

Storybook

For the first development mode run:

npm run storybook

This boots up a development server with hot reloading on http://localhost:6006. You can iterate on the components in the existing stories or add a completely new one.

Inside your application

For the second development mode you can leverage npm link. First run:

npm run start

this will update the build artifacts whenever you change something.

In your real application you need to first delete the current @doist/reactist dependency and then link to your local one.

cd ~/your-app
# delete current reactist dependency
rm -rf ./node_modules/@doist/reactist

# link local reactist version
npm link ../reactist

The relative path to reactist may need to be changed to match your local environment.

To undo the changes and switch back to the reactist version from npm do the following:

cd ~/your-app
# first remove linked reactist dependency
rm -rf ./node_modules/@doist/reactist

# re-install reactist from npm (-E avoids updating the version / package-lock.json)
npm install -E @doist/reactist

Development tips and tricks

Independent of the development you operate in to produce a new build (e.g. before submitting a PR) run:

npm run build

Note: This will not update the docs. In case you want to update the docs you need to run:

npm run build:storybook

Testing

Tests are executed by running:

npm run test

During development you may find it beneficial to continuously execute the tests. This works by running:

npm run test -- --watch

MacOS users might need to upgrade watchman with brew install watchman when experiencing troubles with the watch mode. See this issue for details: jestjs/jest#1767

Chromatic visual regression tests

Reactist relies on Chromatic to run visual regression tests on our component during the CI step in GitHub.

Enable tests

To enable such tests, just add chromatic: { disableSnapshot: false } as a story parameter in your stories. Example:

<Canvas>
    <Story
        name="Main demo"
        parameters={{
            docs: { source: { type: 'code' } },
            chromatic: { disableSnapshot: false },
        }}
    >
        <BannerExamples theme="light" />
    </Story>
</Canvas>

We recommend you enable these tests on those Storybook stories that have several different variants of the component under testing. Enabling them on one or two stories per component should be sufficient in most cases (there's no need to enable them on all stories).

Review tests

When you open a GitHub PR, you'll notice the "UI Review" and "UI Tests" CI steps.

  • Clicking on "Details" will bring you to the Chromatic UI (if you don't already have a Chromatic account, please sign-up using your GitHub account).
  • Now you can review and accept your changes (or go back and change your code).
  • When you're happy with your changes, make sure to mark them as "Approved".

Releasing

A new version of reactist is published both on npm and GitHub Package Registry whenever a new release on GitHub is created.

Before merging your changes

In the GitHub PR that contains your new changes, make sure that you also include the following:

  1. Add tests for bugs and new feature

  2. Update relevant docs (storybooks, readme)

  3. Execute:

npm run validate

and make sure no errors nor warnings are shown

  1. Describe your changes in CHANGELOG.md

  2. Bump the version in package.json and package-lock.json by running:

npm --no-git-tag-version version <major|minor|patch>

ref

Note that the steps above are also documented in the PR template that you will be prompted with whenever you open a new reactist GitHub PR.

After merging your changes

Once your changes have been merged to main, create a new GitHub release:

  1. Visit https://github.com/Doist/reactist/releases/new

  2. In the "Choose a tag" dropdown, type the new release version (i.e. vX.Y.Z) and select "Create new tag: vX.Y.Z on publish"

  3. In the "Release title" field, type the new release version (i.e. vX.Y.Z)

  4. In the "Describe the release" box, paste the same content you added to the CHANGELOG.md, but without the title header

  5. Make sure the "Set as the latest release" checkbox is checked

  6. Click "Publish release"

  7. Visit https://github.com/Doist/reactist/actions

  8. Make sure that a new GitHub action is now running (this will automatically perform all the necessary steps to publish the package)

  9. Once the action is complete, check https://npmjs.com/package/@doist/reactist and verify that there's a new public release

Finally, be sure to update both todoist-web and twist-web to use the new reactist version you just published.

The storybook hosted on GitHub pages will be automatically updated on each push to main. Should there be a problem, try running the action manually from the Actions settings.

More Repositories

1

bitmapist

Powerful analytics and cohort library using Redis bitmaps
Python
925
star
2

todoist-python

DEPRECATED The official Todoist Python API library
Python
548
star
3

RecyclerViewExtensions

RecyclerView made easier.
Java
480
star
4

typist

The mighty Tiptap-based rich-text editor that powers Doist products.
TypeScript
454
star
5

redis_wrap

Implements a wrapper for Redis datatypes so they mimic the datatypes found in Python.
Python
146
star
6

todoist-api-python

A python wrapper for the Todoist REST API.
Python
143
star
7

redis_graph

Python graph database implemented on top of Redis
Python
131
star
8

ScriptCommunicator

Implementation of script communication that can be used to do long polling and JSONP communication
JavaScript
122
star
9

JobSchedulerCompat

Android library to schedule background jobs using JobScheduler, GCMNetworkManager or AlarmManager, depending on the context.
Java
120
star
10

JavaScript-memory-leak-checker

MemoryLeakChecker can check for data structure memory leaks in JavaScript
JavaScript
109
star
11

hash_ring

Implements consistent hashing in Python (using md5 as hashing function)
Python
105
star
12

ffs

Feature flags solution that is fast, lean, and open-source.
Kotlin
87
star
13

bitmapist-server

Memory-efficient standalone server for bitmapist library
Go
86
star
14

powerapp

A tool to extend the functionality of your Todoist account by integrating it with third-party applications
CSS
59
star
15

todoist-api-typescript

A TypeScript wrapper for the Todoist REST API.
TypeScript
52
star
16

python-timezones

A Python library that provides better selection of common timezones
Python
51
star
17

redis_simple_queue

Python queue implemented on top of Redis
Python
43
star
18

crash_hound

Monitor anything and get free notifications directly on your iPhone
Python
37
star
19

raven-sh

raven-sh is wrapper executing a command and sending its stdout/stderr to the Sentry server. Useful for cron jobs
Python
34
star
20

doistx-normalize

Kotlin Multiplatform (KMP) library for string unicode normalization
Kotlin
32
star
21

ICE

The Lightweight JavaScript library
JavaScript
31
star
22

java-kotlin-code-styles

IntelliJ IDEA code style settings for Doist's Java and Android projects.
Shell
30
star
23

sqs-workers

SQS Workers
Python
30
star
24

cronwrap

A cron job wrapper that wraps jobs and enables better error reproting and command timeouts.
Python
29
star
25

coffee-watcher

A script that can watch a directory and recompile CoffeeScript scripts if they change
CSS
26
star
26

AndroidMaterial

Material design compatibility library with samples.
Java
23
star
27

py_static_check

py_static_check can statically check your Python code for a lot of common errors
Python
22
star
28

TodoistPojos

Todoist POJOs for Java and Android applications.
Kotlin
21
star
29

bitmapist4

Next incarnation of bitmapist: powerful analytics and cohort library using Redis bitmaps
Python
21
star
30

unfurlist

unfurlist is a web service to unfurl urls
Go
21
star
31

ormist

Yet another Object-to-Redis mapper. Lightweight. Schema-agnostic.
Python
19
star
32

redis-bus

A Redis-based inter-service communication bus with autodiscovery and cache.
Python
19
star
33

css_image_concat

A script that can concat images into one image and create a CSS file.
Python
18
star
34

less-watcher

A script that can watch a directory and recompile .less scripts if they change.
CSS
17
star
35

commonmark-spannable-android

Java
17
star
36

resources

A fixture lifecycle management library
Python
17
star
37

avoid_disaster

Script backups easily to S3 using Python
Python
17
star
38

react-interpolate

A string interpolation component that formats and interpolates a template string in a safe way.
JavaScript
13
star
39

oauthist

OAuth2 framework with Redis backend to implement authorization and resource servers
Python
13
star
40

media-parser

oEmbed library for JavaScript with a few additional non-oEmbed sources
CoffeeScript
12
star
41

fixedlist

Fast performance fixed list for Redis
Python
12
star
42

changelog-gradle-plugin

Changelog Gradle plugin
Kotlin
10
star
43

DateTimePicker

Port of Android API 22 date and time pickers for 16+ APIs
Java
10
star
44

media-embed-server

oEmbed proxy in JavaScript that support a few additional non-oEmbed sources
CoffeeScript
10
star
45

AJS

The ultra lightweight JavaScript library
JavaScript
8
star
46

todoist-quickadd

Add Todoist QuickAdd anywhere on the web
TypeScript
8
star
47

IDBStorage

IndexedDB as key-value storage
JavaScript
8
star
48

todoist-integration-examples

This repository holds some code examples on how to build an integration for Todoist.
TypeScript
6
star
49

ElementStore

Standalone implementation of jQuery.data
JavaScript
6
star
50

ktlint-gradle-plugin

Kotlin
5
star
51

react-selector

React Selector is a React component that allows to filter and move item between two lists.
CoffeeScript
5
star
52

rqw

Redis Queue Worker
Go
5
star
53

python-cjson

Improved fork of https://pypi.python.org/pypi/python-cjson
C
5
star
54

watcher_lib

A library that can watch a directory and recompile files if they change. Can be used to build watcher scripts such as less-watcher or coffee-watcher.
CSS
5
star
55

cookiecutter-python-project

Use this cookiecutter template 🍪 to start every new Python project at Doist
Python
5
star
56

metric-watcher

UDP and HTTP servers to collect and display user-bound metrics
CoffeeScript
5
star
57

TodoistMarkup

Todoist markup for Java and Android applications.
Java
4
star
58

node.magic_dom

node.magic_dom: A DSL for building HTML in node.js
JavaScript
4
star
59

memcached_lock

Implements a distributed transaction using memcached or a memcached compatible storage.
Python
4
star
60

kotlin-warning-baseline

Kotlin
3
star
61

autoreload_prime

An auto reload module that should work with most servers (patched from Tornado)
Python
3
star
62

powerapp-pocket

A PowerApp service for Todoist -> pocket integration
Python
3
star
63

renovate-config

Shareable Renovate config templates - https://docs.renovatebot.com/config-presets/
3
star
64

version-name-gradle-plugin

Gradle plugin to use git tags as project version names
Kotlin
3
star
65

ui-extensions

TypeScript
3
star
66

gulpist

Static asset build tool for Doist
JavaScript
3
star
67

TodoistMimeUtils

Easily guessing mime types from filenames and streams in Java.
Java
3
star
68

agglog

Centralized log viewer which allows to see log tails of multiple connected servers
Go
3
star
69

PipelinesTemplates

Job and step templates for Azure Pipelines
Ruby
3
star
70

pdfsvc

html to pdf conversion service
Go
3
star
71

DoistEmojiMap

The json map to convert shortcuts to emoji
2
star
72

ScriptCommunicatorCROS

Implementation of script communication that can be used to do long polling (comet) and JSONP communication. Uses Cross-Origin Resource Sharing
JavaScript
2
star
73

detekt-rules

Detekt rules for Doist Kotlin projects
Kotlin
2
star
74

prettier-config

Prettier config for Doist's JavaScript and TypeScript projects
JavaScript
2
star
75

timethat

timeit on steroids, a module for benchmarking
Python
2
star
76

remark-application-links

remark plugin to detect and parse application links
TypeScript
2
star
77

twist-integration-examples

The repository for sample Twist integrations
Go
2
star
78

bentocss

CSS
2
star
79

TodoistMediaParser

Parses media links for more information like a thumbnail url, type and mime type.
Java
2
star
80

webpage-info

Return a webpage's title and favicon
CoffeeScript
2
star
81

todoist-google-sheets

UI Extension for Todoist that exports projects to Google Sheets
TypeScript
2
star
82

pagetest

Tool that outputs http(s) timings for certain page and its linked resources
Go
2
star
83

elasticache-redis-cost

Find AWS ElastiCache instance types that can fit existing Redis instances and see how much it will cost
Go
1
star
84

bitbuckethook

web server handling POST hooks from bitbucket.org.
Go
1
star
85

bitpusher

Command bitpusher forwards udp packets with userid/events to bitmapist instance
Go
1
star
86

optimize-images-action

GitHub Action that applies lossless image optimization.
Ruby
1
star
87

commonmark-ext-replacement

Java
1
star
88

kotlinx.time

Kotlin cross-platform API for dates, times, instants and durations
Kotlin
1
star
89

s3logger

Go
1
star
90

twist-post-action

GitHub action that posts a message to Twist thread.
1
star
91

android-translations-check

Android translations check Gradle plugin
Kotlin
1
star
92

redis-cluster-mock

Redis Cluster for testing purposes only.
Shell
1
star
93

cloudwatchlogs-relay

rsyslogd helper that forwards messages to CloudWatch Logs
Go
1
star
94

twistbot

Package providing abstractions to build http endpoints working as Twist bot integrations
Go
1
star
95

ChromaKey

A background for chroma key compositions of Android devices.
Java
1
star