Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the DataContext type mismatch error message #1892

Draft
wants to merge 13 commits into
base: resource-datacontext
Choose a base branch
from

Conversation

exyi
Copy link
Member

@exyi exyi commented Dec 12, 2024

No description provided.

exyi added 13 commits November 23, 2024 20:31
This functionality is essential for server-side
only rendering, but this patch is only the groundwork -
we still need to add support to Repeater and possibly other controls.

The design is fairly simple - we allow resource binding
in data context and track that this data context does
not exist client-side (see the new ServerSideOnly property).
Using this server-only data context is not allowed in value
and staticCommand bindings. Note that using a value binding
inside the resource-bound control is allowed, it just cannot
reference `_this`. Since the context does not exist client-side,
we then translate _parent into $data instead of $parent.
* ExpectedType property can now be null, when the assigned property is unknwon:
   - this means that CreateBinding will actually create a strongly
     typed instance, instead of just ValueBindingExpression<object> or similar
* AutoUI uses props.Property instead of CreateValueBinding where possible
@exyi exyi force-pushed the resource-datacontext branch 3 times, most recently from bc1e371 to 27ae8e1 Compare February 8, 2025 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant