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

Update marble diagram images for operators that accept "notifiers" #6627

Closed
5 tasks done
jakovljevic-mladen opened this issue Oct 4, 2021 · 7 comments · Fixed by #7152
Closed
5 tasks done

Update marble diagram images for operators that accept "notifiers" #6627

jakovljevic-mladen opened this issue Oct 4, 2021 · 7 comments · Fixed by #7152

Comments

@jakovljevic-mladen
Copy link
Member

jakovljevic-mladen commented Oct 4, 2021

Since RxJS v7 has been released, many operators that accept "notifiers" have been adjusted to listen to only "next" notifications. This has become mandatory as per RxJS Core Semantics guide:

Operators that accept "notifiers" (as described above), MUST ONLY recognized next values from the notifier as "notifications". Emitted completions may not be used a source of notification.

However, many marble diagram images have to be updated as they don't reliably picture this behavior. For example, audit operator displays this image:
audit

A user "reading" this image might be deceived to think that an Observable that has been passed to audit operator needs to complete before destination will receive next "next" notification. This is not true now.

Marble diagram images of these operators need to be updated:

@jakovljevic-mladen jakovljevic-mladen changed the title Update marble diagram images that Update marble diagram images for operators that accept "notifiers" Oct 4, 2021
@niklas-wortmann
Copy link
Member

We introduced swirly a while back to generate svg marble diagrams. I did not have the time to update/add all the marble diagrams, but I did a poc with concatAll that is already deployed to rxjs.dev, you basically describe the marble diagrams in a ascii format, so there should be a concatAll.txt somewhere in the repo, additionally there are dedicated npm scripts to use those text files and generate the marble diagram. Lastly, you would just have to update the path in the tsdoc comment of the operator, likely just replacing the fileformat png with svg

@niklas-wortmann
Copy link
Member

I would very much appreciate your support with that, if you wanna start doing this for audit and throttle that would be amazing!!!

@jakovljevic-mladen
Copy link
Member Author

Hey @niklas-wortmann, thanks for letting me know. I'll check what's going on with Swirly and possibly create a (couple of) PR(s) fixing issues described in the ticket description. I may also go and re-implement all existing marble diagrams using Swirly 😁

@jakovljevic-mladen
Copy link
Member Author

@benlesh, since you were mainly involved in normalizing behavior between various operators that receive notifying Observables so that they all "act" on next notification, could you please review the list I created and possibly give suggestions?

There are a lot more operators that receive notifying Observables than what's on the list, but it looks like they have relatively good marble diagrams, so I didn't add them here.

@jakovljevic-mladen
Copy link
Member Author

jakovljevic-mladen commented Oct 14, 2021

@niklas-wortmann, all done, could you please review PRs when you have some time? I also included debounce as that one wasn't good. Also, in those PRs, I updated the first test to match the new marble diagrams.

Also, still waiting for Ben (or anyone else) to confirm bufferWhen and windowWhen and, possibly others.

@ladyleet
Copy link
Member

@niklas-wortmann @benlesh following up on this one!

@jakovljevic-mladen
Copy link
Member Author

@benlesh, I was once again reviewing this issue and I'm still not sure whether windowWhen marble diagram should be fixed. What it looks like, a windowWhen test suggests that it also accepts complete notifications. This is also suggested here where OperatorSubscriber accepts third parameter which is the same as the second one (the second openWindow) - the third parameter is a function that gets called on complete notifications, which indicates that the same thing will happen on both next and complete events.

In contrary, bufferWhen seems to accept noop as the third parameter to OperatorSubscriber, which suggests that bufferWhen does not accept complete notifications. Is this a bug or this behavior seems like an exception for some reason? If it is a bug, please let me know, I can create a separate ticket for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants