Skip to content

refactor(service-worker): public API/docs fixes and minor refactoring#23138

Closed
gkalpak wants to merge 3 commits intoangular:masterfrom
gkalpak:refactor-sw-fix-public-api
Closed

refactor(service-worker): public API/docs fixes and minor refactoring#23138
gkalpak wants to merge 3 commits intoangular:masterfrom
gkalpak:refactor-sw-fix-public-api

Conversation

@gkalpak
Copy link
Copy Markdown
Member

@gkalpak gkalpak commented Apr 3, 2018

PR Checklist

PR Type

[x] Refactoring (no functional changes, no api changes)
[x] Documentation content changes

What is the current behavior?

NgswCommChannel, UpdateAvailableEvent, UpdateActivatedEvent are mentioned in the docs without being part of the public API.
The constructors of SwPush/SwUpdate are shown in the docs, making it look like they could be manually constructed.

What is the new behavior?

UpdateAvailableEvent, UpdateActivatedEvent are added to the public API.
SwPush/SwUpdate are changed to abstract classes, so their constructors (including the NgswCommChannel) are not shown in the docs.

Does this PR introduce a breaking change?

[ ] Yes
[x] No (afaict :D)

@gkalpak gkalpak added action: review The PR is still awaiting reviews from at least one requested reviewer refactoring Issue that involves refactoring or code-cleanup target: patch This PR is targeted for the next patch release type: docs area: service-worker Issues related to the @angular/service-worker package labels Apr 3, 2018
@gkalpak gkalpak requested a review from alxhub April 3, 2018 11:06
@gkalpak gkalpak force-pushed the refactor-sw-fix-public-api branch 3 times, most recently from aed1cdb to 9dae264 Compare April 4, 2018 17:38
@mary-poppins
Copy link
Copy Markdown

You can preview 17e5de9 at https://pr23138-17e5de9.ngbuilds.io/.
You can preview 5197d77 at https://pr23138-5197d77.ngbuilds.io/.
You can preview aed1cdb at https://pr23138-aed1cdb.ngbuilds.io/.
You can preview 9dae264 at https://pr23138-9dae264.ngbuilds.io/.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is unnecessary, just mark the constructors @internal instead.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

IIRC, marking the constructor as @internal converts the class to an interface (in the API docs).
And interfaces can't be used as injection tokens (while abstract classes can), so I thought it would be confusing for users (not realizing they can use SwPush as an injection token even if it shows up as an interface in the docs).

But happy to change it @internal constructor if you feel strongly about it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Discussed offline:
We'll leave the constructors for now, since this is a general problem throughout the framework.
(Hopefully there will be a better solution in the near future.)

@gkalpak gkalpak force-pushed the refactor-sw-fix-public-api branch from 9dae264 to 31359f9 Compare May 17, 2018 12:37
@mary-poppins
Copy link
Copy Markdown

You can preview 31359f9 at https://pr23138-31359f9.ngbuilds.io/.

@gkalpak
Copy link
Copy Markdown
Member Author

gkalpak commented May 17, 2018

Updated as discussed and rebased on master. PTAL, @alxhub.

@IgorMinar IgorMinar self-requested a review August 22, 2018 19:59
@gkalpak gkalpak force-pushed the refactor-sw-fix-public-api branch from 31359f9 to 75e7a34 Compare September 21, 2018 12:48
@mary-poppins
Copy link
Copy Markdown

You can preview 75e7a34 at https://pr23138-75e7a34.ngbuilds.io/.

Copy link
Copy Markdown
Member

@alxhub alxhub left a comment

Choose a reason for hiding this comment

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

Nice job!

Copy link
Copy Markdown
Contributor

@IgorMinar IgorMinar left a comment

Choose a reason for hiding this comment

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

thanks for the cleanup!

@IgorMinar IgorMinar added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Oct 5, 2018
@IgorMinar IgorMinar added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Oct 5, 2018
@IgorMinar
Copy link
Copy Markdown
Contributor

caretaker note: no google3 impact

@jenniferfell
Copy link
Copy Markdown
Contributor

jenniferfell commented Oct 5, 2018

@gkalpak FYI: swupdate is mentioned in 3 places in the guides. If it's not part of the public API, we'll need to rewrite those sections.

@IgorMinar
Copy link
Copy Markdown
Contributor

@jenniferfell it is. but we haven't made any change that would modify the previously exposed public api. This PR only reexports two interfaces that were previously not exported by mistake.

@jasonaden jasonaden closed this in 7aed64d Oct 5, 2018
jasonaden pushed a commit that referenced this pull request Oct 5, 2018
@gkalpak gkalpak deleted the refactor-sw-fix-public-api branch October 5, 2018 21:06
@angular-automatic-lock-bot
Copy link
Copy Markdown

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 14, 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 area: service-worker Issues related to the @angular/service-worker package cla: yes merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note refactoring Issue that involves refactoring or code-cleanup target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants