From 861437ce639df98947b48e62adc1bf358bb63596 Mon Sep 17 00:00:00 2001 From: David Arenas Date: Thu, 16 May 2024 21:52:05 +0200 Subject: [PATCH] Clarify warning messages (#61720) Co-authored-by: DAreRodz Co-authored-by: michalczaplinski --- packages/interactivity/src/hooks.tsx | 2 +- packages/interactivity/src/vdom.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/interactivity/src/hooks.tsx b/packages/interactivity/src/hooks.tsx index 01b5fbf043149e..735ed26aabc8cc 100644 --- a/packages/interactivity/src/hooks.tsx +++ b/packages/interactivity/src/hooks.tsx @@ -271,7 +271,7 @@ export const directive = ( const resolve = ( path: string, namespace: string ) => { if ( ! namespace ) { warn( - `The "namespace" cannot be "{}", "null" or an empty string. Path: ${ path }` + `Namespace missing for "${ path }". The value for that path won't be resolved.` ); return; } diff --git a/packages/interactivity/src/vdom.ts b/packages/interactivity/src/vdom.ts index 8d3e43ba1c8361..cc481f89ff772a 100644 --- a/packages/interactivity/src/vdom.ts +++ b/packages/interactivity/src/vdom.ts @@ -140,7 +140,7 @@ export function toVdom( root: Node ): Array< ComponentChild > { ( obj, [ name, ns, value ] ) => { const directiveMatch = directiveParser.exec( name ); if ( directiveMatch === null ) { - warn( `Invalid directive: ${ name }.` ); + warn( `Found malformed directive name: ${ name }.` ); return obj; } const prefix = directiveMatch[ 1 ] || '';