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

Don't use unknown for workbox-build method config #3037

Merged
merged 3 commits into from
Mar 2, 2022

Conversation

jeffposnick
Copy link
Contributor

Prior to this, the getManifest(), generateSW(), and injectManifest() methods of workbox-build were marked as taking in a configuration object with type unknown. The idea was that prior to validating the configuration (which happens immediately), we should treat the object as potentially anything.

Unfortunately, this leads to a bad experience in our TSDocs, and likely for users who rely on TypeScript code completion.

Additionally, if you actually attempt to pass in anything other than the support options, the validation step should immediately throw, so passing in just anything didn't actually "work." Because of this, I consider adding in explicit types for the config to be a bug fix rather than a breaking change, as we never should have had unknown to begin with.

Copy link
Contributor

@tropicadri tropicadri left a comment

Choose a reason for hiding this comment

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

Yay, I like this change.

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.

2 participants