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

Remove 'asDiagram' infrastructure #5422

Merged

Conversation

niklas-wortmann
Copy link
Member

@niklas-wortmann niklas-wortmann commented May 10, 2020

This cleans up the old way of generating marble diagrams. It also hides the internal testing document from the docs, we can still refer to that but it's not visible from the menu anymore.

That's how the new diagrams (inlined as svg) do kinda look like:
image

Copy link
Collaborator

@cartant cartant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@timdp
Copy link
Contributor

timdp commented May 15, 2020

Guessing this relates to #5019, #5100, and #5402, so just cross-linking for visibility...

@niklas-wortmann niklas-wortmann force-pushed the feature/marble-diagrams branch from 7669608 to 0874e9e Compare May 22, 2020 18:52
marbles/scripts/index.ts Outdated Show resolved Hide resolved
marbles/scripts/index.ts Outdated Show resolved Hide resolved
marbles/scripts/index.ts Outdated Show resolved Hide resolved
@timdp
Copy link
Contributor

timdp commented May 23, 2020

Note that Swirly currently introduces a pseudo-circular dependency. In order to parse the ASCII marble diagrams, it depends on the stable rxjs to use TestScheduler.parseMarbles(). I assume that's not even a public API? Maybe it'd be good to extract it into a separate package, so that both rxjs and swirly can depend on it?

@niklas-wortmann
Copy link
Member Author

Good call regarding the circular dependency. I don't know about the TestScheduler.parseMarbles() API, but I think as quick fix I could just move the marble diagram generation over to the docs_app.

@niklas-wortmann
Copy link
Member Author

timdp/swirly#2 Is kinda related to this pr as the generated SVGs could be improved in terms of accessibility

@timdp
Copy link
Contributor

timdp commented May 25, 2020

I've also introduced a workaround for the circular-ish dependency. As of v0.13.6, instead of depending on RxJS directly, the parser now uses a tree-shaken copy of TestScheduler.parseMarbles(). So it's a rudimentary way of extracting the logic into a minimal package, at the expense of duplicating it.

Copy link
Member

@benlesh benlesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's nice that these have finally been detached from the tests. I've always felt they shouldn't be related, but it was a reasonable compromise to hand-rolling them.

@benlesh
Copy link
Member

benlesh commented May 26, 2020

LGTM... @niklas-wortmann ... I'll let you merge this one. You probably want to cherry pick it over to 6.x as well, so I recommend doing a squash and merge.

@timdp
Copy link
Contributor

timdp commented May 26, 2020

Little bug: in package.json, you're depending on the swirly package directly, and pulling in all its dependencies (including Puppeteer) as a result.

@niklas-wortmann
Copy link
Member Author

niklas-wortmann commented May 26, 2020

Oh I see, good call. Thanks yeah now that makes sense. I will fix that

@niklas-wortmann
Copy link
Member Author

@benlesh I don't think I will cherry pick it in V6. There's still a lot of work needed for that and I don't want to deal with the hassle :D Also it makes the V7 release even better having lots of great docs stuff too :D

@timdp
Copy link
Contributor

timdp commented May 26, 2020

I'm a big fan of depcheck to avoid stuff like this. Could be something for a follow-up PR. :-)

@niklas-wortmann niklas-wortmann merged commit d608cf3 into ReactiveX:master May 28, 2020
@niklas-wortmann niklas-wortmann deleted the feature/marble-diagrams branch May 28, 2020 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants