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

docs: add operator flag to operator functions #6563

Merged

Conversation

jakovljevic-mladen
Copy link
Member

Description:
This PR adds a label to all functions that are considered as operator functions. That is, any function that is exported from src/internal/operators will have this label.

The processor that was created to determine if a document isOperator determines this by checking if a document has originalModule and if originalModule starts with 'internal/operators'. This means that any exported function that is not operator that may in future come from 'internal/operators' will be marked as an operator - for now, there are no such functions. But if some util (non-operator) function gets exported in future from 'internal/operators', it should be moved to another place so that it doesn't get marked as operator.

This is a handy addition, especially after RxJS v7.2.0 since operators are exported from 'rxjs' and many operators are now displayed on two pages (for example: http://rxjs.dev/api/operators/map and http://rxjs.dev/api/index/function/map).

Some examples how this looks like (please notice URL):

image

image

image

zip creation function, exported from 'rxjs':
image

Deprecated zip operator, exported from 'rxjs/operators':
image

Note: almost all (if not all) processors come with a .spec.js file. I didn't add one with this PR as so many tests actually fail when tests are run. For this reason, I don't think those tests are really essential. If they ever become essential, I will write some.

Related issue (if exists):
Somewhat #6544.

@@ -56,6 +56,10 @@ label.raised, .api-header label {
&.impure-pipe {
background-color: $brightred;
}

&.operator {
background-color: $brightred;
Copy link
Member Author

Choose a reason for hiding this comment

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

I reused the same color as in impure-pipe class - there are no impure pipes in RxJS 🙂

@@ -26,6 +26,7 @@ <h1>{$ doc.name $}</h1>
{% if doc.experimental !== undefined %}<label class="api-status-label experimental">experimental</label>{% endif %}
{% if doc.stable !== undefined %}<label class="api-status-label stable">stable</label>{% endif %}
{% if doc.pipeOptions.pure === 'false' %}<label class="api-status-label impure-pipe">impure</label>{% endif %}
Copy link
Member Author

Choose a reason for hiding this comment

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

I think I will remove all Angular references like this one - there are so many of them that are so specific to Angular that they could be removed quite safely.

@benlesh
Copy link
Member

benlesh commented Sep 22, 2021

This LGTM. I was sort of waiting for @niklas-wortmann's review though, since he owns the docs app.

@niklas-wortmann
Copy link
Member

LGTM, this is a great idea and I like it a lot!

@niklas-wortmann niklas-wortmann merged commit 861aa92 into ReactiveX:master Oct 6, 2021
@jakovljevic-mladen jakovljevic-mladen deleted the add_operator_flag branch October 6, 2021 15:29
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.

None yet

3 participants