Skip to content

Commit

Permalink
chore(doc): better dev message for missing delegate and call binding …
Browse files Browse the repository at this point in the history
  • Loading branch information
bigopon committed Feb 1, 2023
1 parent 8fbd6b9 commit cb0f646
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/runtime-html/src/compiler/template-compiler.ts
Expand Up @@ -1786,7 +1786,18 @@ class CompilationContext {
result = this.c.create(BindingCommand, name) as BindingCommandInstance;
if (result === null) {
if (__DEV__)
throw createError(`AUR0713: Unknown binding command: ${name}`);
throw createError(`AUR0713: Unknown binding command: ${name}.
${name === 'delegate'
? `The ".delegate" binding command has been removed in v2. Binding command ".trigger" should be used instead.
If you are migrating v1 application, install compat package to add back the ".delegate" binding command for ease of migration.
`
: ''
}${name === 'call'
? `The ".call" binding command has been deprecated removed in v2.

This comment has been minimized.

Copy link
@ekzobrain

ekzobrain Feb 1, 2023

Contributor

"deprecated removed" typo

If you want to pass a callback that preserves the context of the function call, you can use lambda instead. Refer to lambda expression doc for more details.`
: ''
}
`);
else
throw createError(`AUR0713:${name}`);
}
Expand Down

0 comments on commit cb0f646

Please sign in to comment.