1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-09-09 06:30:40 +02:00

fix benchmarks

This commit is contained in:
Ian Storm Taylor
2019-05-01 20:14:06 -07:00
parent dbf6237caf
commit 45b6d245af
23 changed files with 66 additions and 78 deletions

View File

@@ -24,30 +24,37 @@ module.exports.input = (
<block type="level-one"> <block type="level-one">
<block type="level-two"> <block type="level-two">
<block type="coffee-container"> <block type="coffee-container">
<text />
<inline type="coffee"> <inline type="coffee">
Extra, brewed caffeine fair trade, whipped cup bar flavour grounds Extra, brewed caffeine fair trade, whipped cup bar flavour grounds
organic. Café au lait blue mountain cortado saucer, macchiato ut organic. Café au lait blue mountain cortado saucer, macchiato ut
that caramelization flavour. that caramelization flavour.
</inline> </inline>
<text />
<inline type="coffee"> <inline type="coffee">
Crema frappuccino so decaffeinated, sit café au lait irish Crema frappuccino so decaffeinated, sit café au lait irish
cultivar doppio café au lait. Dripper irish fair trade <anchor />kopi-luwak cultivar doppio café au lait. Dripper irish fair trade <anchor />kopi-luwak
ut beans skinny saucer. ut beans skinny saucer.
</inline> </inline>
<text />
</block> </block>
<block type="coffee-container"> <block type="coffee-container">
<text />
<inline type="coffee"> <inline type="coffee">
Half and half, irish rich sugar medium frappuccino spoon. Whipped, Half and half, irish rich sugar medium frappuccino spoon. Whipped,
caramelization, caffeine french press cinnamon variety rich redeye caramelization, caffeine french press cinnamon variety rich redeye
acerbic americano aftertaste. Shop crema filter seasonal, filter acerbic americano aftertaste. Shop crema filter seasonal, filter
aromatic, french press mazagran affogato cappuccino single origin. aromatic, french press mazagran affogato cappuccino single origin.
</inline> </inline>
<text>
Plunger pot aromatic, crema, cultivar french press, skinny and Plunger pot aromatic, crema, cultivar french press, skinny and
percolator so single origin. Id variety and cinnamon brewed flavour percolator so single origin. Id variety and cinnamon brewed
cultivar acerbic half and half et<focus /> cappuccino. flavour cultivar acerbic half and half et<focus /> cappuccino.
</text>
<inline type="coffee"> <inline type="coffee">
Cup qui a barista crema white kopi-luwak chicory trifecta. Cup qui a barista crema white kopi-luwak chicory trifecta.
</inline> </inline>
<text />
</block> </block>
</block> </block>
</block> </block>

View File

@@ -24,11 +24,9 @@ const value = (
<quote> <quote>
<paragraph> <paragraph>
<paragraph> <paragraph>
This is editable {i === 0 ? <anchor /> : ''}rich{i === 0 ? ( This is editable {i === 0 ? <anchor /> : null}rich{i === 0 ? (
<focus /> <focus />
) : ( ) : null}
''
)}{' '}
text, <i>much</i> better than a textarea! For reals. text, <i>much</i> better than a textarea! For reals.
</paragraph> </paragraph>
</paragraph> </paragraph>

View File

@@ -22,7 +22,7 @@ const value = (
<paragraph> <paragraph>
This is editable <b>rich</b> text, <i>much</i> better than a This is editable <b>rich</b> text, <i>much</i> better than a
textarea! textarea!
{i === 0 ? <cursor /> : ''} {i === 0 ? <cursor /> : null}
</paragraph> </paragraph>
</paragraph> </paragraph>
</quote> </quote>

View File

@@ -20,7 +20,7 @@ const value = (
<quote> <quote>
<paragraph> <paragraph>
<paragraph> <paragraph>
{i === 0 ? <cursor /> : ''} {i === 0 ? <cursor /> : null}
This is editable <b>rich</b> text, <i>much</i> better than a This is editable <b>rich</b> text, <i>much</i> better than a
textarea! textarea!
</paragraph> </paragraph>

View File

@@ -10,7 +10,7 @@ const fragment = (
<quote> <quote>
<paragraph> <paragraph>
This is editable <b>rich</b> text, <i>much</i> better than a textarea! This is editable <b>rich</b> text, <i>much</i> better than a textarea!
{i === 0 ? <cursor /> : ''} {i === 0 ? <cursor /> : null}
</paragraph> </paragraph>
</quote> </quote>
))} ))}

View File

@@ -10,7 +10,7 @@ const fragment = (
<quote key={`a${i}`}> <quote key={`a${i}`}>
<paragraph> <paragraph>
This is editable <b>rich</b> text, <i>much</i> better than a textarea! This is editable <b>rich</b> text, <i>much</i> better than a textarea!
{i === 0 ? <cursor /> : ''} {i === 0 ? <cursor /> : null}
</paragraph> </paragraph>
</quote> </quote>
))} ))}

View File

@@ -21,7 +21,7 @@ const value = (
<paragraph> <paragraph>
This is editable <b>rich</b> text, <i>much</i> better than a This is editable <b>rich</b> text, <i>much</i> better than a
textarea! textarea!
{i === 0 ? <cursor /> : ''} {i === 0 ? <cursor /> : null}
</paragraph> </paragraph>
</quote> </quote>
))} ))}

View File

@@ -21,9 +21,8 @@ const value = (
<paragraph> <paragraph>
<paragraph> <paragraph>
<text key={`T${i}`}> <text key={`T${i}`}>
This is editable <b>rich</b> text, <i>much</i> better than a This is editable rich text, much better than a textarea!
textarea! {i === 0 ? <cursor /> : null}
{i === 0 ? <cursor /> : ''}
</text> </text>
</paragraph> </paragraph>
</paragraph> </paragraph>

View File

@@ -24,7 +24,7 @@ const value = (
<quote> <quote>
<paragraph> <paragraph>
<paragraph> <paragraph>
{i === 0 ? <cursor /> : ''} {i === 0 ? <cursor /> : null}
This is editable <b>rich</b> text, <i>much</i> better than a This is editable <b>rich</b> text, <i>much</i> better than a
textarea! textarea!
</paragraph> </paragraph>

View File

@@ -15,13 +15,18 @@ const value = (
<quote> <quote>
<paragraph> <paragraph>
<paragraph> <paragraph>
<text />
<link>link text</link> <link>link text</link>
<text />
</paragraph> </paragraph>
<paragraph /> <paragraph />
<paragraph> <paragraph>
<paragraph> <paragraph>
<text />
<link>link text</link> <link>link text</link>
<text />
<text> more text after</text> <text> more text after</text>
<text />
</paragraph> </paragraph>
</paragraph> </paragraph>
</paragraph> </paragraph>

View File

@@ -24,7 +24,7 @@ const value = (
<quote> <quote>
<paragraph> <paragraph>
<paragraph> <paragraph>
{i === 0 ? <cursor /> : ''} {i === 0 ? <cursor /> : null}
This is editable <b>rich</b> text, <i>much</i> better than a This is editable <b>rich</b> text, <i>much</i> better than a
textarea! textarea!
</paragraph> </paragraph>

View File

@@ -21,9 +21,8 @@ const value = (
<paragraph> <paragraph>
<paragraph> <paragraph>
<text key={`T${i}`}> <text key={`T${i}`}>
{i === 0 ? <cursor /> : ''} {i === 0 ? <cursor /> : null}
This is editable <b>rich</b> text, <i>much</i> better than a This is editable rich text, much better than a textarea!
textarea!
</text> </text>
</paragraph> </paragraph>
</paragraph> </paragraph>

View File

@@ -22,7 +22,7 @@ const value = (
<paragraph> <paragraph>
This is editable <b>rich</b> text, <i>much</i> better than a This is editable <b>rich</b> text, <i>much</i> better than a
textarea! textarea!
{i === 0 ? <cursor /> : ''} {i === 0 ? <cursor /> : null}
</paragraph> </paragraph>
</paragraph> </paragraph>
</quote> </quote>

View File

@@ -25,7 +25,7 @@ const value = (
<paragraph> <paragraph>
<paragraph> <paragraph>
This This
{i === 0 ? <cursor /> : ''} {i === 0 ? <cursor /> : null}
is editable <b>rich</b> text, <i>much</i> better than a textarea! is editable <b>rich</b> text, <i>much</i> better than a textarea!
</paragraph> </paragraph>
</paragraph> </paragraph>

View File

@@ -7,26 +7,23 @@ module.exports.default = function(json) {
} }
const input = { const input = {
object: 'value',
document: { document: {
object: 'document',
nodes: Array.from(Array(100)).map(() => ({ nodes: Array.from(Array(100)).map(() => ({
type: 'list',
object: 'block', object: 'block',
type: 'list',
data: {}, data: {},
nodes: Array.from(Array(10)).map(() => ({ nodes: Array.from(Array(10)).map(() => ({
type: 'list-item',
object: 'block', object: 'block',
type: 'list-item',
data: {}, data: {},
nodes: [ nodes: [
{ {
leaves: [ object: 'text',
{
object: 'leaf',
marks: [], marks: [],
text: '', text: '',
}, },
],
object: 'text',
},
{ {
type: 'link', type: 'link',
object: 'inline', object: 'inline',
@@ -35,28 +32,18 @@ const input = {
}, },
nodes: [ nodes: [
{ {
leaves: [ object: 'text',
{
object: 'leaf',
marks: [], marks: [],
text: 'Some text for a link', text: 'Some text for a link',
}, },
], ],
},
{
object: 'text', object: 'text',
},
],
},
{
leaves: [
{
object: 'leaf',
marks: [], marks: [],
text: '', text: '',
}, },
], ],
object: 'text',
},
],
})), })),
})), })),
}, },

View File

@@ -18,29 +18,29 @@ const input = {
nodes: [ nodes: [
{ {
object: 'text', object: 'text',
leaves: [
{
text: 'This is editable ', text: 'This is editable ',
}, },
{ {
object: 'text',
text: 'rich', text: 'rich',
marks: [{ type: 'bold' }], marks: [{ type: 'bold' }],
}, },
{ {
object: 'text',
text: ' text, ', text: ' text, ',
}, },
{ {
object: 'text',
text: 'much', text: 'much',
marks: [{ type: 'italic' }], marks: [{ type: 'italic' }],
}, },
{ {
object: 'text',
text: ' better than a textarea!', text: ' better than a textarea!',
}, },
], ],
}, },
], ],
},
],
})), })),
}, },
} }

View File

@@ -19,8 +19,7 @@ const value = (
<paragraph> <paragraph>
<paragraph> <paragraph>
<text key={`T${i}`}> <text key={`T${i}`}>
This is editable <b>rich</b> text, <i>much</i> better than a This is editable rich text, much better than a textarea!
textarea!
</text> </text>
</paragraph> </paragraph>
</paragraph> </paragraph>

View File

@@ -19,8 +19,7 @@ const value = (
<paragraph> <paragraph>
<paragraph> <paragraph>
<text key={`T${i}`}> <text key={`T${i}`}>
This is editable <b>rich</b> text, <i>much</i> better than a This is editable rich text, much better than a textarea!
textarea!
</text> </text>
</paragraph> </paragraph>
</paragraph> </paragraph>

View File

@@ -19,8 +19,7 @@ const value = (
<paragraph> <paragraph>
<paragraph> <paragraph>
<text key={`T${i}`}> <text key={`T${i}`}>
This is editable <b>rich</b> text, <i>much</i> better than a This is editable rich text, much better than a textarea!
textarea!
</text> </text>
</paragraph> </paragraph>
</paragraph> </paragraph>

View File

@@ -19,8 +19,7 @@ const value = (
<paragraph> <paragraph>
<paragraph> <paragraph>
<text key={`T${i}`}> <text key={`T${i}`}>
This is editable <b>rich</b> text, <i>much</i> better than a This is editable rich text, much better than a textarea!
textarea!
</text> </text>
</paragraph> </paragraph>
</paragraph> </paragraph>

View File

@@ -19,8 +19,7 @@ const value = (
<paragraph> <paragraph>
<paragraph> <paragraph>
<text key={`T${i}`}> <text key={`T${i}`}>
This is editable <b>rich</b> text, <i>much</i> better than a This is editable rich text, much better than a textarea!
textarea!
</text> </text>
</paragraph> </paragraph>
</paragraph> </paragraph>

View File

@@ -19,8 +19,7 @@ const value = (
<paragraph> <paragraph>
<paragraph> <paragraph>
<text key={`T${i}`}> <text key={`T${i}`}>
This is editable <b>rich</b> text, <i>much</i> better than a This is editable rich text, much better than a textarea!
textarea!
</text> </text>
</paragraph> </paragraph>
</paragraph> </paragraph>

View File

@@ -19,8 +19,7 @@ const value = (
<paragraph> <paragraph>
<paragraph> <paragraph>
<text key={`T${i}`}> <text key={`T${i}`}>
This is editable <b>rich</b> text, <i>much</i> better than a This is editable rich text, much better than a textarea!
textarea!
</text> </text>
</paragraph> </paragraph>
</paragraph> </paragraph>