Skip to content

Conversation

@kfule
Copy link
Contributor

@kfule kfule commented Jan 17, 2026

Description

This PR removes the following redundant code:

  • vnode.text-related code, which has not been used internally since Standardise vnode text representation #2670.
  • The toString() calls used to compare old and new strings in updateText. Both strings have already been normalized via String().

npm run test passes as-is.

Motivation and Context

This PR is expected to slightly improve bundle size and performance.
In addition, the vnode.text-related code appears very early in the mithril.js build bundle; removing it also improves readability.

How Has This Been Tested?

npm run test

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My change requires a documentation update, and I've opened a pull request to update it already:
  • I have read https://mithril.js.org/contributing.html.

kfule added 2 commits January 17, 2026 18:00
Since MithrilJS#2670, `vnode.text` and its related interfaces are no longer used internally.
… new values

In text vnodes, `vnode.children` is already normalized by `String()`, so the `toString()` here is redundant.
@kfule kfule requested a review from a team as a code owner January 17, 2026 09:35
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