Skip to content
This repository was archived by the owner on Jun 20, 2025. It is now read-only.
This repository was archived by the owner on Jun 20, 2025. It is now read-only.

[Performance Advice] key parameter for text() function #488

Open
@ghost

Description

Overview

This is a recommendation and discussion for implementing a key parameter for the ID.text() function. The reason why I am recommending that is because there can be performance losses when using for or if statements directly on text nodes because the library's "reconciliation" algorithm may not know which text nodes were added, removed, or shuffled.

Possible changes

Instead of text(value, ...formatters), the text() function could have the following signature:

text(value, key = null, ...formatters)

I hope this advice helps incremental-dom with a performance boost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions