1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-01 05:16:10 +01:00

29 Commits

Author SHA1 Message Date
Jinxuan Zhu
58c644323f Add coverage test with mocha and codecov (#2037)
* Run mocha test with module alias

* Running test with babel module alias

* Fix model alias

* Fix model alias

* Resolve module alias

* Running test with babel module alias

* Connect to codecov

* add codecov to travis

* stop if yarn test has errors

* Still cannot collect data from slate modules

* Try to check whether it works with codecov

* Move config to nycrc

* Remove nyc require

* Update nyc to use src

* better before_script
2018-08-06 10:31:42 -07:00
Jinxuan Zhu
8f9bfdac2b Benchmark consistence && Allow users to select benches to run (#1765)
* Use slate rather than relative path

* Move benchmark to one dir

* Use slate-* instead of relative path

* Before and After Function

* Remove un-necessary cross-env

* Hard fix

* Lint the hard fix

* Reset memory in bench()

* Working on Benchmark Frameworks

* Rename to slate-dev-benchmark

* Add packages

* Fix prettier bug

* Benchmark framework is in working

* Do not log in test

* max times test

* mute logger in test

* add hr time

* Better support for maxTime; add support of split runs to save memory space

* Fix maxTries

* Add global.gc

* Global gc for each bench

* Better test interface

* Test max-time

* Test max-time done

* Add Benchmark among packages

* Starting to get benchmark running

* Pure Node lib

* Change babelrc for pure Node benchmark

* Moving Benchmarks

* Get benchmark and test running

* Get benchmark for slate-html-serializer

* add slate-react

* add slate/changes

* all benchmarks are converted

* Run benchmark by yarn

* Run benchmark with expose-gc

* Annotate Bench.js

* Do not bundle slate-dev-benchmark in rollup

* Add annotation

* Allow config file to enable part benchmark compare

* Add config for compare

* support compare.js

* Do not re-allocate memory; due to a large heap taken influence result

* Render with Decorations

* get active marks at range

* Fix bug in showing percents

* Fix percent showing bug

* chore: add more benches

* Better output of benchmark

* Fix linting

* decoration and normal as different benchmark test

* Fix deserialize benchmark

* README.md

* Fix Readme.md

* README.md

* block-spacing config

* safer user config loading

* use package.json to load package in test

* Consistent linting

* move components to parent directory

* Annotation styling in package

* margin line before multi-line block

* Fix naive bug

* Fix naive bug

* Fix a blank line

* only log user and hr

* Better name

* Better annotation for runBundleTasks

* Fix typo

* Better logger

* Move async to test

* Omit skip

* Only log the user space time

* Single line async sleep

* file name fix

* Fix annotation

* Better output of compare

* Remove get-characters(-at-range) benchmarks

* Restore emoji

* Capitalize types

* Remove compare to another area

* Add grep and config interface

* Linting files

* Linting benchmarks

* Linting benchmarks

* Update yarn.lock
2018-07-19 13:01:55 -07:00
Nikolay Kazakov
e464bd652e Updated gitignore file (#1830) 2018-05-10 19:00:46 -07:00
Ian Storm Taylor
bc524bd43a update webpack and rollup configs 2018-02-21 17:48:08 -08:00
Zach Schneider
2ebf3b462b Set up webpack configuration for building examples (#1642)
* Set up webpack configuration for building examples

* Configure react-hot-loader in development

* Improve config, set gh-pages to use examples/dist directory

* PR feedback

* Rename App.js in git
2018-02-21 17:19:56 -08:00
Ian Storm Taylor
c8387c67c8 update ignore files 2018-02-06 19:42:12 -08:00
Ian Storm Taylor
83ec966113 refactor rollup, prettier and benchmark configuration 2018-02-06 19:41:03 -08:00
Zach Schneider
228b97ff29 Switch to using Rollup for bundling (#1568)
* Implement first working rollup config for main slate pkg

* Convert slate-base64-serializer to rollup

* Convert slate-dev-logger to rollup

* Convert slate-html-serializer to rollup

* Convert slate-hyperscript to rollup

* Convert slate-plain-serializer to rollup

* Convert slate-prop-types to rollup

* Convert (mostly) slate-react to rollup

* Convert slate-simulator to rollup

* Misc cleanup and configuration tweaks/fixes

* Convert slate-schema-violations to rollup

* Successful rollup build for top-level examples

* Add plugin to replace process.env.NODE_ENV

* Only rebuild modules and dev examples in watch mode

* Enable sourcemaps for development builds

* Force debug to use browser version, remove builtins plugin

* Remove is-image from example
It relies on node `path` and wouldn't work well in-browser anyway

* Use browser version of react-dom/server

* Move stray require to import

* Configure examples to watch child package output

* Fix tests

* Remove unneeded preferBuiltins from resolve config

* Use more precise files array to ensure sourcemaps aren't included

* Use lodash instead of lodash.throttle
It's pulled in anyway since slate-react needs slate, so using the
minipackage actually causes code duplication

* Improve naming/fix UMD builds, update UMD doc

* Add rollup configs to linting, add a missing dep to package.json

* Use longform rollup CLI flags

* Add rollup-plugin-auto-external to reduce external module configuration

* Combine rollup config into a unioned helper

* Centralize to a single rollup configuration

* Update dist structure and package field naming for PR feedback

* Add comments and address PR feedback on rollup config

* i.e. -> e.g.

* Add some spacing to the configuration to improve readability

* Add a bit more spacing

* Remove umd from example Slate unpkg link
2018-02-02 15:46:36 -08:00
Ian Storm Taylor
ace9f47930 change slate to be a monorepo using lerna (#1106)
* init lerna, move files into ./packages

* move test files into ./packages

* more moving around

* fill out package.json files

* fixing imports

* more fixing of imports, and horribleness

* convert examples, fix linting errors

* add documentation

* update docs

* get tests passing

* update travis.yml

* update travis.yml

* update travis.yml

* update test script

* update travis.yml

* update scripts

* try simplifying travis.yml

* ocd stuff

* remove slate-core-test-helpers package

* add package readmes

* update reference docs structure

* refactor slate-simulator into its own package

* add docs for new packages

* update docs

* separate benchmarks into packages, and refactor them
2017-09-11 18:11:45 -07:00
Ian Storm Taylor
7470a6dd53 Expose transforms (#836)
* refactor to extract applyOperation util

* change handlers to receive transform instead of state

* change onChange to receive a transform, update rich-text example

* fix stack iterationg, convert check-list example

* convert code-highlighting, embeds, emojis examples

* change operations to use full paths, not indexes

* switch split and join to be recursive

* fix linter

* fix onChange calls

* make all operations invertable, add src/operations/* logic

* rename "join" to "merge"

* remove .length property of nodes

* fix node.getFragmentAtRange logic

* convert remaining examples, fix existing changes

* fix .apply() calls and tests

* change setSave and setIsNative transforms

* fix insert_text operations to include marks always

* cleanup and fixes

* fix node inheritance

* fix core onCut handler

* skip constructor in node inheritance

* cleanup

* change updateDescendant to updateNode

* add and update docs

* eliminate need for .apply(), change history to mutable

* add missing file

* add deprecation support to Transform objects

* rename "transform" to "change"

* update benchmark

* add deprecation util to logger

* update transform isNative attr

* fix remaining warn use

* simplify history checkpointing logic

* fix tests

* revert history to being immutable

* fix history

* fix normalize

* fix syntax error from merge
2017-09-05 18:03:41 -07:00
Dan Burzo
786050f732 Introduces state.activeMarks and has add/remove/toggleMark use it instead of state.marks (#990)
* WIP getting raw marks arrays from the current range

* Always handle marksRaw as Array, fixes tests/lint

* Clean up

* Fixes collapsed selection raw marks, simpler _every_ condition, harmonize toolbar buttons in rich-text example

* raw -> perCharacter

* Add tests for toggleMark collapsed selection

* Add .DS_Store to .gitignore

* Added test for toggleMark add in partially marked selection, with and without other marks

* Added docs for state.marksPerCharacter

* replace marksPerCharacter with activeMarks

* Update the other examples

* Clarify getActiveMarksAtRange

* AddMark/RemoveMark to use getActiveMarksByRange

* User activeMarks for toggle§MarkAtRange transform
2017-09-05 17:48:19 -07:00
Ian Storm Taylor
6ab686ae77 Refactor benchmarks (#675)
* first stab

* refactor to nanobench

* refactor to matcha

* use hand-rolled comparison logic, ugh

* update threshold

* remove unused dependencies

* remove benchmarks from travis ci
2017-03-21 17:38:39 -07:00
Ian Storm Taylor
ad2642a3b5 Add the Stack concept (#513)
* trying to get testing in browser to work

* add the "stack" concept

* remove old things from package.json

* minor fixes
2016-12-09 12:15:36 -08:00
Ian Storm Taylor
f138d66850 cleanup gitignore 2016-11-17 19:10:39 -08:00
Samy Pessé
afc413f5c7 Fix lint errors 2016-11-01 16:46:21 +01:00
Nicolas Gaborit
f1a5d6f3b4 Add benchmarks (#368)
* Add script for benchmark

* Add error handling

* Rename folder to perf/benchmarks

* Add README

* Avoid memoization between benchmark runs

* Handle multiple benchmark. Add setup to benchmarks

* Run benchmarks through Travis

* Add command line options for JSON output

* Add export to JSON, and comparison with reference

* Improve serialize and fix results display

* Add perf/ to .npmignore

* Print error message

* Create normal example for normalize

* Add normalize-document wide and deep

* Add split-block normal, deep and wide

* Add delete-backward benchmarks

* Fix too much newlines

* Use microtime for better results maybe?

* Print number of runs

* Add minSamples options for better accuracy

* Use babel-node to launch benchmarks

* Use jsdom-global instead of mocha-jsdom (deprecated)

* Add rendering benchmark example

* Fix jsdom usage.

* Use JSX because we can

* Only use on('cycle') that is called even on error

* Example of successive rendering benchmark

* Rename README, and explain how to add a benchmark

* Add C++11 to Travis to install microtime

* Update Readme.md # Understanding the results

* Try to fix Travis build with microtime

* Travis: use before_install

Instead of overwriting install

* Forgot to remove mocha-jsdom import

Thanks node_modules...

* Add jsdom as devDependency

(required as peer dependency by jsdom-global)

* Add --only option to run only a specific benchmark

* Print name onStart rather than at end
2016-10-24 15:06:17 -07:00
Ian Storm Taylor
a876d71c94 add dist back to gitignore 2016-09-14 17:02:35 -07:00
Benjamin Kniffler
60329c3838 Include dist files 2016-09-15 00:52:59 +02:00
Benjamin Kniffler
178983b69a Update gitignore, npmignore, readme 2016-09-14 02:01:17 +02:00
Samy Pessé
83fe23d7fc Use GitBook for documentation (#263)
* Use gitbook for documentation

* Add section about contributing in readme of docs
2016-08-23 18:24:26 -04:00
Ian Storm Taylor
99d1c283f0 add prod and dev examples 2016-07-29 12:44:35 -07:00
Ian Storm Taylor
174944a2c9 update gitignore 2016-07-20 14:38:23 -07:00
Ian Storm Taylor
a46dd61686 add disc make target for checking build size 2016-07-20 10:08:19 -07:00
Ian Storm Taylor
0c0eac9598 add bundled distribution 2016-07-20 09:45:46 -07:00
Ian Storm Taylor
ae38f6e3a8 add images, update readme 2016-06-28 09:06:06 -07:00
Ian Storm Taylor
3bf4c8b7b4 separate source maps into another file 2016-06-24 12:13:38 -07:00
Ian Storm Taylor
9fb8e674fd add dist to gitignore 2016-06-17 20:10:22 -07:00
Ian Storm Taylor
8636242931 add build.js to gitignore 2016-06-16 10:56:43 -07:00
Ian Storm Taylor
567884c9f2 first commit 2016-06-15 12:07:12 -07:00