1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-31 19:01:54 +02:00

Experimental chunking optimisation and other performance improvements (#5871)

* Chunking optimization

* Fix comments

* Remove redundant `insertionsMinusRemovals` variable

* Fix typo

* Unblock Netlify builds

* Add placeholder

* Upgrade Playwright (fixes crash when debugging)

* Fix `autoFocus` not working

* Fix huge document test

* Fix the previous issue without changing `useSlateSelector`

* Retry `test:integration`

* Re-implement `useSlateWithV`

* Retry `test:integration`

* Update docs

* Update JS examples to match TS examples

* Upload Playwright's `test-results` directory in CI to access traces

* Change trace mode to `retain-on-first-failure`

* Fix: `Locator.fill(text)` is flaky on Editable

* Add changesets

* Increase minimum `slate-dom` version

* Update changeset

* Update 09-performance.md

* Deprecate the `useSlateWithV` hook

* Fix errors and improve clarity in 09-performance.md

* Minimum `slate-dom` version is now 0.116

* Update `yarn.lock`
This commit is contained in:
Joe Anderson
2025-06-07 00:42:11 +01:00
committed by GitHub
parent 583d28fe13
commit fb87646e86
65 changed files with 5234 additions and 876 deletions

View File

@@ -10,6 +10,10 @@ body {
margin: 0;
}
h1 {
margin-top: 0;
}
p {
margin: 0;
}
@@ -56,7 +60,8 @@ td {
border: 2px solid #ddd;
}
input {
input[type='text'],
input[type='search'] {
box-sizing: border-box;
font-size: 0.85em;
width: 100%;
@@ -65,7 +70,8 @@ input {
background: #fafafa;
}
input:focus {
input[type='text']:focus,
input[type='search']:focus {
outline: 0;
border-color: blue;
}
@@ -75,7 +81,12 @@ iframe {
border: 1px solid #eee;
}
[data-slate-editor] > * + * {
details > summary {
user-select: none;
}
[data-slate-editor] > * + *,
[data-slate-chunk] > * + * {
margin-top: 1em;
}
@@ -89,3 +100,27 @@ iframe {
outline-offset: -20px;
white-space: pre-wrap;
}
.performance-controls {
padding: 20px;
margin: -20px -20px 20px -20px;
background-color: white;
position: sticky;
top: 0;
z-index: 1;
border-bottom: 1px solid lightgrey;
max-height: 50vh;
overflow-y: auto;
}
.performance-controls > * {
margin-top: 10px;
}
.performance-controls > details > :not(summary) {
margin-left: 10px;
}
.performance-controls p {
margin-top: 5px;
}