-
-
Notifications
You must be signed in to change notification settings - Fork 829
Load audioWorklet in a Webpack 5 compatible way #11845
Conversation
Ah, looks like the dead code scanner doesn't recognize the imports within the worklet as used anymore now. 🤦♂️ Will have to look into that. |
I'm actually not sure how to properly fix the dead code issues. The problem is that after switching to loading the worklet using its literal path, we don't require the worklet import anymore but without the import the worklet is considered dead code. If we could specify the worklet as an entry for the dead code analysis, that should fix it but ts-prune doesn't support specifying entries manually from what I can see (though its successor https://github.com/webpro/knip does). Alternatively, we could also add ignores for the seemingly unused symbols but that feels whack-a-mole-ish given that we'll have the same problem with web workers once we ditch worker-loader. @t3chguy any thoughts on how to proceed here? |
@Johennes could we not trick it by keeping the import and not just not using it with an eslint ignore & ts-ignore for the time being |
That would also work. All of these options feel like they have downsides but maybe this would be the easiest one. |
This now works with Webpack 5 but due to the use of |
I'm gonna close this in favor of #11860 in which I have merged this pull request. There is a lot of overlap between these two and both will have to land in concert with element-hq/element-web#26229. |
For: element-hq/element-web#26229
We currently use worklet-loader but it isn't designed to work with Webpack 5. The built-in worklet support in Webpack 5 requires the use of URLs in the
addModule
call alongside special configuration.This change is marked as an internal change (Task), so will not be included in the changelog.