Skip to content

Commit

Permalink
Add webpack-config package (#21482)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kraftbj authored and matticbot committed Nov 1, 2021
1 parent a7dc52e commit 20b5a55
Show file tree
Hide file tree
Showing 83 changed files with 529 additions and 529 deletions.
1 change: 0 additions & 1 deletion _inc/blocks/788.14064aefb46e9e64d8d5.js

This file was deleted.

1 change: 1 addition & 0 deletions _inc/blocks/897.1e9ee8dc85cc08bf7e34.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _inc/blocks/business-hours/view.min.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'a07cebaa040ede48ea12b5c7fb9a72f6');
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '9ea7f778d6ace92295cfe097962e72a1');
2 changes: 1 addition & 1 deletion _inc/blocks/business-hours/view.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _inc/blocks/button/view.min.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'bdc3dfa40b1789bea349d951444afd8f');
<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'd7ff51cc45aa9dc957f25a9a51391d49');
2 changes: 1 addition & 1 deletion _inc/blocks/button/view.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _inc/blocks/calendly/view.min.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '26e3c8ff0d0e13dc4d20abd769fa0704');
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '96f448dd7b196165841448e7557bed42');
2 changes: 1 addition & 1 deletion _inc/blocks/calendly/view.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions _inc/blocks/components.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _inc/blocks/contact-info/view.min.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '73ee624f36106dac39cd298323186157');
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '3fb5b4577736c973b6eeb0a85d4c12f3');
2 changes: 1 addition & 1 deletion _inc/blocks/contact-info/view.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _inc/blocks/dialogue/view.min.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-data', 'wp-dom-ready', 'wp-polyfill'), 'version' => '18497632d0424d1ffb44435c5d143962');
<?php return array('dependencies' => array('wp-data', 'wp-dom-ready', 'wp-polyfill'), 'version' => '7ebc3ac98410781ff08c2eefb726d1a1');
2 changes: 1 addition & 1 deletion _inc/blocks/dialogue/view.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _inc/blocks/donations/view.min.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'react', 'wp-compose', 'wp-dom-ready', 'wp-keycodes', 'wp-polyfill', 'wp-url'), 'version' => 'b91179b64cc9a22248818442a600e214');
<?php return array('dependencies' => array('lodash', 'react', 'wp-compose', 'wp-dom-ready', 'wp-keycodes', 'wp-polyfill', 'wp-url'), 'version' => '97fe041b98001e25cf6bc3c3ffd9a324');
6 changes: 3 additions & 3 deletions _inc/blocks/donations/view.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _inc/blocks/editor-beta.min.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-a11y', 'wp-annotations', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport'), 'version' => 'ed449e65064489ccfcb3398723248cf0');
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-a11y', 'wp-annotations', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport'), 'version' => 'ff5e0803c19612fd763b471c3d920ce3');
10 changes: 5 additions & 5 deletions _inc/blocks/editor-beta.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _inc/blocks/editor-experimental.min.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-a11y', 'wp-annotations', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport'), 'version' => '825d258533832acd31479dccc34eedb1');
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-a11y', 'wp-annotations', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport'), 'version' => 'b91a5a787e06423ebd1daab857ce90f8');
10 changes: 5 additions & 5 deletions _inc/blocks/editor-experimental.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _inc/blocks/editor-no-post-editor.min.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-token-list', 'wp-url', 'wp-viewport'), 'version' => '10a6045295a2d1183ffd54699427d2dd');
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-token-list', 'wp-url', 'wp-viewport'), 'version' => '155480120f570f80d58e845c7b1542c3');
8 changes: 4 additions & 4 deletions _inc/blocks/editor-no-post-editor.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _inc/blocks/editor.min.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-a11y', 'wp-annotations', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-token-list', 'wp-url', 'wp-viewport'), 'version' => '303f29a4c0498d3805b830f3e009da8c');
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-a11y', 'wp-annotations', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-token-list', 'wp-url', 'wp-viewport'), 'version' => '9019148b926f893d9ac2b2489332f60c');
10 changes: 5 additions & 5 deletions _inc/blocks/editor.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _inc/blocks/eventbrite/view.min.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'd469bddb66b5e2f2ed9de75a5c3479f7');
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '6760c59feb30a420a8155db9c5e831cc');
Loading

0 comments on commit 20b5a55

Please sign in to comment.