diff --git a/flow-typed/npm/pretty-format_v26.x.x.js b/flow-typed/npm/pretty-format_v26.x.x.js deleted file mode 100644 index bd2c68334cffb3..00000000000000 --- a/flow-typed/npm/pretty-format_v26.x.x.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @flow strict - * @format - */ - -type PrettyFormatPlugin = - | { - test: (value: mixed) => boolean, - print: (value: mixed) => string, - } - | { - test: (value: mixed) => boolean, - serialize: (value: mixed) => string, - }; - -declare module 'pretty-format' { - declare module.exports: { - ( - value: mixed, - options?: ?{ - callToJSON?: ?boolean, - escapeRegex?: ?boolean, - escapeString?: ?boolean, - highlight?: ?boolean, - indent?: ?number, - maxDepth?: ?number, - min?: ?boolean, - plugins?: ?Array, - printFunctionName?: ?boolean, - theme?: ?{ - comment?: ?string, - prop?: ?string, - tag?: ?string, - value: ?string, - }, - }, - ): string, - - plugins: { - AsymmetricMatcher: PrettyFormatPlugin, - ConvertAnsi: PrettyFormatPlugin, - DOMCollection: PrettyFormatPlugin, - DOMElement: PrettyFormatPlugin, - Immutable: PrettyFormatPlugin, - ReactElement: PrettyFormatPlugin, - ReactTestComponent: PrettyFormatPlugin, - }, - }; -} diff --git a/packages/react-native/Libraries/Utilities/HMRClient.js b/packages/react-native/Libraries/Utilities/HMRClient.js index 8a772abfb8bc27..bed704f269c0c3 100644 --- a/packages/react-native/Libraries/Utilities/HMRClient.js +++ b/packages/react-native/Libraries/Utilities/HMRClient.js @@ -126,7 +126,7 @@ const HMRClient: HMRClientNativeInterface = { data: data.map(item => typeof item === 'string' ? item - : prettyFormat(item, { + : prettyFormat.format(item, { escapeString: true, highlight: true, maxDepth: 3, diff --git a/packages/react-native/package.json b/packages/react-native/package.json index a3d87604d4fe5e..f836c147df21e7 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -135,7 +135,7 @@ "metro-source-map": "^0.80.3", "mkdirp": "^0.5.1", "nullthrows": "^1.1.1", - "pretty-format": "^26.5.2", + "pretty-format": "^29.7.0", "promise": "^8.3.0", "react-devtools-core": "^5.3.1", "react-refresh": "^0.14.0", diff --git a/yarn.lock b/yarn.lock index a68d6102c53e80..efc65b55d2d904 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7389,7 +7389,7 @@ pretty-format@^24.9.0: ansi-styles "^3.2.0" react-is "^16.8.4" -pretty-format@^26.5.2, pretty-format@^26.6.2: +pretty-format@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" integrity sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg== @@ -7417,6 +7417,15 @@ pretty-format@^29.6.3: ansi-styles "^5.0.0" react-is "^18.0.0" +pretty-format@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" + integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== + dependencies: + "@jest/schemas" "^29.6.3" + ansi-styles "^5.0.0" + react-is "^18.0.0" + prettyjson@^1.2.1: version "1.2.5" resolved "https://registry.yarnpkg.com/prettyjson/-/prettyjson-1.2.5.tgz#ef3cfffcc70505c032abc59785884b4027031835"