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

Deduplicate `m.route` and `m.redraw` logic #2453

Merged
merged 1 commit into from Jul 5, 2019

Conversation

@isiahmeadows
Copy link
Collaborator

commented Jul 5, 2019

Description

  • Remove appropriate route change subcriptions when a root is removed via m.mount(root, null).
  • Don't pollute onpopstate and friends - use standard event listeners instead.
  • Simplify and streamline subscriptions, in preparation of adding a remove parameter to m.mount.
  • Change the redraw internals to redraw immediately, with ability to cancel via returning a sentinel.
  • Change "bleeding-edge" for m.version in next to instead just be the latest m.version. (If you're using next, you should know what you're in for.)
  • Update tests to be aware of these changes. (Some were failing for subtle reasons.)
  • Drive-by: remove some uses of string.charAt(n) and use string[n] instead.

Motivation and Context

Fixes #2437.

Also, this addresses a couple things that have been in discussion for a while.

How Has This Been Tested?

Added new tests, updated a lot of tests.

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

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

Deduplicate `m.route` and `m.redraw` logic
- Remove appropriate route change subcriptions when a root is removed
  via `m.mount(root, null)`.
- Don't pollute `onpopstate` and friends - use standard event listeners
  instead.
- Simplify and streamline subscriptions, in preparation of adding a
  `remove` parameter to `m.mount`.
- Change the redraw internals to redraw immediately, with ability to
  cancel via returning a sentinel.
- Change `"bleeding-edge"` for `m.version` in `next` to instead just be
  the latest `m.version`. (If you're using `next`, you should know what
  you're in for.)
- Update tests to be aware of these changes. (Some were failing for
  subtle reasons.)
- Drive-by: remove some uses of `string.charAt(n)` and use `string[n]`
  instead.

@isiahmeadows isiahmeadows force-pushed the isiahmeadows:route-mount-deduplicate branch from 9f6f7cf to 1603d87 Jul 5, 2019

@isiahmeadows isiahmeadows merged commit 90bcff0 into MithrilJS:next Jul 5, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

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

@isiahmeadows isiahmeadows deleted the isiahmeadows:route-mount-deduplicate branch Jul 5, 2019

@isiahmeadows isiahmeadows referenced this pull request Jul 9, 2019
3 of 11 tasks complete
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.