fix: raise BackendVarFormatError for the remaining backend var UI uses

SH
4h ago
+219-23

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Description

Closes #7843.

Every row in the issue now raises the same BackendVarFormatError as the other UI paths, and none of them prints the default value:

  • children and typed props check for a Field before the generic checks. The meta row goes through the typed prop check, so it raises when the page compiles.
  • event arguments re-raise the error that LiteralVar.create already builds, instead of wrapping it in EventHandlerTypeError.
  • add_page checks on_load, the same way it checks title, description and image.
  • Field.__eq__ raises when a backend var is compared with something that isn't a field, and __bool__ raises for a backend var. Field-to-field comparison stays identity, and __hash__ stays object.__hash__, so dict keys, sets and in checks over fields work as before.

The comparison and bool checks also cover a mixin's fields, since formatting one already raises the mixin message. I kept the check off ordering (State._n > 0) and in, which already fail with a plain TypeError rather than silently.

Tests: one per row, plus mixins, field identity and hashing. The 13 new or changed tests fail on main and pass with the fix. The full unit suite has the same failures as main (only the pyi_generator tests, which fail on my machine with or without this change). I also updated the two upgrading guides that described the old errors.