@wordpress/build 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/lib/build.mjs +4 -28
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.16.0 (2026-06-04)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- Revert the getter-based export replacement in `@wordpress/build` to restore compatibility for affected Gutenberg 23.0 builds ([#78917](https://github.com/WordPress/gutenberg/pull/78917)).
|
|
10
|
+
|
|
5
11
|
## 0.15.0 (2026-05-27)
|
|
6
12
|
|
|
7
13
|
## 0.14.0 (2026-05-14)
|
package/lib/build.mjs
CHANGED
|
@@ -564,35 +564,11 @@ async function bundlePackage( packageName, options = {} ) {
|
|
|
564
564
|
globalName,
|
|
565
565
|
};
|
|
566
566
|
|
|
567
|
-
//
|
|
568
|
-
// 1. If the package has a default export, unwrap the namespace so
|
|
569
|
-
// `globalName` IS the default value.
|
|
570
|
-
// 2. For every package that exposes a global namespace, replace
|
|
571
|
-
// esbuild's getter-based re-exports with direct data properties.
|
|
572
|
-
// esbuild emits each export as `Object.defineProperty(ns, k,
|
|
573
|
-
// { get: () => binding })` to preserve ESM live-binding semantics
|
|
574
|
-
// across hoisting; consumers then pay a getter call on every
|
|
575
|
-
// property access. Across the editor mount that's hundreds of
|
|
576
|
-
// thousands of getter invocations (every hook, every selector).
|
|
577
|
-
// Once the IIFE has finished, the bindings are stable, so we can
|
|
578
|
-
// read each getter once and replace it with a plain data
|
|
579
|
-
// property — same value, ~2x cheaper per access in V8.
|
|
580
|
-
const footerParts = [];
|
|
567
|
+
// For packages with default exports, add a footer to properly expose the default
|
|
581
568
|
if ( packageJson.wpScriptDefaultExport && globalName ) {
|
|
582
|
-
|
|
583
|
-
`if (typeof ${ globalName } === 'object' && ${ globalName }.default) { ${ globalName } = ${ globalName }.default; }
|
|
584
|
-
|
|
585
|
-
}
|
|
586
|
-
if ( globalName ) {
|
|
587
|
-
// esbuild marks the getters non-configurable, so we can't rewrite
|
|
588
|
-
// them in place; replacing the whole namespace with a shallow
|
|
589
|
-
// copy is the simplest way to materialize each value once.
|
|
590
|
-
footerParts.push(
|
|
591
|
-
`if(${ globalName }&&typeof ${ globalName }==='object'){${ globalName }=Object.assign({},${ globalName });}`
|
|
592
|
-
);
|
|
593
|
-
}
|
|
594
|
-
if ( footerParts.length ) {
|
|
595
|
-
baseConfig.footer = { js: footerParts.join( '' ) };
|
|
569
|
+
baseConfig.footer = {
|
|
570
|
+
js: `if (typeof ${ globalName } === 'object' && ${ globalName }.default) { ${ globalName } = ${ globalName }.default; }`,
|
|
571
|
+
};
|
|
596
572
|
}
|
|
597
573
|
|
|
598
574
|
const baseBundlePlugins = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/build",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Build tool for WordPress plugins.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@emotion/babel-plugin": "11.13.5",
|
|
39
|
-
"@wordpress/style-runtime": "^0.
|
|
39
|
+
"@wordpress/style-runtime": "^0.4.0",
|
|
40
40
|
"autoprefixer": "10.4.21",
|
|
41
41
|
"browserslist-to-esbuild": "2.1.1",
|
|
42
42
|
"change-case": "4.1.2",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "e7856693aeb4e2522d13608cd32c994e4a97cb9c"
|
|
82
82
|
}
|