Skip to content

fix: inline extractProps into applySplitNode#2427

Merged
christianhg merged 1 commit intomainfrom
refactor/inline-extract-props
Mar 29, 2026
Merged

fix: inline extractProps into applySplitNode#2427
christianhg merged 1 commit intomainfrom
refactor/inline-extract-props

Conversation

@christianhg
Copy link
Copy Markdown
Member

extractProps existed solely to strip structural fields (children from text blocks, text from spans) before passing node metadata to applySplitNode. Every caller followed the same pattern: look up the node, call extractProps, pass the result as the properties parameter.

Since applySplitNode already identifies the node type internally (it checks isSpan and isTextBlock to decide how to split), it can do its own property extraction. This removes the properties parameter from the signature and lets callers pass just the path and position.

The simplification cascades through 8 call sites across 7 files. Several callers had redundant getNode lookups that only existed to feed extractProps - those are removed too since applySplitNode does its own node lookup internally.

Deletes extract-props.ts and the NodeProps type that was only used by it.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 29, 2026

🦋 Changeset detected

Latest commit: 44348fc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@portabletext/editor Patch
@portabletext/plugin-character-pair-decorator Patch
@portabletext/plugin-emoji-picker Patch
@portabletext/plugin-input-rule Patch
@portabletext/plugin-markdown-shortcuts Patch
@portabletext/plugin-one-line Patch
@portabletext/plugin-paste-link Patch
@portabletext/plugin-sdk-value Patch
@portabletext/plugin-typeahead-picker Patch
@portabletext/plugin-typography Patch
@portabletext/toolbar Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
portable-text-editor-documentation Ready Ready Preview, Comment Mar 29, 2026 1:22pm
portable-text-example-basic Ready Ready Preview, Comment Mar 29, 2026 1:22pm
portable-text-playground Ready Ready Preview, Comment Mar 29, 2026 1:22pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 29, 2026

📦 Bundle Stats — @portabletext/editor

Compared against main (c7efcdbb)

@portabletext/editor

Metric Value vs main (c7efcdb)
Internal (raw) 757.5 KB -3.2 KB, -0.4%
Internal (gzip) 142.6 KB -484 B, -0.3%
Bundled (raw) 1.37 MB -3.2 KB, -0.2%
Bundled (gzip) 306.5 KB -480 B, -0.2%
Import time 98ms +0ms, +0.0%

@portabletext/editor/behaviors

Metric Value vs main (c7efcdb)
Internal (raw) 467 B -
Internal (gzip) 207 B -
Bundled (raw) 424 B -
Bundled (gzip) 171 B -
Import time 6ms -0ms, -0.9%

@portabletext/editor/plugins

Metric Value vs main (c7efcdb)
Internal (raw) 2.5 KB -
Internal (gzip) 910 B -
Bundled (raw) 2.3 KB -
Bundled (gzip) 839 B -
Import time 12ms +0ms, +1.2%

@portabletext/editor/selectors

Metric Value vs main (c7efcdb)
Internal (raw) 60.5 KB -
Internal (gzip) 9.5 KB -
Bundled (raw) 56.9 KB -
Bundled (gzip) 8.7 KB -
Import time 10ms +0ms, +0.2%

@portabletext/editor/utils

Metric Value vs main (c7efcdb)
Internal (raw) 24.2 KB -
Internal (gzip) 4.7 KB -
Bundled (raw) 22.2 KB -
Bundled (gzip) 4.4 KB -
Import time 9ms +0ms, +0.3%

🗺️ . · ./behaviors · ./plugins · ./selectors · ./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.

@christianhg christianhg force-pushed the refactor/inline-extract-props branch from 00ad488 to 44348fc Compare March 29, 2026 13:22
@christianhg christianhg changed the title refactor: inline extractProps into applySplitNode fix: inline extractProps into applySplitNode Mar 29, 2026
@christianhg christianhg enabled auto-merge (rebase) March 29, 2026 13:24
@christianhg christianhg merged commit a8bdabb into main Mar 29, 2026
17 checks passed
@christianhg christianhg deleted the refactor/inline-extract-props branch March 29, 2026 13:27
@ecoscript ecoscript bot mentioned this pull request Mar 29, 2026
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.

1 participant