test: prove the new render pipeline replicates the legacy DOM for text blocks#2793
Draft
christianhg wants to merge 1 commit into
Draft
test: prove the new render pipeline replicates the legacy DOM for text blocks#2793christianhg wants to merge 1 commit into
christianhg wants to merge 1 commit into
Conversation
…t blocks Renders a battery of text-block values through the legacy pipeline (no render callbacks, engine default) and the new `defineX` pipeline (a `defineTextBlock` catch-all reconstructing that default), normalizes both DOM trees (tag + sorted attributes + children), and asserts they are equal. Proves the new pipeline reproduces the legacy DOM 1:1 on the surface that carries forward: the `pt-block`/`pt-text-block` class taxonomy, the `data-block-*`/`data-list-item`/`data-level`/`data-style` attributes, the `data-pt-*` attributes, and the full element structure. The `data-slate-*` namespace is excluded by design: opting into the new pipeline is a clean break, emitting only `data-pt-*` and never the Slate-named attributes. The legacy pipeline emits both; the Slate names die with the legacy pipeline (EDEX-1249), and the `data-pt-*` names that replaced them are verified present on both sides. `data-list-index` is excluded as plugin-provided (`@portabletext/plugin-list-index`).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Contributor
📦 Bundle Stats —
|
| Metric | Value | vs main (41c3c58) |
|---|---|---|
| Internal (raw) | 776.0 KB | - |
| Internal (gzip) | 148.3 KB | - |
| Bundled (raw) | 1.38 MB | - |
| Bundled (gzip) | 310.2 KB | - |
| Import time | 97ms | -0ms, -0.2% |
@portabletext/editor/behaviors
| Metric | Value | vs main (41c3c58) |
|---|---|---|
| Internal (raw) | 467 B | - |
| Internal (gzip) | 207 B | - |
| Bundled (raw) | 424 B | - |
| Bundled (gzip) | 171 B | - |
| Import time | 2ms | +0ms, +1.6% |
@portabletext/editor/plugins
| Metric | Value | vs main (41c3c58) |
|---|---|---|
| Internal (raw) | 2.7 KB | - |
| Internal (gzip) | 894 B | - |
| Bundled (raw) | 2.5 KB | - |
| Bundled (gzip) | 827 B | - |
| Import time | 7ms | +0ms, +1.5% |
@portabletext/editor/selectors
| Metric | Value | vs main (41c3c58) |
|---|---|---|
| Internal (raw) | 79.3 KB | - |
| Internal (gzip) | 14.5 KB | - |
| Bundled (raw) | 74.8 KB | - |
| Bundled (gzip) | 13.4 KB | - |
| Import time | 8ms | +0ms, +2.9% |
@portabletext/editor/traversal
| Metric | Value | vs main (41c3c58) |
|---|---|---|
| Internal (raw) | 25.4 KB | - |
| Internal (gzip) | 5.0 KB | - |
| Bundled (raw) | 25.4 KB | - |
| Bundled (gzip) | 5.0 KB | - |
| Import time | 6ms | -0ms, -1.5% |
@portabletext/editor/utils
| Metric | Value | vs main (41c3c58) |
|---|---|---|
| Internal (raw) | 28.7 KB | - |
| Internal (gzip) | 6.0 KB | - |
| Bundled (raw) | 26.7 KB | - |
| Bundled (gzip) | 5.7 KB | - |
| Import time | 6ms | +0ms, +2.1% |
🗺️ . · ./behaviors · ./plugins · ./selectors · ./traversal · ./utils · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @portabletext/markdown
Compared against main (41c3c588)
| Metric | Value | vs main (41c3c58) |
|---|---|---|
| Internal (raw) | 53.0 KB | - |
| Internal (gzip) | 9.6 KB | - |
| Bundled (raw) | 347.6 KB | - |
| Bundled (gzip) | 96.0 KB | - |
| Import time | 40ms | +2ms, +4.3% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Proves PTE's new
defineXrender pipeline can replicate the legacy pipeline's DOM 1:1 for text blocks. Each case renders the same value through the legacy pipeline (no render callbacks = engine default) and the new pipeline (adefineTextBlockcatch-all reconstructing that default), normalizes both DOM trees (tag + sorted attributes + children), and assertstoEqual.This is the engine-level capability proof: the new pipeline exposes enough on its render props for a consumer to reconstruct the legacy output. It also pins the two branches most prone to silent divergence — the empty-block zero-width path and the list item whose className defaults
levelto 1 whiledata-levelstays absent.What's intentionally excluded (the point, not gaps)
data-slate-*namespace: opting into the new pipeline is a clean break, emitting onlydata-pt-*. The Slate names die with the legacy pipeline; thedata-pt-*names that replaced them are present on both sides and verified.data-list-index: plugin-provided (@portabletext/plugin-list-index, pinned by its own tests).Shelf life
Test-only. It exists while both pipelines coexist; when the legacy pipeline is removed it converts to an absolute DOM-literal assertion or gets deleted (noted in the file). Block objects and inline objects are follow-ups on the same harness.