Skip to content

build: api-docs can display incorrect module for entry-point #16470

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

Conversation

devversion
Copy link
Member

In some cases, an entry-point can export a deprecated NgModule. Currently
if that module is exported after all previous modules, it will show up in the docs
as recommended import. e.g. import {ScrollDispatchModule} from '@angular/cdk/scrolling';

This is causing confusion as the non-deprecated module should be used for rendering
the recommended import. This commit ensures that non-deprecated modules are
prioritized over deprecated modules and that specific modules can be explicitly
selected as primary module for an entry-point.

Fixes #16353.

In some cases, an entry-point can export a deprecated NgModule. Currently
if that module is exported after all previous modules, it will show up in the docs
as recommended import. e.g. `import {ScrollDispatchModule} from '@angular/cdk/scrolling';`

This is causing confusion as the non-deprecated module should be used for rendering
the recommended import. This commit ensures that non-deprecated modules are
prioritized over deprecated modules and that specific modules can be explicitly
selected as primary module for an entry-point.

Fixes angular#16353.
@devversion devversion added P2 The issue is important to a large percentage of users, with a workaround pr: merge safe target: patch This PR is targeted for the next patch release labels Jul 8, 2019
@devversion devversion requested a review from jelbourn as a code owner July 8, 2019 06:13
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 8, 2019
/** Whether the given document is annotated with the "@docs-primary-module" jsdoc tag. */
export function isPrimaryModuleDoc(doc: any) {
return (doc.tags && doc.tags.tags || [])
.some((tag: any) => tag.tagName === 'docs-primary-module');
Copy link
Member

Choose a reason for hiding this comment

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

Maybe in another PR, but we should have some docs about our custom JsDoc tags

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah totally. I had the same thought when creating that PR and created #16469 for tracking.

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Jul 8, 2019
@jelbourn jelbourn merged commit 60d570b into angular:master Jul 9, 2019
@devversion
Copy link
Member Author

For reference: This also fixed that the core entry-point displayed the pseudo checkbox module as primary module. see angular/material2-docs-content@085407a

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import Scrollmodule instead of deprecated ScrollDispatchModule
3 participants