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

Export more classes/types publicly #2955

Merged
merged 4 commits into from
Oct 14, 2021
Merged

Export more classes/types publicly #2955

merged 4 commits into from
Oct 14, 2021

Conversation

jeffposnick
Copy link
Contributor

R: @tropicadri

Fixes #1824, fixes #2952

The additional exports of TypeScript types that might be useful to some developers via the top-level index.ts is hopefully not controversial.

There are also two previously private, internal classes in the workbox-background-sync module that this PR makes public. Based on the initial issue request, there's a use for developers accessing these directly, but I've warned in the JSDoc that most developers shouldn't. You've touched the workbox-background-sync code most recently, @tropicadri, so I'll defer to whether you anticipate any problems with making those classes public.

Copy link
Collaborator

@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.

The test check for the exported types and right now they are not matching:

  1. [all] Window and SW packages
    should have top a level module for every export in index.mjs (and vise-versa):

    AssertionError: expected [ Array(4) ] to deeply equal [ 'BackgroundSyncPlugin', 'Queue' ]

    • expected - actual

    [
    "BackgroundSyncPlugin"
    "Queue"

    • "QueueStore"
    • "StorableRequest"
      ]
@jeffposnick
Copy link
Contributor Author

Hmm... I remember when we added that restriction, and I guess it makes sense. I'll create a top-level module for each of those that re-exports the code in ./lib/. Technically the ./lib/ code isn't part of our public API, so I could probably just move the modules out of ./lib/, but I have a feeling there might be some people who are using them at their current location, so we'll have to save that until a future major release of Workbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants