X Tutup
Skip to content

ExpressionChangedAfterChecked error improvements for Ivy #34454

@AndrewKushnir

Description

@AndrewKushnir

PR #34381 improves ExpressionChangedAfterChecked error by adding property name for property bindings and also the content of the entire property interpolation. There are few more things that we can improve:

  • for attribute bindings and interpolations, include attribute name and the entire expression (similar to property bindings and interpolations). Implemented in PR feat(ivy): improve ExpressionChangedAfterChecked error message for attributes #34505.

  • for text interpolations (like Some exp {{ exp1 }} and {{ exp2 }}), we can store metadata in tView.data and display the whole block when we throw an error (making sure we limit the length of the output from interpolation). Implemented in PR feat(ivy): improve ExpressionChangedAfterChecked error message for text interpolations #34520.

  • when expression value is an object, the [Object object] is printed, we can JSON.stringify it (or smth similar) and limit it to 1000 chars or so.

  • for i18n attributes (like <div i18n-title title="Some exp {{ exp1 }}"></div>) we can extract property name from i18n metadata (stored in tView.data, but using a different format). Currently property name for such cases are not be included into ExpressionChangedAfterChecked error.

  • Include component's name into the error message, so that it's easier to find the template where the problem happened. Implemented in refactor(core): Improve ExpressionChangedAfterItHasBeenCheckedError #50286.

  • Consider including an expression that caused the problem (should work for text interpolations at least). However this is not trivial, since it'd require changes to the generated code and including the ngDevMode flag, so that this extra debug info doesn't make it into prod bundles.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    X Tutup