Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): use MarkdownPlugin instead of behaviors={[...]} #8473

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

christianhg
Copy link
Member

Description

PTE has a new concept of @portabletext/editor/plugins which, going forward, will be the preferred way to add additional Behaviors to the editor. The benefit is that you don't have to manually import and remember to spread the coreBehaviors when configuring the initialConfig.behaviors array.

What to review

Markdown Behaviors should still work, but feel free to take them for a spin to be sure.

Testing

n/a

Notes for release

n/a

PTE has a new concept of `@portabletext/editor/plugins` which, going forward,
will be the preferred way to add additional Behaviors to the editor. The
benefit is that you don't have to manually import and remember to spread the
`coreBehaviors` when configuring the `initialConfig.behaviors` array.
@christianhg christianhg requested a review from a team as a code owner February 3, 2025 10:11
@christianhg christianhg requested review from pedrobonamin and removed request for a team February 3, 2025 10:12
Copy link

vercel bot commented Feb 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 3, 2025 10:18am
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 3, 2025 10:18am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 3, 2025 10:18am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Feb 3, 2025 10:18am
test-next-studio ⬜️ Ignored (Inspect) Feb 3, 2025 10:18am

Copy link
Contributor

github-actions bot commented Feb 3, 2025

No changes to documentation

Copy link
Contributor

@pedrobonamin pedrobonamin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to update the docs to reflect this change? This wasn't user configurable yet right?

@christianhg
Copy link
Member Author

Do we need to update the docs to reflect this change? This wasn't user configurable yet right?

It's purely internal for now so no need to update any docs.

@christianhg christianhg enabled auto-merge February 3, 2025 10:19
Copy link
Contributor

github-actions bot commented Feb 3, 2025

Component Testing Report Updated Feb 3, 2025 10:22 AM (UTC)

❌ Failed Tests (1) -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 3s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 12s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ❌ Failed (Inspect) 1m 19s 5 0 1
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 51s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 14s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 1m 6s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 31s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 2m 2s 21 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 12s 3 9 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 1m 42s 21 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 0s 0 3 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 0s 0 3 0

Copy link
Contributor

github-actions bot commented Feb 3, 2025

⚡️ Editor Performance Report

Updated Mon, 03 Feb 2025 10:23:46 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 27.8 efps (36ms) 25.6 efps (39ms) +3ms (+8.3%)
article (body) 72.5 efps (14ms) 63.3 efps (16ms) +2ms (-/-%)
article (string inside object) 26.3 efps (38ms) 25.0 efps (40ms) +2ms (+5.3%)
article (string inside array) 23.8 efps (42ms) 22.0 efps (46ms) +4ms (+8.3%)
recipe (name) 50.0 efps (20ms) 52.6 efps (19ms) -1ms (-5.0%)
recipe (description) 55.6 efps (18ms) 55.6 efps (18ms) +0ms (-/-%)
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
synthetic (title) 19.4 efps (52ms) 19.2 efps (52ms) +1ms (+1.0%)
synthetic (string inside object) 18.3 efps (55ms) 20.0 efps (50ms) -5ms (-8.3%)

efps — editor "frames per second". The number of updates assumed to be possible within a second.

Derived from input latency. efps = 1000 / input_latency

Detailed information

🏠 Reference result

The performance result of sanity@latest

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 36ms 42ms 65ms 389ms 751ms 9.8s
article (body) 14ms 18ms 38ms 147ms 216ms 5.4s
article (string inside object) 38ms 41ms 47ms 174ms 139ms 7.2s
article (string inside array) 42ms 45ms 50ms 252ms 262ms 7.1s
recipe (name) 20ms 21ms 24ms 41ms 0ms 7.2s
recipe (description) 18ms 19ms 21ms 46ms 0ms 4.5s
recipe (instructions) 5ms 6ms 7ms 9ms 0ms 3.0s
synthetic (title) 52ms 54ms 57ms 104ms 478ms 12.5s
synthetic (string inside object) 55ms 58ms 66ms 442ms 1199ms 8.4s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 39ms 42ms 58ms 437ms 387ms 10.7s
article (body) 16ms 19ms 38ms 77ms 428ms 6.1s
article (string inside object) 40ms 43ms 53ms 300ms 364ms 7.4s
article (string inside array) 46ms 48ms 52ms 180ms 467ms 7.4s
recipe (name) 19ms 21ms 23ms 53ms 2ms 7.0s
recipe (description) 18ms 21ms 22ms 46ms 0ms 4.7s
recipe (instructions) 5ms 7ms 8ms 20ms 0ms 3.0s
synthetic (title) 52ms 56ms 60ms 201ms 936ms 12.9s
synthetic (string inside object) 50ms 53ms 72ms 499ms 1085ms 8.1s

📚 Glossary

column definitions

  • benchmark — the name of the test, e.g. "article", followed by the label of the field being measured, e.g. "(title)".
  • latency — the time between when a key was pressed and when it was rendered. derived from a set of samples. the median (p50) is shown to show the most common latency.
  • p75 — the 75th percentile of the input latency in the test run. 75% of the sampled inputs in this benchmark were processed faster than this value. this provides insight into the upper range of typical performance.
  • p90 — the 90th percentile of the input latency in the test run. 90% of the sampled inputs were faster than this. this metric helps identify slower interactions that occurred less frequently during the benchmark.
  • p99 — the 99th percentile of the input latency in the test run. only 1% of sampled inputs were slower than this. this represents the worst-case scenarios encountered during the benchmark, useful for identifying potential performance outliers.
  • blocking time — the total time during which the main thread was blocked, preventing user input and UI updates. this metric helps identify performance bottlenecks that may cause the interface to feel unresponsive.
  • test duration — how long the test run took to complete.

@christianhg
Copy link
Member Author

Do we need to update the docs to reflect this change? This wasn't user configurable yet right?

It's purely internal for now so no need to update any docs.

Hi @pedrobonamin . Any chance this can get merged?

Copy link
Contributor

@pedrobonamin pedrobonamin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed your previous comment, please go ahead 😄

@christianhg christianhg added this pull request to the merge queue Feb 6, 2025
Merged via the queue into next with commit a91c165 Feb 6, 2025
56 checks passed
@christianhg christianhg deleted the fix-register-markdown-behaviors branch February 6, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants