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

Cleaning up code by making vnode.attrs always non-null #2977

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

kfule
Copy link
Contributor

@kfule kfule commented Sep 25, 2024

Commit f9e5163 made vnode.attrs always non-null, so there is no need for code to make vnode.attrs null or assume vnode.attrs is null.

This pr is a re-opening of #2819.

Description

The following two processes have been removed

  • Workaround for vnode of textarea when vnode.attrs is null (Edit: This workaround was aimed for assigning text to attrs.value. But assigning to attrs.value was removed as of the commit. So, this code is not needed now regardless of whether the attrs is null or not.)
  • Processing of key removal to set vnode.attrs to null

For the latter, the behavior will change when there is only key in attrs (key is not removed from attrs). Some tests have also been changed to ensure that the changes are appropriate.

Motivation and Context

There is still a not very useful code that assumes that vnode.attrs will be null. Removing that code will reduce the amount of code and improve the outlook of the process.

How Has This Been Tested?

Running "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

Because vnode.attrs is never null by commit f9e5163
Because vnode.attrs is never null by commit f9e5163
@kfule kfule requested a review from a team as a code owner September 25, 2024 11:25
@dead-claudia dead-claudia merged commit 0b8dd45 into MithrilJS:main Sep 26, 2024
7 checks passed
@JAForbes JAForbes mentioned this pull request Sep 26, 2024
@kfule kfule deleted the non-null-attrs2 branch October 19, 2024 11:53
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