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

Rewrite stream #2207

Merged
merged 16 commits into from Nov 27, 2018

Conversation

@porsager
Copy link
Contributor

commented Aug 23, 2018

So after a bit of fiddling trying to solve 2 issues related to mithril streams, I ended up trying to do an implementation from scratch just to get a better understanding of how it all hooked up.

After a bit of back and forth with @pygy on gitter I think I've ended up with a simpler implementation, which at the same time fixes the bugs mentioned above.

Another small benefit is that it is 1-3x faster depending on browser for simple tests using map and compose.

These are the issues being solved by the rewrite
#1714 (PR #2200)
#2197 (PR #2201)

The first one that got merged actually behaves wrong in that it ends the stream completely (wrong fix)

There was also another issue fixed with regards to the changed streams returned in combine which required fixing a test.

At the same time I've also renamed HALT to SKIP, which feels a bit more correct relating to its function.

How Has This Been Tested?

Using all current stream tests, correcting 1 test, and adding another

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

@porsager porsager requested a review from tivac as a code owner Aug 23, 2018

@StephanHoyer

This comment has been minimized.

Copy link
Member

commented Aug 23, 2018

👍

@porsager porsager referenced this pull request Aug 30, 2018
6 of 11 tasks complete

@isiahmeadows isiahmeadows requested a review from pygy Sep 1, 2018

@isiahmeadows

This comment has been minimized.

Copy link
Collaborator

commented Sep 1, 2018

@pygy I requested your review since you appear mentioned in the lead up to this PR.

stream/stream.js Outdated Show resolved Hide resolved
@isiahmeadows

This comment has been minimized.

Copy link
Collaborator

commented Sep 14, 2018

@porsager Could you add Stream.HALT as a deprecated alias, so we don't break people? (You can still define it as a getter to warn on its use.)

@porsager

This comment has been minimized.

Copy link
Contributor Author

commented Sep 14, 2018

Good idea @isiahmeadows ... Would you recommend a single console log on first use?

@isiahmeadows

This comment has been minimized.

Copy link
Collaborator

commented Sep 14, 2018

@porsager Yes.

stream/stream.js Outdated Show resolved Hide resolved
stream/stream.js Outdated Show resolved Hide resolved
docs/stream.md Outdated Show resolved Hide resolved
@nordfjord

This comment has been minimized.

Copy link
Contributor

commented Sep 17, 2018

This looks good to me 👍

@isiahmeadows
Copy link
Collaborator

left a comment

So far, everything LGTM.

@isiahmeadows isiahmeadows removed the request for review from tivac Sep 18, 2018

@isiahmeadows

This comment has been minimized.

Copy link
Collaborator

commented Sep 18, 2018

@pygy Could you take a look at this? (I'd rather not go without your review, since it appears you were at least somewhat involved indirectly with this PR.)

@porsager

This comment has been minimized.

Copy link
Contributor Author

commented Oct 25, 2018

Any chance this could go in 2.0?

@isiahmeadows

This comment has been minimized.

Copy link
Collaborator

commented Oct 25, 2018

@porsager Unlikely unless @pygy is okay with it as-is.

@porsager

This comment has been minimized.

Copy link
Contributor Author

commented Oct 25, 2018

ah ok 😊 I also forgot this is versioned by itself, so not strictly tied to 2.0

@isiahmeadows isiahmeadows added this to In discussion in Feature requests/Suggestions Oct 28, 2018

@isiahmeadows isiahmeadows requested a review from MithrilJS/collaborators Nov 21, 2018

@isiahmeadows

This comment has been minimized.

Copy link
Collaborator

commented Nov 21, 2018

@porsager Could you fix the conflicts?

Merge remote-tracking branch 'MithrilJS/next' into streams-rewrite
# Conflicts:
#	docs/stream.md
#	stream/stream.js
@porsager

This comment has been minimized.

Copy link
Contributor Author

commented Nov 22, 2018

Done ;)

@isiahmeadows

This comment has been minimized.

Copy link
Collaborator

commented Nov 22, 2018

@barneycarroll Does this look okay to you?

@StephanHoyer
Copy link
Member

left a comment

lgtm.

Besides that merge artefact, i'm fine

docs/stream.md Outdated Show resolved Hide resolved
@isiahmeadows
Copy link
Collaborator

left a comment

LGTM.

Feature requests/Suggestions automation moved this from In discussion to Planned/In Progress Nov 27, 2018

@isiahmeadows isiahmeadows merged commit 58c86f7 into MithrilJS:next Nov 27, 2018

1 check passed

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

Feature requests/Suggestions automation moved this from Planned/In Progress to Completed/Declined Nov 27, 2018

@StephanHoyer StephanHoyer referenced this pull request Nov 27, 2018
5 of 10 tasks complete
@gamb gamb referenced this pull request Jan 7, 2019
4 of 11 tasks complete
isiahmeadows referenced this pull request Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.