Skip to content
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

Add webpack-config package #21482

Merged
merged 2 commits into from
Nov 1, 2021
Merged

Add webpack-config package #21482

merged 2 commits into from
Nov 1, 2021

Conversation

anomiex
Copy link
Contributor

@anomiex anomiex commented Oct 20, 2021

Changes proposed in this Pull Request:

This is intended to (eventually) take care of several issues in the
monorepo:

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.

Jetpack product discussion

PT: p9dueE-3MG-p2

Does this pull request change what data or activity we track or use?

No

Testing instructions:

  • Does it make sense?

@anomiex anomiex added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] In Progress [Type] Janitorial [Pri] Normal labels Oct 20, 2021
@anomiex anomiex self-assigned this Oct 20, 2021
@anomiex anomiex force-pushed the add/webpack-config-js-package branch from 71724e4 to 6c95097 Compare October 20, 2021 21:07
@github-actions github-actions bot added [Package] Lazy Images This package no longer exists in the monorepo. [JS Package] Webpack Config labels Oct 20, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2021

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.

@anomiex anomiex force-pushed the add/webpack-config-js-package branch from 6c95097 to 576bea3 Compare October 20, 2021 21:40
@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello anomiex! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer and confirm D68789-code works as expected before merging this PR. Once this PR is merged, please commit the changes to WP.com. Thank you!
This revision will be updated with each commit to this PR

@anomiex anomiex force-pushed the add/webpack-config-js-package branch 2 times, most recently from c4a4ca1 to 09556ec Compare October 25, 2021 21:00
@github-actions github-actions bot added [Package] Connection UI This package no longer exists in the monorepo. RNA labels Oct 25, 2021
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
@anomiex anomiex force-pushed the add/webpack-config-js-package branch from 09556ec to 8b9263f Compare October 28, 2021 19:20
@github-actions github-actions bot added [Package] Identity Crisis This package no longer exists in the monorepo. It was merged into [Package] Connection. [Package] Jitm [Package] Sync [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ Instant Search [Feature] Search For all things related to Search labels Oct 28, 2021
@anomiex anomiex force-pushed the add/webpack-config-js-package branch 2 times, most recently from 0e243b1 to 2d34e9d Compare October 28, 2021 20:08
@anomiex anomiex marked this pull request as ready for review October 28, 2021 20:08
@anomiex anomiex added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Feature] Search For all things related to Search Instant Search [Package] Lazy Images This package no longer exists in the monorepo. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Package] Connection UI This package no longer exists in the monorepo. [Package] Jitm [Package] Identity Crisis This package no longer exists in the monorepo. It was merged into [Package] Connection. [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. labels Oct 28, 2021
@kraftbj kraftbj enabled auto-merge (squash) November 1, 2021 20:43
kraftbj
kraftbj previously approved these changes Nov 1, 2021
Copy link
Contributor

@kraftbj kraftbj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My internet is acting up and I'm having trouble pushing a resolution commit to get fix the lock file.

Otherwise, looks logical to me.

@kraftbj kraftbj added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Nov 1, 2021
@kraftbj kraftbj merged commit 77c7ae1 into master Nov 1, 2021
@kraftbj kraftbj deleted the add/webpack-config-js-package branch November 1, 2021 21:06
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Nov 1, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2021

Great news! One last step: head over to your WordPress.com diff, D68789-code, and commit it.
Once you've done so, come back to this PR and add a comment with your changeset ID.

Thank you!

davidlonjon added a commit that referenced this pull request Nov 2, 2021
…ng-formatting

* master:
  docker: Add script to create "fake" translations for testing i18n (#21407)
  Add webpack-config package (#21482)
  Update dependency composer/semver to v3.2.6 (#21608)
  Update dependency eslint-plugin-import to v2.25.2 (#21607)
  Update JS unit testing packages (#21605)
  Admin page: Fix pricing/currency displayed on the upgrade page (#21594)
  Update dependency @rollup/plugin-node-resolve to v13.0.6 (#21599)
  Publicize: Add new publicize icon toggle component (#20957)
  Search: hide search menu for atomic sites (#21565)
  Allow /wp/v2/sites/1234/batch endpoint to process widget updates (#21549)
  tooling: Add `.mjs` as a JavaScript extension (#21589)
  Jetpack: PHPCS src/class-tracking (#21583)
  Publicize: make the default social media message blank (#21477)
davidlonjon added a commit that referenced this pull request Nov 2, 2021
* master:
  docker: Add script to create "fake" translations for testing i18n (#21407)
  Add webpack-config package (#21482)
  Update dependency composer/semver to v3.2.6 (#21608)
  Update dependency eslint-plugin-import to v2.25.2 (#21607)
  Update JS unit testing packages (#21605)
  Admin page: Fix pricing/currency displayed on the upgrade page (#21594)
  Update dependency @rollup/plugin-node-resolve to v13.0.6 (#21599)
  Publicize: Add new publicize icon toggle component (#20957)
  Search: hide search menu for atomic sites (#21565)
  Allow /wp/v2/sites/1234/batch endpoint to process widget updates (#21549)
  tooling: Add `.mjs` as a JavaScript extension (#21589)
  Jetpack: PHPCS src/class-tracking (#21583)
  Publicize: make the default social media message blank (#21477)
davidlonjon added a commit that referenced this pull request Nov 2, 2021
* master: (40 commits)
  docker: Add script to create "fake" translations for testing i18n (#21407)
  Add webpack-config package (#21482)
  Update dependency composer/semver to v3.2.6 (#21608)
  Update dependency eslint-plugin-import to v2.25.2 (#21607)
  Update JS unit testing packages (#21605)
  Admin page: Fix pricing/currency displayed on the upgrade page (#21594)
  Update dependency @rollup/plugin-node-resolve to v13.0.6 (#21599)
  Publicize: Add new publicize icon toggle component (#20957)
  Search: hide search menu for atomic sites (#21565)
  Allow /wp/v2/sites/1234/batch endpoint to process widget updates (#21549)
  tooling: Add `.mjs` as a JavaScript extension (#21589)
  Jetpack: PHPCS src/class-tracking (#21583)
  Publicize: make the default social media message blank (#21477)
  Photon: do not serve Wikipedia images from CDN. (#21572)
  Publicize: update endpoint (#21510)
  [Plugin] Backup: Update initial backup screen (#21559)
  RNA Connect Screen: Remove unused files (#21570)
  RNA Connection: Add ConnectScreenRequiredPlan Component (#21521)
  Update PHPUnit coverage configs (#21557)
  cli: Fix skeleton phpunit config (#21555)
  ...
@anomiex
Copy link
Contributor Author

anomiex commented Nov 2, 2021

r234325-wpcom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants