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

TrustedScriptURL support for workbox-window #2872

Merged
merged 1 commit into from
Jul 7, 2021
Merged

Conversation

jeffposnick
Copy link
Contributor

R: @tropicadri
CC: @budarin

Fixes #2855

This should be backwards compatible. At some point, if TrustedScriptURL is added to the TypeScript lib.dom library, we can remove the dependency on @types/trusted-types.

@tropicadri tropicadri merged commit 1ec2689 into v6 Jul 7, 2021
@jeffposnick jeffposnick deleted the window-trusted-types branch July 14, 2021 21:03
@cypressious
Copy link

cypressious commented Aug 8, 2021

After upgrading Workbox to 6.2.2 in my Vue project, I'm now getting a build error

 error  in Y:/Repos/xxx/Frontend/node_modules/workbox-window/Workbox.d.ts

ERROR in Y:/Repos/xxx/Frontend/node_modules/workbox-window/Workbox.d.ts(1,34):
1:34 Cannot find module 'trusted-types/lib' or its corresponding type declarations.
  > 1 | import { TrustedScriptURL } from 'trusted-types/lib';
      |                                  ^
    2 | import { WorkboxEventTarget } from './utils/WorkboxEventTarget.js';
    3 | import './_version.js';
    4 | /**

Is @types/trusted-types now a required dependency?

@jeffposnick
Copy link
Contributor Author

I'm sorry about that—you're correct in that those type definitions should be listed in dependencies and not devDependencies to ensure that folks who install workbox-window from npm have also get the type defs.

This will be fixed in an upcoming v6.2.3 release, but in the meantime, you can explicitly add @types/trusted-types to your project if you're blocked on v6.2.2.

@jeffposnick
Copy link
Contributor Author

This should be resolved in v6.2.3: https://github.com/GoogleChrome/workbox/releases/tag/v6.2.3

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.

Trusted types support in workbox-window's register()
3 participants