Skip to content

Commit af69f1c

Browse files
committed
Add changelog
1 parent 7dd903a commit af69f1c

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

packages/interactivity/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
## 5.5.0 (2024-04-19)
66

7+
### Enhancements
8+
9+
- Improve data-wp-context debugging by validating it as a stringified JSON Object. ([#61045](https://github.com/WordPress/gutenberg/pull/61045))
10+
711
### Bug Fixes
812

913
- Hooks useMemo and useCallback should return a value. ([#60474](https://github.com/WordPress/gutenberg/pull/60474))

packages/interactivity/src/directives.js

+2-10
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,8 @@ export default () => {
244244
if ( defaultEntry ) {
245245
const { namespace, value } = defaultEntry;
246246
// Check that the value is a JSON object. Send a console warning if not.
247-
if ( SCRIPT_DEBUG && typeof value !== 'object' ) {
248-
warning(
249-
sprintf(
250-
// translators: %s: store namespace.
251-
__(
252-
'The value of data-wp-context in "%s" store must be a valid stringified JSON object.'
253-
),
254-
namespace
255-
)
256-
);
247+
if ( SCRIPT_DEBUG && isPlainObject(value) ) {
248+
console.warn('The value of data-wp-context in "%s" store must be a valid stringified JSON object.')
257249
}
258250
updateSignals( currentValue.current, {
259251
[ namespace ]: deepClone( value ),

0 commit comments

Comments
 (0)