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

Migrate workbox-webpack-plugin to TypeScript #2478

Closed
jeffposnick opened this issue Apr 28, 2020 · 10 comments · Fixed by #2882
Closed

Migrate workbox-webpack-plugin to TypeScript #2478

jeffposnick opened this issue Apr 28, 2020 · 10 comments · Fixed by #2882
Assignees
Labels
TypeScript Issues related to our TypeScript annotations. workbox-webpack-plugin

Comments

@jeffposnick
Copy link
Contributor

Placeholder to track the migration.

@jeffposnick jeffposnick added workbox-webpack-plugin TypeScript Issues related to our TypeScript annotations. labels Apr 28, 2020
@roikoren755
Copy link
Contributor

Is there any update on the state of the migration in this repo?

I'd be more than happy to help, and submit a PR or two migrating packages to TypeScript. Just point me in the right direction :)

@jeffposnick
Copy link
Contributor Author

Not for workbox-webpack-plugin at this time.

I am in the middle of migrating workbox-build to TypeScipt (#2477, WIP code at https://github.com/GoogleChrome/workbox/compare/wb-build-ts). That is a more involved migration, as it's also going to including switching from joi to something like https://github.com/gristlabs/ts-interface-checker or https://github.com/pelotom/runtypes to use the TypeScript parameter definitions as the source of truth for runtime option validation.

Once #2477 is complete, I think the workbox-webpack-plugin migration should be more straightforward. If you're looking to contribute at that point, that would be great!

@roikoren755
Copy link
Contributor

Sounds good!
Like I said, I'd be more than happy to help with the migration, not only for workbox-webpack-plugin, but for other packages in this repo as well. Anything you need help with, especially if it has to do with migrating to TypeScript, just let me know :)

@roikoren755
Copy link
Contributor

roikoren755 commented Jun 30, 2021

I see #2477 was merged recently 🎉.

Is there any work currently being done to migrate workbox-webpack-plugin to TypeScript?

If not, I can take a look at it over the weekend, get something started :)

I will say in advance, from my experience, webpack types are incompatible between v4 and v5, and migrating this package to TypeScript might mean having to pick one over the other...

@jeffposnick
Copy link
Contributor Author

Thanks for following up on your initial offer!

Feel free to take a look, and even if you're not able to fully take this on, I'm happy to continue a WIP PR at some point.

The nuance of incompatible webpack v4 and v5 types is an interesting problem... I'm going to ask some colleagues if they have ever run into similar problems. I wonder if adding in explicit devDependencies on both webpack-v4 and webpack-v5 and then explicitly importing both of their exported types, along with some conditional casting, would end up being a path forward.

@DibyodyutiMondal
Copy link
Contributor

Is there any update on this?
The typings published for the webpack plugin is old and I think is incomplete as well.

I am making a custom plugin for angular and while it works in practice, the only problem is that typescript keeps complaining so I have to silence it.

@roikoren755
Copy link
Contributor

Sorry, I haven't had the time to push this forward on my end...
If anyone is interested in taking the helm on this and continue with my base branch, you are more than welcome.
Otherwise, I'll try and find the time to work on it

@jeffposnick
Copy link
Contributor Author

@tropicadri from the core Workbox engineering team is actively working on getting the open PR cleaned up: #2882

@tropicadri
Copy link
Collaborator

The PR is ready for review. It should be live relatively soon.

@jeffposnick
Copy link
Contributor Author

This is released as part of https://github.com/GoogleChrome/workbox/releases/tag/v6.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TypeScript Issues related to our TypeScript annotations. workbox-webpack-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants