opened
swissspidy
username_0
## Bug Description

The plugin bundles `@wordpress/components` because it uses the `withFilters` component. That means unnecessarily including tons of JavaScript. One side effect of that is users having to translate irrelevant strings on https://translate.wordpress.org/projects/wp-plugins/google-site-kit/ because they're part of the package.

The solution would be to copy the code of `withFilters` and ditch the components package entirely.

## Additional Context

<!-- Please complete the following information. -->
 - PHP Version: 
 - OS: [e.g. iOS]
 - Browser [e.g. chrome, safari]
 - Plugin Version [e.g. 22]
 - Device: [e.g. iPhone6]

<!-- Please add any additional information about the bug. -->

---------------

_Do not alter or remove anything below. The following sections will be managed by moderators only._

## Acceptance criteria

* <!-- One or more bullet points for acceptance criteria. -->

## Implementation Brief

* <!-- One or more bullet points for how to technically resolve the issue. -->

## Changelog entry

* <!-- One sentence summarizing the PR, to be used in the changelog. -->
`wordpress/components` package wrongly included
issue
created
aaemnnosttv
username_1
Why would contributors need to translate strings that aren't under the `google-site-kit` text domain?

Also, all of `@wordpress/components` shouldn't be included in our bundles since we only reference the `wp` global in our consuming code.
comment
created
swissspidy
username_0
WordPress.org translation platform scans all strings irregardless of text domain for various reasons.
comment
created
felixarntz
username_2
We need to bundle it for pre-Gutenberg versions as a polyfill. However, I completely agree with the IB, we should fully eliminate this dependency and instead bundle that single function "manually".
comment
created
swissspidy
username_0
I've had a PoC over at #784, but based on #437. It would need to be rebased to `develop` for a patch release. If anyone wants to take that over, feel free :-)
comment
created
aaemnnosttv
username_1
@username_0 #802 is a version of your PR which targets `develop`. It also removes `@wordpress/components` as a dependency in a few other places.
comment
created
aaemnnosttv
username_1
#802 is ready for review, although if we end up going with #437 for i18n sooner than later then #784 would be easier to merge since they share a common base.
comment
created
tofumatt
username_3
Grepping through the content, looking through code with `// translators: ` comments, and looking through `__()` calls from the output of `npm run build` in the `dist/` folder this looks good to me; I can't see anything from outside the `google-site-kit` i18n domain.

If there were particular strings showing up before it would be good to note those and I can specifically check for them. But this seems to work so QA ✅
comment
created
swissspidy
username_0
@username_3 See https://translate.wordpress.org/projects/wp-plugins/google-site-kit/dev/es/default/ for strings that are wrongly included. You'll see string like "Comma", "Error loading block: %s", and "Font Size"
comment
closed
felixarntz
username_2
issue
created
tofumatt
username_3
Didn't see any of those in the output, so 👍
comment