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 #1714 conditionally halting stream #2200

Merged
merged 4 commits into from Aug 8, 2018

Conversation

Projects
None yet
5 participants
@porsager
Copy link
Contributor

porsager commented Aug 8, 2018

Description

When a stream returns halt it is unregistrered to avoid calling dependent streams

Motivation and Context

#1714

How Has This Been Tested?

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
@barneycarroll
Copy link
Member

barneycarroll left a comment

Stick something in the changelog?

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

barneycarroll added some commits Aug 8, 2018

@barneycarroll barneycarroll merged commit d64e0a9 into MithrilJS:next Aug 8, 2018

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@pygy

This comment has been minimized.

Copy link
Member

pygy commented Aug 8, 2018

I didn't review this in depth, but it seems like the wrong fix to me... stream.HALT is supposed to stop the propagation of the current value, not to end the dependent streams...

The docs isn't clear about it but I think it was meant to be reversible.

@porsager

This comment has been minimized.

Copy link
Contributor

porsager commented Aug 8, 2018

That's a good point @pygy , but I don't think the word HALT conveys that.. I think IGNORE / SKIP would make better sense?

@barneycarroll

This comment has been minimized.

Copy link
Member

barneycarroll commented Aug 8, 2018

I'm really sorry - totally jumped the gun. You're right @pygy, HALT stops that one value - stream.end(true) is the API for that thing. I read the tests as validating a fix that meant HALTed values didn't trigger derivative streams.

The test should in fact ensure that the flag can be flipped back again.

@orbitbot

This comment has been minimized.

Copy link
Contributor

orbitbot commented Aug 8, 2018

Re:naming #2017

Could we include that renaming part into 2.0 since it's semver major anyways?

@pygy

This comment has been minimized.

Copy link
Member

pygy commented Aug 8, 2018

+1 for SKIP

The stream library has its own npm package, we can introduce breaking changes independently.

@porsager

This comment has been minimized.

Copy link
Contributor

porsager commented Aug 8, 2018

@pygy that's also a great point for not including stream as a named export in the mithril esm bundle!

Do we want to do anything special at all if returning HALT? I don't think we should if we introduce SKIP which works as you defined?

porsager added a commit to porsager/mithril.js that referenced this pull request Aug 9, 2018

Fix MithrilJS#1714 conditionally halting stream (MithrilJS#2200)
* Fix MithrilJS#1714 conditionally halting stream

* Add note in changelog

@porsager porsager referenced this pull request Aug 23, 2018

Merged

Rewrite stream #2207

10 of 11 tasks complete
@gamb

This comment has been minimized.

Copy link
Contributor

gamb commented Nov 8, 2018

+1 for SKIP as well.

This is actually a breaking change for #1957. The tests need to be better for it.

isiahmeadows added a commit that referenced this pull request Nov 14, 2018

output mithril, stream and ospec esm versions on build - fixes #2112 (#…
…2194)

* output mithril, stream and ospec esm versions on build

* Add esm bundles

* [request] Clearer error message for JSON deserialization failure (#2195)

* Bundled output for commit fd7cf80 [skip ci]

* Fix #1714 conditionally halting stream (#2200)

* Fix #1714 conditionally halting stream

* Add note in changelog

* Do not include stream as named export in mithril.esm.js

* Rename mithril.min.esm.js to mithril.esm.min.js

* Add esm files to eslintignore

* Add named exports

* Add hyperscript `m` as named export

* Add builds with export changes

* checkout regular bundled files

* Change .esm.js to .mjs

* Update pkg module to point to .mjs

* Fix for export names to avoid collision

* Updated bundled files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment