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

1274 Commits

Author SHA1 Message Date
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
Soreine
0dc3c4ef8a Add memoize-util benchmark 2016-11-02 16:23:40 +01:00
Samy Pessé
13d7cb07c6 Improve unicity of uid used to generate keys 2016-11-02 15:52:37 +01:00
Samy Pessé
a9807c949b Add method to return all keys in a node 2016-11-02 15:52:36 +01:00
Soreine
ee29523789 Rewrite getFirstText to not use findDescendant 2016-11-02 12:35:31 +01:00
Soreine
cb333a4882 Rewrite getDescendant to be recursively memoized 2016-11-02 12:35:31 +01:00
Samy Pessé
afc413f5c7 Fix lint errors 2016-11-01 16:46:21 +01:00
Soreine
bc3fe73487 Merge branch 'schema-normalize-memoization' into schema-normalize 2016-11-01 16:33:14 +01:00
Soreine
17fa721801 Revert "Memoize Schema.__validate"
It's useless because we already compare with previous node in normalize

This reverts commit 6f49c3fcbc.
2016-11-01 15:51:21 +01:00
Soreine
6f49c3fcbc Memoize Schema.__validate 2016-11-01 15:50:44 +01:00
Samy Pessé
42b5e893a3 Use different build for test/lint/benchmarks 2016-11-01 15:20:04 +01:00
Samy Pessé
37d99e0edb Lint after running tests and benchmarks 2016-11-01 15:02:07 +01:00
Soreine
321a71ef25 Remove old validate methods 2016-11-01 14:56:02 +01:00
Soreine
f9eda89c33 Unmemoize filterDescendant 2016-11-01 14:35:44 +01:00
Samy Pessé
e9f05bc1b4 Don't normalize the selection twice when moving the cursor 2016-11-01 14:35:40 +01:00
Soreine
c50b124d58 Unmemoize getFurthest and make it use getAncestors 2016-11-01 14:33:14 +01:00
Soreine
966e2c472d Unmemoize getClosest 2016-11-01 14:28:45 +01:00
Soreine
5c6e4b944c Memoize getDescendantAtPath 2016-11-01 13:31:22 +01:00
Soreine
136867d240 Only lookup entry once on memoize cache hit 2016-11-01 13:27:38 +01:00
Soreine
fea1e69e72 Unmemoize findDescendant 2016-11-01 13:27:38 +01:00
Soreine
22dd861233 Small optimization for normalize
Avoid calling refreshNode needlessly
2016-11-01 13:27:38 +01:00
Samy Pessé
247e546b3b Fix error 💣 in shouldComponentUpdate 2016-11-01 13:24:50 +01:00