Migrate workbox-webpack-plugin to TypeScript
Brought to you by:
tomkozak
Originally created by: jeffposnick
Originally owned by: tropicadri
Placeholder to track the migration.
Originally posted by: roikoren755
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 :)
Originally posted by: jeffposnick
Not for
workbox-webpack-pluginat this time.I am in the middle of migrating
workbox-buildto 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 fromjoito 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-pluginmigration should be more straightforward. If you're looking to contribute at that point, that would be great!Related
Tickets:
#2477Originally posted by: roikoren755
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 :)Originally posted by: roikoren755
I see [#2477] was merged recently 🎉.
Is there any work currently being done to migrate
workbox-webpack-pluginto TypeScript?If not, I can take a look at it over the weekend, get something started :)
I will say in advance, from my experience,
webpacktypes are incompatible between v4 and v5, and migrating this package to TypeScript might mean having to pick one over the other...Related
Tickets:
#2477Originally posted by: jeffposnick
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
webpackv4 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 explicitdevDependencieson bothwebpack-v4andwebpack-v5and then explicitly importing both of their exported types, along with some conditional casting, would end up being a path forward.Originally posted by: DibyodyutiMondal
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.
Originally posted by: roikoren755
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
Originally posted by: jeffposnick
@tropicadri from the core Workbox engineering team is actively working on getting the open PR cleaned up: https://github.com/GoogleChrome/workbox/pull/2882
Originally posted by: tropicadri
The PR is ready for review. It should be live relatively soon.
Ticket changed by: jeffposnick
Originally posted by: jeffposnick
This is released as part of https://github.com/GoogleChrome/workbox/releases/tag/v6.5.0