Open asafm7 opened 3 years ago
The Podcast block does indeed rely on WordPress components on the frontend: https://github.com/Automattic/jetpack/blob/f3eb42a8c23de8ab43b1a818eee9c42dcef50751/extensions%2Fblocks%2Fpodcast-player%2Fview.js#L11
We've opted for this approach in order to leverage the tools made available in WordPress (instead of bundling our own components), but it does have its disadvantages as you've discovered.
An alternative approach could be to rely on external dependencies instead of WordPress'. That's something we may consider for a future iteration.
Thanks @jeherve for your response!
It seems like a big hit to performance (although I'm not an expert) so it might be worth considering.
I think it is an excellent approach to re-use dependencies. Maybe the problem is with WordPress core? Maybe "components.min.js" should be more modular by itself? I guess you guys can make this suggestion if you believe it makes any sense.
Thanks again.
When adding a podcast player to a page, the file "components.min.js" is being enqueued.
77% percent of this file is not used, and this is a pretty big file. According to the DevTools coverage tool, more then 0.5MB of this file is not being used:![image](https://user-images.githubusercontent.com/14274769/100005666-3a00c880-2dc1-11eb-8a6d-7efadc7d79c7.png)
It makes it the first opportunity to come up in the Lighthouse report.
Maybe there is a more efficient way for enabling the podcast player?