1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-17 04:34:00 +02:00
Commit Graph

4195 Commits

Author SHA1 Message Date
Soreine
6b38caf72d Fix splitNode offset when undoing joinNode 2016-11-09 11:21:24 +01:00
Samy Pessé
4d33991358 Add method createFromRanges to Text 2016-11-09 10:26:33 +01:00
Soreine
49f6331075 Add marks option to Text.createFromString 2016-11-08 15:13:38 +01:00
Soreine
e28b76b709 Improve performance for Selection.hasEdgeIn methods 2016-11-07 18:41:51 +01:00
Soreine
44180c020e Remove memoization on Selection
All Selection methods use almost directly some Node methods which are
already memoized. This removes the needless overhead of memoization for
Selection, which changes often
2016-11-07 18:40:12 +01:00
Soreine
83fa16d451 Greatly improve performance of normalizeChildrenWith 2016-11-07 18:18:46 +01:00
Soreine
b54ddf10ce Add benchmark for Node.getTexts 2016-11-07 17:26:51 +01:00
Soreine
95cfc2f972 Optimize Node.getTexts to work on arrays 2016-11-07 17:23:08 +01:00
Soreine
4792a5e508 Cleaner default benchmark teardown 2016-11-07 17:14:28 +01:00
Soreine
c644e8d220 Fix forEachDescendant early exit 2016-11-07 16:56:52 +01:00
Soreine
1112066b17 Fix syntax 2016-11-07 16:15:23 +01:00
Samy Pessé
c94923d397 Merge pull request #5 from GitbookIO/memoization-global-disabler
Global memoization control, faster benchmark script
2016-11-07 15:51:18 +01:00
Soreine
f51189ce9a Fix teardown 2016-11-07 15:40:06 +01:00
Soreine
1424103975 Do not use window for globals. Expose clear/disable functions in utils/memoize 2016-11-07 15:40:06 +01:00
Soreine
bada4fa3f1 Add teardown for benchmarks, and adapt memoize-utils benchmark 2016-11-07 15:39:27 +01:00
Soreine
e505b7a159 Remove ludicrous amount of setup work that was needed to prevent memoization 2016-11-07 15:39:27 +01:00
Soreine
3d8000a53f Add global variable to disable memoization at any time 2016-11-07 15:39:27 +01:00
Soreine
d58d7a0e10 More efficient update of Selection.isBackward 2016-11-07 14:51:39 +01:00
Samy Pessé
550a17cf26 Add failing test for undo of joinNode 2016-11-03 18:46:00 +01:00
Samy Pessé
fed0a6dd3d Mark ES6 Map as global 2016-11-03 17:23:06 +01:00
Samy Pessé
4084cdf8c0 Merge pull request #3 from GitbookIO/schema-normalize-optims-node
Quick improvements for filterDescendants
2016-11-03 17:05:11 +01:00
Samy Pessé
af911fd0ff Use Node.forEachDescendant in Node.findDescendantDeep 2016-11-03 17:03:46 +01:00
Samy Pessé
738383cb3b Memoize getText on nodes 2016-11-03 13:06:07 +01:00
Samy Pessé
bf66749c4d Rollback getTexts to use a recursive method 2016-11-03 12:15:33 +01:00
Samy Pessé
663522139c Allow Node.forEachDescendant to exit early 2016-11-03 12:05:16 +01:00
Samy Pessé
6f90515c96 Use Node.forEachDescendant in Node.getKeys 2016-11-03 12:04:22 +01:00
Samy Pessé
1e7ff03897 Add method forEachDescendant and use it for filterDescendants and getTexts 2016-11-03 11:41:02 +01:00
Soreine
ce44724944 Implement memoize using native Maps
It should offer better performances, by avoiding comparing values using Immutable.is, and removing the small immutable object creation overhead.
2016-11-03 11:40:48 +01:00
Samy Pessé
4cc4535074 Always return early when schema has no decorators in getDescendantDecorators 2016-11-03 11:26:00 +01:00
Samy Pessé
d6beed6744 Improve rendering performance when schema has no decorators 2016-11-03 11:22:47 +01:00
Samy Pessé
a3b7b0789f Normalize the whole document in benchmarks 2016-11-03 11:02:57 +01:00
Samy Pessé
8bc8e45087 Add example for a large document 2016-11-03 10:39:40 +01:00
Soreine
580cb24623 Remove lint from npm run perf 2016-11-03 10:34:52 +01:00
Samy Pessé
ca14f242c2 Fix error in insertFragmentAtRange 2016-11-03 09:57:41 +01:00
Samy Pessé
57a62d1373 Merge pull request #2 from GitbookIO/schema-normalize-memoize-keys
Prevent memoize cache miss by passing "node.key" instead of "node"
2016-11-03 09:27:38 +01:00
Samy Pesse
6030ba4501 Change export of "is-dev" to be a constant to improve code compilation 2016-11-03 00:54:44 +01:00
Samy Pesse
5627447a21 Add notice of deprecation 2016-11-03 00:42:43 +01:00
Samy Pesse
25959c1e4e Replace all calls to memoized functions using nodes instead of keys 2016-11-03 00:32:01 +01:00
Samy Pesse
94d1a5434e Add warning when passing an node to a method accepting a key 2016-11-03 00:31:29 +01:00
Samy Pesse
4ffee3d749 Add source maps when running tests 2016-11-03 00:04:08 +01:00
Raffaele De Feo
beacdb0f55 Use isContentEditable HTML element property to check if an element
is editable.
2016-11-03 00:01:26 +01:00
Samy Pesse
ca67684bea Improve performances of "getPreviousSibling" and "getNextSibling" with memoization 2016-11-02 23:28:03 +01:00
Samy Pessé
91f481ba8d Accept Node as argument type for normalizeNodeByKey 2016-11-02 18:11:10 +01:00
Samy Pessé
20720a4190 Don't memoize some low level method 2016-11-02 18:07:13 +01:00
Samy Pessé
b7ad0ba55c Improve performances of normalizeChildrenWith by exiting if list are equals 2016-11-02 17:34:43 +01:00
Soreine
77385326f0 Revert "Remove extra LEAF in memoize"
It was breaking for variable argument length methods
This reverts commit 85ebf7fffa.
2016-11-02 17:23:56 +01:00
Soreine
a4460354c6 Use optional argument in memoize-util benchmark 2016-11-02 17:23:30 +01:00
Soreine
85ebf7fffa Remove extra LEAF in memoize 2016-11-02 16:51:20 +01:00
Soreine
9e830b3c6d Fix for memoize of recursive functions 2016-11-02 16:51:20 +01:00
Samy Pessé
a74fbd1390 Don't calcul range decorations in shouldComponentUpdate when schema has no decorations 2016-11-02 16:43:31 +01:00