Skip to content

Commit

Permalink
fix benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
ianstormtaylor committed May 2, 2019
1 parent dbf6237 commit 45b6d24
Show file tree
Hide file tree
Showing 23 changed files with 66 additions and 78 deletions.
13 changes: 10 additions & 3 deletions benchmark/slate-react/rendering/large-with-selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,37 @@ module.exports.input = (
<block type="level-one">
<block type="level-two">
<block type="coffee-container">
<text />
<inline type="coffee">
Extra, brewed caffeine fair trade, whipped cup bar flavour grounds
organic. Café au lait blue mountain cortado saucer, macchiato ut
that caramelization flavour.
</inline>
<text />
<inline type="coffee">
Crema frappuccino so decaffeinated, sit café au lait irish
cultivar doppio café au lait. Dripper irish fair trade <anchor />kopi-luwak
ut beans skinny saucer.
</inline>
<text />
</block>
<block type="coffee-container">
<text />
<inline type="coffee">
Half and half, irish rich sugar medium frappuccino spoon. Whipped,
caramelization, caffeine french press cinnamon variety rich redeye
acerbic americano aftertaste. Shop crema filter seasonal, filter
aromatic, french press mazagran affogato cappuccino single origin.
</inline>
Plunger pot aromatic, crema, cultivar french press, skinny and
percolator so single origin. Id variety and cinnamon brewed flavour
cultivar acerbic half and half et<focus /> cappuccino.
<text>
Plunger pot aromatic, crema, cultivar french press, skinny and
percolator so single origin. Id variety and cinnamon brewed
flavour cultivar acerbic half and half et<focus /> cappuccino.
</text>
<inline type="coffee">
Cup qui a barista crema white kopi-luwak chicory trifecta.
</inline>
<text />
</block>
</block>
</block>
Expand Down
6 changes: 2 additions & 4 deletions benchmark/slate/changes/add-mark.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ const value = (
<quote>
<paragraph>
<paragraph>
This is editable {i === 0 ? <anchor /> : ''}rich{i === 0 ? (
This is editable {i === 0 ? <anchor /> : null}rich{i === 0 ? (
<focus />
) : (
''
)}{' '}
) : null}
text, <i>much</i> better than a textarea! For reals.
</paragraph>
</paragraph>
Expand Down
2 changes: 1 addition & 1 deletion benchmark/slate/changes/delete-backward.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const value = (
<paragraph>
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
{i === 0 ? <cursor /> : ''}
{i === 0 ? <cursor /> : null}
</paragraph>
</paragraph>
</quote>
Expand Down
2 changes: 1 addition & 1 deletion benchmark/slate/changes/delete-forward.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const value = (
<quote>
<paragraph>
<paragraph>
{i === 0 ? <cursor /> : ''}
{i === 0 ? <cursor /> : null}
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
</paragraph>
Expand Down
2 changes: 1 addition & 1 deletion benchmark/slate/changes/insert-fragment-large.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const fragment = (
<quote>
<paragraph>
This is editable <b>rich</b> text, <i>much</i> better than a textarea!
{i === 0 ? <cursor /> : ''}
{i === 0 ? <cursor /> : null}
</paragraph>
</quote>
))}
Expand Down
2 changes: 1 addition & 1 deletion benchmark/slate/changes/insert-fragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const fragment = (
<quote key={`a${i}`}>
<paragraph>
This is editable <b>rich</b> text, <i>much</i> better than a textarea!
{i === 0 ? <cursor /> : ''}
{i === 0 ? <cursor /> : null}
</paragraph>
</quote>
))}
Expand Down
2 changes: 1 addition & 1 deletion benchmark/slate/changes/insert-node-by-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const value = (
<paragraph>
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
{i === 0 ? <cursor /> : ''}
{i === 0 ? <cursor /> : null}
</paragraph>
</quote>
))}
Expand Down
5 changes: 2 additions & 3 deletions benchmark/slate/changes/insert-text-by-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ const value = (
<paragraph>
<paragraph>
<text key={`T${i}`}>
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
{i === 0 ? <cursor /> : ''}
This is editable rich text, much better than a textarea!
{i === 0 ? <cursor /> : null}
</text>
</paragraph>
</paragraph>
Expand Down
2 changes: 1 addition & 1 deletion benchmark/slate/changes/insert-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const value = (
<quote>
<paragraph>
<paragraph>
{i === 0 ? <cursor /> : ''}
{i === 0 ? <cursor /> : null}
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
</paragraph>
Expand Down
5 changes: 5 additions & 0 deletions benchmark/slate/changes/normalize-with-problems.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ const value = (
<quote>
<paragraph>
<paragraph>
<text />
<link>link text</link>
<text />
</paragraph>
<paragraph />
<paragraph>
<paragraph>
<text />
<link>link text</link>
<text />
<text> more text after</text>
<text />
</paragraph>
</paragraph>
</paragraph>
Expand Down
2 changes: 1 addition & 1 deletion benchmark/slate/changes/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const value = (
<quote>
<paragraph>
<paragraph>
{i === 0 ? <cursor /> : ''}
{i === 0 ? <cursor /> : null}
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
</paragraph>
Expand Down
5 changes: 2 additions & 3 deletions benchmark/slate/changes/remove-node-by-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ const value = (
<paragraph>
<paragraph>
<text key={`T${i}`}>
{i === 0 ? <cursor /> : ''}
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
{i === 0 ? <cursor /> : null}
This is editable rich text, much better than a textarea!
</text>
</paragraph>
</paragraph>
Expand Down
2 changes: 1 addition & 1 deletion benchmark/slate/changes/set-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const value = (
<paragraph>
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
{i === 0 ? <cursor /> : ''}
{i === 0 ? <cursor /> : null}
</paragraph>
</paragraph>
</quote>
Expand Down
2 changes: 1 addition & 1 deletion benchmark/slate/changes/split-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const value = (
<paragraph>
<paragraph>
This
{i === 0 ? <cursor /> : ''}
{i === 0 ? <cursor /> : null}
is editable <b>rich</b> text, <i>much</i> better than a textarea!
</paragraph>
</paragraph>
Expand Down
33 changes: 10 additions & 23 deletions benchmark/slate/models/from-json-big.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,22 @@ module.exports.default = function(json) {
}

const input = {
object: 'value',
document: {
object: 'document',
nodes: Array.from(Array(100)).map(() => ({
type: 'list',
object: 'block',
type: 'list',
data: {},
nodes: Array.from(Array(10)).map(() => ({
type: 'list-item',
object: 'block',
type: 'list-item',
data: {},
nodes: [
{
leaves: [
{
object: 'leaf',
marks: [],
text: '',
},
],
object: 'text',
marks: [],
text: '',
},
{
type: 'link',
Expand All @@ -35,26 +32,16 @@ const input = {
},
nodes: [
{
leaves: [
{
object: 'leaf',
marks: [],
text: 'Some text for a link',
},
],
object: 'text',
marks: [],
text: 'Some text for a link',
},
],
},
{
leaves: [
{
object: 'leaf',
marks: [],
text: '',
},
],
object: 'text',
marks: [],
text: '',
},
],
})),
Expand Down
38 changes: 19 additions & 19 deletions benchmark/slate/models/from-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ const input = {
nodes: [
{
object: 'text',
leaves: [
{
text: 'This is editable ',
},
{
text: 'rich',
marks: [{ type: 'bold' }],
},
{
text: ' text, ',
},
{
text: 'much',
marks: [{ type: 'italic' }],
},
{
text: ' better than a textarea!',
},
],
text: 'This is editable ',
},
{
object: 'text',
text: 'rich',
marks: [{ type: 'bold' }],
},
{
object: 'text',
text: ' text, ',
},
{
object: 'text',
text: 'much',
marks: [{ type: 'italic' }],
},
{
object: 'text',
text: ' better than a textarea!',
},
],
},
Expand Down
3 changes: 1 addition & 2 deletions benchmark/slate/models/get-ancestors.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ const value = (
<paragraph>
<paragraph>
<text key={`T${i}`}>
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
This is editable rich text, much better than a textarea!
</text>
</paragraph>
</paragraph>
Expand Down
3 changes: 1 addition & 2 deletions benchmark/slate/models/get-common-ancestor.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ const value = (
<paragraph>
<paragraph>
<text key={`T${i}`}>
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
This is editable rich text, much better than a textarea!
</text>
</paragraph>
</paragraph>
Expand Down
3 changes: 1 addition & 2 deletions benchmark/slate/models/get-descendant.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ const value = (
<paragraph>
<paragraph>
<text key={`T${i}`}>
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
This is editable rich text, much better than a textarea!
</text>
</paragraph>
</paragraph>
Expand Down
3 changes: 1 addition & 2 deletions benchmark/slate/models/get-furthest-ancestor.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ const value = (
<paragraph>
<paragraph>
<text key={`T${i}`}>
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
This is editable rich text, much better than a textarea!
</text>
</paragraph>
</paragraph>
Expand Down
3 changes: 1 addition & 2 deletions benchmark/slate/models/get-parent.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ const value = (
<paragraph>
<paragraph>
<text key={`T${i}`}>
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
This is editable rich text, much better than a textarea!
</text>
</paragraph>
</paragraph>
Expand Down
3 changes: 1 addition & 2 deletions benchmark/slate/models/get-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ const value = (
<paragraph>
<paragraph>
<text key={`T${i}`}>
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
This is editable rich text, much better than a textarea!
</text>
</paragraph>
</paragraph>
Expand Down
3 changes: 1 addition & 2 deletions benchmark/slate/models/has-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ const value = (
<paragraph>
<paragraph>
<text key={`T${i}`}>
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
This is editable rich text, much better than a textarea!
</text>
</paragraph>
</paragraph>
Expand Down

0 comments on commit 45b6d24

Please sign in to comment.