dev: disable xstate inspector in prod build (#46109)

* dev: disable xstate inspector in prod build

* Add changefile(s) from automation for the following project(s): woocommerce

* revert unintended require

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
RJ 2024-04-03 13:53:19 +08:00 committed by GitHub
parent 4e9fc5a90f
commit 40be78c265
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -55,7 +55,11 @@ if ( isDevelopmentEnvironment && isXStateInspectEnabled ) {
export const useXStateInspect = ( machineVersion ) => {
let xstateV5Inspector;
if ( isXStateV5InspectEnabled && machineVersion === 'V5' ) {
if (
isDevelopmentEnvironment &&
isXStateV5InspectEnabled &&
machineVersion === 'V5'
) {
xstateV5Inspector = XStateV5Inspect().inspect;
}

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
Fixes a bug introduced previously where enabling localStorage.xstateV5_inspect would cause the page to crash because it's not supposed to be used in prod builds.