Skip to content

Commit

Permalink
Use DEWP's new auto-wp-polyfill support (#39629)
Browse files Browse the repository at this point in the history
`@wordpress/dependency-extraction-webpack-plugin` has added the ability
to detect a magic `/* wp:polyfill */` comment and only add `wp-polyfill`
as a dependency if that is found. Since `wp-polyfill` is just a custom
build of `core-js`, the intention is that
`babel-plugin-polyfill-corejs3` (maybe via `@babel/preset-env`) would be
used and then a custom Babel plugin would replace the `core-js` imports
with the magic comment.

This updates our Babel config to do just that, and removes the blanket
addition of `wp-polyfill` via `injectPolyfill` or otherwise.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11277506405

Upstream-Ref: Automattic/jetpack@3af5563
  • Loading branch information
anomiex authored and matticbot committed Oct 10, 2024
1 parent 87d7083 commit b3e3a64
Show file tree
Hide file tree
Showing 17 changed files with 166 additions and 154 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
This is an alpha version! The changes listed here are not final.

### Changed
- Only include `wp-polyfill` as a script dependency when needed.
- Updated package dependencies.

### Removed
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => 'a88c39debce9f37e844d');
<?php return array('dependencies' => array('react', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'a88c39debce9f37e844d');
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('jetpack-script-data', 'react', 'react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '087d67cbaedaadbdfce4');
<?php return array('dependencies' => array('jetpack-script-data', 'react', 'react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '087d67cbaedaadbdfce4');
8 changes: 8 additions & 0 deletions jetpack_vendor/automattic/jetpack-explat/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.12-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Changed
- Only include `wp-polyfill` as a script dependency when needed.

## [0.1.11] - 2024-10-10
### Changed
- Updated package dependencies. [#39649]
Expand Down Expand Up @@ -60,6 +67,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ExPlat: add condition to prevent fetching the experiment assignment if there's not anon id (meaning that Tracks is likely disabled) [#38327]
- Updated package dependencies. [#38132]

[0.1.12-alpha]: https://github.com/Automattic/jetpack-explat/compare/v0.1.11...v0.1.12-alpha
[0.1.11]: https://github.com/Automattic/jetpack-explat/compare/v0.1.10...v0.1.11
[0.1.10]: https://github.com/Automattic/jetpack-explat/compare/v0.1.9...v0.1.10
[0.1.9]: https://github.com/Automattic/jetpack-explat/compare/v0.1.8...v0.1.9
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-polyfill', 'wp-url'), 'version' => '3c050f0c6b858f4a2ec5');
<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-url'), 'version' => '3c050f0c6b858f4a2ec5');
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ExPlat {
*
* @var string
*/
const PACKAGE_VERSION = '0.1.11';
const PACKAGE_VERSION = '0.1.12-alpha';

/**
* Initializer.
Expand Down
6 changes: 1 addition & 5 deletions jetpack_vendor/automattic/jetpack-explat/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ module.exports = [
...jetpackWebpackConfig.resolve,
},
node: false,
plugins: [
...jetpackWebpackConfig.StandardPlugins( {
DependencyExtractionPlugin: { injectPolyfill: true },
} ),
],
plugins: [ ...jetpackWebpackConfig.StandardPlugins() ],
module: {
strictExportPresence: true,
rules: [
Expand Down
8 changes: 8 additions & 0 deletions jetpack_vendor/automattic/jetpack-jitm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.1.26-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Changed
- Only include `wp-polyfill` as a script dependency when needed.

## [3.1.25] - 2024-10-10
### Changed
- Updated package dependencies. [#39707]
Expand Down Expand Up @@ -779,6 +786,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Update Jetpack to use new JITM package

[3.1.26-alpha]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.25...v3.1.26-alpha
[3.1.25]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.24...v3.1.25
[3.1.24]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.23...v3.1.24
[3.1.23]: https://github.com/Automattic/jetpack-jitm/compare/v3.1.22...v3.1.23
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('jquery', 'wp-polyfill'), 'version' => 'a41583033504a4ed0b13');
<?php return array('dependencies' => array('jquery'), 'version' => 'a41583033504a4ed0b13');
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-jitm/src/class-jitm.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
class JITM {

const PACKAGE_VERSION = '3.1.25';
const PACKAGE_VERSION = '3.1.26-alpha';

/**
* The configuration method that is called from the jetpack-config package.
Expand Down
3 changes: 3 additions & 0 deletions jetpack_vendor/automattic/jetpack-my-jetpack/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

This is an alpha version! The changes listed here are not final.

### Changed
- Only include `wp-polyfill` as a script dependency when needed.

## [4.35.12] - 2024-10-10
### Changed
- Update Boost's pricing table to include latest feature list. [#39130]
Expand Down
4 changes: 2 additions & 2 deletions jetpack_vendor/automattic/jetpack-my-jetpack/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"automattic/jetpack-assets": "^2.3.10",
"automattic/jetpack-boost-speed-score": "^0.3.12",
"automattic/jetpack-connection": "^5.1.3",
"automattic/jetpack-explat": "^0.1.11",
"automattic/jetpack-jitm": "^3.1.25",
"automattic/jetpack-explat": "^0.1.12-alpha",
"automattic/jetpack-jitm": "^3.1.26-alpha",
"automattic/jetpack-licensing": "^2.0.10",
"automattic/jetpack-plugins-installer": "^0.4.3",
"automattic/jetpack-redirect": "^2.0.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ module.exports = [
...jetpackWebpackConfig.resolve,
},
node: false,
plugins: [
...jetpackWebpackConfig.StandardPlugins( {
DependencyExtractionPlugin: { injectPolyfill: true },
} ),
],
plugins: [ ...jetpackWebpackConfig.StandardPlugins() ],
module: {
strictExportPresence: true,
rules: [
Expand Down
8 changes: 4 additions & 4 deletions jetpack_vendor/i18n-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@
),
'jetpack-explat' => array(
'path' => 'jetpack_vendor/automattic/jetpack-explat',
'ver' => '0.1.11',
'ver' => '0.1.12-alpha1728575216',
),
'jetpack-ip' => array(
'path' => 'jetpack_vendor/automattic/jetpack-ip',
'ver' => '0.3.0',
),
'jetpack-jitm' => array(
'path' => 'jetpack_vendor/automattic/jetpack-jitm',
'ver' => '3.1.25',
'ver' => '3.1.26-alpha1728575216',
),
'jetpack-licensing' => array(
'path' => 'jetpack_vendor/automattic/jetpack-licensing',
'ver' => '2.0.10',
),
'jetpack-my-jetpack' => array(
'path' => 'jetpack_vendor/automattic/jetpack-my-jetpack',
'ver' => '4.35.13-alpha1728573025',
'ver' => '4.35.13-alpha1728575216',
),
'jetpack-password-checker' => array(
'path' => 'jetpack_vendor/automattic/jetpack-password-checker',
Expand All @@ -66,7 +66,7 @@
),
'jetpack-search-pkg' => array(
'path' => 'jetpack_vendor/automattic/jetpack-search',
'ver' => '0.45.8-alpha1728573025',
'ver' => '0.45.8-alpha1728575216',
),
'jetpack-stats' => array(
'path' => 'jetpack_vendor/automattic/jetpack-stats',
Expand Down
Loading

0 comments on commit b3e3a64

Please sign in to comment.