-
Notifications
You must be signed in to change notification settings - Fork 805
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
Blocks: i18n: Translatable strings from *.min.js #21343
Comments
This also came up in:
|
Noting that we switched to the .min.js file extension to prevent the built files from being handled by wp.com's JS minimization script, which started breaking when we dropped IE 11 (thus output into more modern JS). |
This is apparently expected behavior for the make-pot CLI command:
from https://developer.wordpress.org/cli/commands/i18n/make-pot/ I have in my mind that we checked GlotPress and confirmed the strings were there? If so, make-pot isn't the issue (I wouldn't think). If not, then we need to figure out something—either via make-pot or Systems re the wp.com need for .min.js that pushed us this way. |
@kraftbj, I was able to get Previously, there was a problem with the translation function names not being preserved in the minified output, but that got resolved in 1e56ff3 and by inspecting the plugin files I can confirm that I'm not familiar with the reason why |
WordPress.com has an automatically minimizing process for JS upon being served to a client. That process assumes ES5 code. When we dropped IE 11 support, we started shipping ES6 code which WordPress.com's minimizing function chokes on (thus breaking blocks on WordPress.com with the same code committed there as in Jetpack). Systems said that we should update the file name to Duplication is an okay immediate solution to get translations back for customers that we have control over, but I don't like it as a long-term solution as it doubles the JS payload we're shipping to customers with no benefit (beyond hacking around ecosystem issues). tl;dr duplicate files is okay immediately but I'll task my team (or myself) to investigate further the |
"Shipping to customers" as in including both the minified and non-minifed built JS files in the Jetpack plugin? Or "shipping to customers" thinking that visitors to the site would get served both copies? To be clear, the latter would not happen. |
Confirm, the latter wouldn't happen. I'd not want to ship too much extra to sites in the plugin upgrade routine. |
Related: #21367 |
This is intended to (eventually) take care of several issues in the monorepo: * Calypso [doesn't use their own calyspo-build webpack config][1], which means it's not likely to be well-maintained. * It needs a hack to [work with monorepo packages][2]. * And another to [get correct image paths][3]. * And it [tries to redefine NODE_ENV, producing warnings][4]. * And we have to [override a weird default everywhere][5]. * We have to [name our JS files with ".min.js"][6] to avoid their being broken by a wpcom minifier, but WordPress.org's translation infrastructure [ignores such files][7]. * The plugin used to fix the above [had to be forked][8], adds 772K to the plugin, and results in spurious changes in TC builds. * The way translations are [being loaded for lazy-loaded bundles][9] is pretty hacky and doesn't lazy-load them. * We can't use any cache busting for the lazy-loaded bundles, because embedding hashes in the filename breaks the link to the translation file and putting it in a query parameter [breaks building the RTL css][10]. * Calypso-build has a lot of peer dependencies we don't actually need. Not everything we have uses sass or postcss, and we have our own infrastructure for jest, react, and so on. Currently we just ignore the 76 warnings from that. This is the first step towards fixing that: creating a private package that can hold the webpack and babel config fragments that we can share throughout the monorepo. Then we'll have a place to put the fixes for some of the other issues too. [1]: #21004 (comment) [2]: Automattic/wp-calypso#53353 [3]: Automattic/wp-calypso#56111 [4]: Automattic/wp-calypso#56291 [5]: #21004 [6]: #20484 [7]: #21343 [8]: https://github.com/Automattic/jetpack/blob/7a5edd83/projects/plugins/jetpack/tools/webpack.helpers.js#L35 [9]: #20926 [10]: #21349
This is intended to (eventually) take care of several issues in the monorepo: * Calypso [doesn't use their own calyspo-build webpack config][1], which means it's not likely to be well-maintained. * It needs a hack to [work with monorepo packages][2]. * And another to [get correct image paths][3]. * And it [tries to redefine NODE_ENV, producing warnings][4]. * And we have to [override a weird default everywhere][5]. * We have to [name our JS files with ".min.js"][6] to avoid their being broken by a wpcom minifier, but WordPress.org's translation infrastructure [ignores such files][7]. * The plugin used to fix the above [had to be forked][8], adds 772K to the plugin, and results in spurious changes in TC builds. * The way translations are [being loaded for lazy-loaded bundles][9] is pretty hacky and doesn't lazy-load them. * We can't use any cache busting for the lazy-loaded bundles, because embedding hashes in the filename breaks the link to the translation file and putting it in a query parameter [breaks building the RTL css][10]. * Calypso-build has a lot of peer dependencies we don't actually need. Not everything we have uses sass or postcss, and we have our own infrastructure for jest, react, and so on. Currently we just ignore the 76 warnings from that. This is the first step towards fixing that: creating a private package that can hold the webpack and babel config fragments that we can share throughout the monorepo. Then we'll have a place to put the fixes for some of the other issues too. [1]: #21004 (comment) [2]: Automattic/wp-calypso#53353 [3]: Automattic/wp-calypso#56111 [4]: Automattic/wp-calypso#56291 [5]: #21004 [6]: #20484 [7]: #21343 [8]: https://github.com/Automattic/jetpack/blob/7a5edd83/projects/plugins/jetpack/tools/webpack.helpers.js#L35 [9]: #20926 [10]: #21349
This is intended to (eventually) take care of several issues in the monorepo: * Calypso [doesn't use their own calyspo-build webpack config][1], which means it's not likely to be well-maintained. * It needs a hack to [work with monorepo packages][2]. * And another to [get correct image paths][3]. * And it [tries to redefine NODE_ENV, producing warnings][4]. * And we have to [override a weird default everywhere][5]. * We have to [name our JS files with ".min.js"][6] to avoid their being broken by a wpcom minifier, but WordPress.org's translation infrastructure [ignores such files][7]. * The plugin used to fix the above [had to be forked][8], adds 772K to the plugin, and results in spurious changes in TC builds. * The way translations are [being loaded for lazy-loaded bundles][9] is pretty hacky and doesn't lazy-load them. * We can't use any cache busting for the lazy-loaded bundles, because embedding hashes in the filename breaks the link to the translation file and putting it in a query parameter [breaks building the RTL css][10]. * Webpack's minification is [losing translator comments][11]. * Calypso-build has a lot of peer dependencies we don't actually need. Not everything we have uses sass or postcss, and we have our own infrastructure for jest, react, and so on. Currently we just ignore the 76 warnings from that. This is the first step towards fixing that: creating a private package that can hold the webpack and babel config fragments that we can share throughout the monorepo. Then we'll have a place to put the fixes for some of the other issues too. [1]: #21004 (comment) [2]: Automattic/wp-calypso#53353 [3]: Automattic/wp-calypso#56111 [4]: Automattic/wp-calypso#56291 [5]: #21004 [6]: #20484 [7]: #21343 [8]: https://github.com/Automattic/jetpack/blob/7a5edd83/projects/plugins/jetpack/tools/webpack.helpers.js#L35 [9]: #20926 [10]: #21349 [11]: #16549
This is intended to (eventually) take care of several issues in the monorepo: * Calypso [doesn't use their own calyspo-build webpack config][1], which means it's not likely to be well-maintained. * It needs a hack to [work with monorepo packages][2]. * And another to [get correct image paths][3]. * And it [tries to redefine NODE_ENV, producing warnings][4]. * And we have to [override a weird default everywhere][5]. * We have to [name our JS files with ".min.js"][6] to avoid their being broken by a wpcom minifier, but WordPress.org's translation infrastructure [ignores such files][7]. * The plugin used to fix the above [had to be forked][8], adds 772K to the plugin, and results in spurious changes in TC builds. * The way translations are [being loaded for lazy-loaded bundles][9] is pretty hacky and doesn't lazy-load them. * We can't use any cache busting for the lazy-loaded bundles, because embedding hashes in the filename breaks the link to the translation file and putting it in a query parameter [breaks building the RTL css][10]. * Webpack's minification is [losing translator comments][11]. * Calypso-build has a lot of peer dependencies we don't actually need. Not everything we have uses sass or postcss, and we have our own infrastructure for jest, react, and so on. Currently we just ignore the 76 warnings from that. This is the first step towards fixing that: creating a private package that can hold the webpack and babel config fragments that we can share throughout the monorepo. Then we'll have a place to put the fixes for some of the other issues too. [1]: #21004 (comment) [2]: Automattic/wp-calypso#53353 [3]: Automattic/wp-calypso#56111 [4]: Automattic/wp-calypso#56291 [5]: #21004 [6]: #20484 [7]: #21343 [8]: https://github.com/Automattic/jetpack/blob/7a5edd83/projects/plugins/jetpack/tools/webpack.helpers.js#L35 [9]: #20926 [10]: #21349 [11]: #16549
This is intended to (eventually) take care of several issues in the monorepo: * Calypso [doesn't use their own calyspo-build webpack config][1], which means it's not likely to be well-maintained. * It needs a hack to [work with monorepo packages][2]. * And another to [get correct image paths][3]. * And it [tries to redefine NODE_ENV, producing warnings][4]. * And we have to [override a weird default everywhere][5]. * We have to [name our JS files with ".min.js"][6] to avoid their being broken by a wpcom minifier, but WordPress.org's translation infrastructure [ignores such files][7]. * The plugin used to fix the above [had to be forked][8], adds 772K to the plugin, and results in spurious changes in TC builds. * The way translations are [being loaded for lazy-loaded bundles][9] is pretty hacky and doesn't lazy-load them. * We can't use any cache busting for the lazy-loaded bundles, because embedding hashes in the filename breaks the link to the translation file and putting it in a query parameter [breaks building the RTL css][10]. * Webpack's minification is [losing translator comments][11]. * Calypso-build has a lot of peer dependencies we don't actually need. Not everything we have uses sass or postcss, and we have our own infrastructure for jest, react, and so on. Currently we just ignore the 76 warnings from that. This is the first step towards fixing that: creating a private package that can hold the webpack and babel config fragments that we can share throughout the monorepo. Then we'll have a place to put the fixes for some of the other issues too. [1]: #21004 (comment) [2]: Automattic/wp-calypso#53353 [3]: Automattic/wp-calypso#56111 [4]: Automattic/wp-calypso#56291 [5]: #21004 [6]: #20484 [7]: #21343 [8]: https://github.com/Automattic/jetpack/blob/7a5edd83/projects/plugins/jetpack/tools/webpack.helpers.js#L35 [9]: #20926 [10]: #21349 [11]: #16549
This is intended to (eventually) take care of several issues in the monorepo: * Calypso [doesn't use their own calyspo-build webpack config][1], which means it's not likely to be well-maintained. * It needs a hack to [work with monorepo packages][2]. * And another to [get correct image paths][3]. * And it [tries to redefine NODE_ENV, producing warnings][4]. * And we have to [override a weird default everywhere][5]. * We have to [name our JS files with ".min.js"][6] to avoid their being broken by a wpcom minifier, but WordPress.org's translation infrastructure [ignores such files][7]. * The plugin used to fix the above [had to be forked][8], adds 772K to the plugin, and results in spurious changes in TC builds. * The way translations are [being loaded for lazy-loaded bundles][9] is pretty hacky and doesn't lazy-load them. * We can't use any cache busting for the lazy-loaded bundles, because embedding hashes in the filename breaks the link to the translation file and putting it in a query parameter [breaks building the RTL css][10]. * Webpack's minification is [losing translator comments][11]. * Calypso-build has a lot of peer dependencies we don't actually need. Not everything we have uses sass or postcss, and we have our own infrastructure for jest, react, and so on. Currently we just ignore the 76 warnings from that. This is the first step towards fixing that: creating a private package that can hold the webpack and babel config fragments that we can share throughout the monorepo. Then we'll have a place to put the fixes for some of the other issues too. [1]: Automattic/jetpack#21004 (comment) [2]: Automattic/wp-calypso#53353 [3]: Automattic/wp-calypso#56111 [4]: Automattic/wp-calypso#56291 [5]: Automattic/jetpack#21004 [6]: Automattic/jetpack#20484 [7]: Automattic/jetpack#21343 [8]: https://github.com/Automattic/jetpack/blob/7a5edd83/projects/plugins/jetpack/tools/webpack.helpers.js#L35 [9]: Automattic/jetpack#20926 [10]: Automattic/jetpack#21349 [11]: Automattic/jetpack#16549 Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/1409697994
This is intended to (eventually) take care of several issues in the monorepo: * Calypso [doesn't use their own calyspo-build webpack config][1], which means it's not likely to be well-maintained. * It needs a hack to [work with monorepo packages][2]. * And another to [get correct image paths][3]. * And it [tries to redefine NODE_ENV, producing warnings][4]. * And we have to [override a weird default everywhere][5]. * We have to [name our JS files with ".min.js"][6] to avoid their being broken by a wpcom minifier, but WordPress.org's translation infrastructure [ignores such files][7]. * The plugin used to fix the above [had to be forked][8], adds 772K to the plugin, and results in spurious changes in TC builds. * The way translations are [being loaded for lazy-loaded bundles][9] is pretty hacky and doesn't lazy-load them. * We can't use any cache busting for the lazy-loaded bundles, because embedding hashes in the filename breaks the link to the translation file and putting it in a query parameter [breaks building the RTL css][10]. * Webpack's minification is [losing translator comments][11]. * Calypso-build has a lot of peer dependencies we don't actually need. Not everything we have uses sass or postcss, and we have our own infrastructure for jest, react, and so on. Currently we just ignore the 76 warnings from that. This is the first step towards fixing that: creating a private package that can hold the webpack and babel config fragments that we can share throughout the monorepo. Then we'll have a place to put the fixes for some of the other issues too. [1]: Automattic/jetpack#21004 (comment) [2]: Automattic/wp-calypso#53353 [3]: Automattic/wp-calypso#56111 [4]: Automattic/wp-calypso#56291 [5]: Automattic/jetpack#21004 [6]: Automattic/jetpack#20484 [7]: Automattic/jetpack#21343 [8]: https://github.com/Automattic/jetpack/blob/7a5edd83/projects/plugins/jetpack/tools/webpack.helpers.js#L35 [9]: Automattic/jetpack#20926 [10]: Automattic/jetpack#21349 [11]: Automattic/jetpack#16549 Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/1409697994
This is intended to (eventually) take care of several issues in the monorepo: * Calypso [doesn't use their own calyspo-build webpack config][1], which means it's not likely to be well-maintained. * It needs a hack to [work with monorepo packages][2]. * And another to [get correct image paths][3]. * And it [tries to redefine NODE_ENV, producing warnings][4]. * And we have to [override a weird default everywhere][5]. * We have to [name our JS files with ".min.js"][6] to avoid their being broken by a wpcom minifier, but WordPress.org's translation infrastructure [ignores such files][7]. * The plugin used to fix the above [had to be forked][8], adds 772K to the plugin, and results in spurious changes in TC builds. * The way translations are [being loaded for lazy-loaded bundles][9] is pretty hacky and doesn't lazy-load them. * We can't use any cache busting for the lazy-loaded bundles, because embedding hashes in the filename breaks the link to the translation file and putting it in a query parameter [breaks building the RTL css][10]. * Webpack's minification is [losing translator comments][11]. * Calypso-build has a lot of peer dependencies we don't actually need. Not everything we have uses sass or postcss, and we have our own infrastructure for jest, react, and so on. Currently we just ignore the 76 warnings from that. This is the first step towards fixing that: creating a private package that can hold the webpack and babel config fragments that we can share throughout the monorepo. Then we'll have a place to put the fixes for some of the other issues too. [1]: Automattic/jetpack#21004 (comment) [2]: Automattic/wp-calypso#53353 [3]: Automattic/wp-calypso#56111 [4]: Automattic/wp-calypso#56291 [5]: Automattic/jetpack#21004 [6]: Automattic/jetpack#20484 [7]: Automattic/jetpack#21343 [8]: https://github.com/Automattic/jetpack/blob/7a5edd83/projects/plugins/jetpack/tools/webpack.helpers.js#L35 [9]: Automattic/jetpack#20926 [10]: Automattic/jetpack#21349 [11]: Automattic/jetpack#16549 Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/1409697994
This is intended to (eventually) take care of several issues in the monorepo: * Calypso [doesn't use their own calyspo-build webpack config][1], which means it's not likely to be well-maintained. * It needs a hack to [work with monorepo packages][2]. * And another to [get correct image paths][3]. * And it [tries to redefine NODE_ENV, producing warnings][4]. * And we have to [override a weird default everywhere][5]. * We have to [name our JS files with ".min.js"][6] to avoid their being broken by a wpcom minifier, but WordPress.org's translation infrastructure [ignores such files][7]. * The plugin used to fix the above [had to be forked][8], adds 772K to the plugin, and results in spurious changes in TC builds. * The way translations are [being loaded for lazy-loaded bundles][9] is pretty hacky and doesn't lazy-load them. * We can't use any cache busting for the lazy-loaded bundles, because embedding hashes in the filename breaks the link to the translation file and putting it in a query parameter [breaks building the RTL css][10]. * Webpack's minification is [losing translator comments][11]. * Calypso-build has a lot of peer dependencies we don't actually need. Not everything we have uses sass or postcss, and we have our own infrastructure for jest, react, and so on. Currently we just ignore the 76 warnings from that. This is the first step towards fixing that: creating a private package that can hold the webpack and babel config fragments that we can share throughout the monorepo. Then we'll have a place to put the fixes for some of the other issues too. [1]: Automattic/jetpack#21004 (comment) [2]: Automattic/wp-calypso#53353 [3]: Automattic/wp-calypso#56111 [4]: Automattic/wp-calypso#56291 [5]: Automattic/jetpack#21004 [6]: Automattic/jetpack#20484 [7]: Automattic/jetpack#21343 [8]: https://github.com/Automattic/jetpack/blob/7a5edd83/projects/plugins/jetpack/tools/webpack.helpers.js#L35 [9]: Automattic/jetpack#20926 [10]: Automattic/jetpack#21349 [11]: Automattic/jetpack#16549 Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/1409697994
This is intended to (eventually) take care of several issues in the monorepo: * Calypso [doesn't use their own calyspo-build webpack config][1], which means it's not likely to be well-maintained. * It needs a hack to [work with monorepo packages][2]. * And another to [get correct image paths][3]. * And it [tries to redefine NODE_ENV, producing warnings][4]. * And we have to [override a weird default everywhere][5]. * We have to [name our JS files with ".min.js"][6] to avoid their being broken by a wpcom minifier, but WordPress.org's translation infrastructure [ignores such files][7]. * The plugin used to fix the above [had to be forked][8], adds 772K to the plugin, and results in spurious changes in TC builds. * The way translations are [being loaded for lazy-loaded bundles][9] is pretty hacky and doesn't lazy-load them. * We can't use any cache busting for the lazy-loaded bundles, because embedding hashes in the filename breaks the link to the translation file and putting it in a query parameter [breaks building the RTL css][10]. * Webpack's minification is [losing translator comments][11]. * Calypso-build has a lot of peer dependencies we don't actually need. Not everything we have uses sass or postcss, and we have our own infrastructure for jest, react, and so on. Currently we just ignore the 76 warnings from that. This is the first step towards fixing that: creating a private package that can hold the webpack and babel config fragments that we can share throughout the monorepo. Then we'll have a place to put the fixes for some of the other issues too. [1]: Automattic/jetpack#21004 (comment) [2]: Automattic/wp-calypso#53353 [3]: Automattic/wp-calypso#56111 [4]: Automattic/wp-calypso#56291 [5]: Automattic/jetpack#21004 [6]: Automattic/jetpack#20484 [7]: Automattic/jetpack#21343 [8]: https://github.com/Automattic/jetpack/blob/7a5edd83/projects/plugins/jetpack/tools/webpack.helpers.js#L35 [9]: Automattic/jetpack#20926 [10]: Automattic/jetpack#21349 [11]: Automattic/jetpack#16549 Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/1409697994
Do you have any update on this issue? |
@yuliyan We've been discussing potential solutions here: We'd be happy to have you chime in on that discussion! |
We renamed them to `.min.js` to avoid a broken wpcom minifier. But now that we have `Assets::register_script()` to automatically add `?minify=false` to them, we can put them back at the `.js` names. Also we can again remove the hashes from the chunk filenames now that `@automattic/webpack-rtl-plugin` is fixed. This should fix #19752, and get us closer on #21343. We've got other files being processed by gulp instead of webpack that may need attention (or maybe just conversion to being processed by Webpack) before we can say #21343 is complete.
I think that #21748 fixed this entirely after all. As far as I can tell none of the files that were being processed by gulp use |
Impacted plugin
Jetpack
Steps to Reproduce
wp i18n make-pot .
*.min.js
files are missing..min
suffix from the filename of any of the JS files that contain translatable strings (e.g._inc/blocks/editor.min.js
) and runwp i18n make-pot .
again.A clear and concise description of what you expected to happen.
AFAIK, the plugin directory is using the same (or pretty similar) approach to
wp i18n make-pot .
to generate POT file for a plugin and import into its translate.wordpress.org project. By default, themake-pot
command excludes some files and directories from scanning, including*.min.js
files.As a result:
.min.js
are no longer being generated, because none of the strings have reference to such file.Other information
.min
suffix introduced in: be80d26Related issue: #21204
The text was updated successfully, but these errors were encountered: