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

Fix keys, normalize holes #2452

Merged
merged 3 commits into from Jul 3, 2019

Conversation

@isiahmeadows
Copy link
Collaborator

commented Jul 3, 2019

Description

  • Require fragments to either have only keyed children or no keyed children.
  • Ban holes from keyed fragments, to reduce complexity in the keyed diff algorithm.
  • Normalize booleans, null, and undefined to be a single hole sentinel null, to simplify representation.
  • Document a common pattern on how to have a programmatically replaceable node, to resolve some confusion around that.

Motivation and Context

Closes #2434
Fixes #2248

Also resolves a class of paper cuts that have found their way onto Gitter the past several months with v1.

How Has This Been Tested?

Added a couple tests, updated a bunch, rewrote a few.

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)
  • Documentation change

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated docs/change-log.md

isiahmeadows added some commits Jul 3, 2019

Treat holes as unkeyed, normalize boolean/null/undefined
This brings a lot better consistency with that API, even though it's
slightly breaking. (I had to update a bunch of tests to correspond with
it.)

@project-bot project-bot bot added this to Needs triage in Triage/bugs Jul 3, 2019

@isiahmeadows isiahmeadows merged commit 6c562d2 into MithrilJS:next Jul 3, 2019

Triage/bugs automation moved this from Needs triage to Closed Jul 3, 2019

@isiahmeadows isiahmeadows deleted the isiahmeadows:fix-keys branch Jul 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.