-
Notifications
You must be signed in to change notification settings - Fork 58
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
UIP-2447 Make DomProps/SvgProps implement UiProps for more convenient DDC typing #87
UIP-2447 Make DomProps/SvgProps implement UiProps for more convenient DDC typing #87
Conversation
RavenNumber of Findings: 0 |
Codecov Report
@@ Coverage Diff @@
## master #87 +/- ##
=======================================
Coverage 94.81% 94.81%
=======================================
Files 31 31
Lines 1522 1522
=======================================
Hits 1443 1443
Misses 79 79 |
+1 |
+1 |
@greglittlefield-wf when I add the following to void main() {
// ...
bool bar = false;
ReactElement fooExample() {
UiProps builder;
if (bar) {
builder = Dom.div();
} else {
builder = Button();
}
// ignore: invocation_of_non_function_expression
return builder()('Herro');
}
// ...
} I still see the following error when I load the page serving w/ the ddc...
It also isn't a great story for the consumer - IMO - since the analyzer will tell them that they can't invoke a non-function expression... but I'm not sure of a way around that. |
@aaronlademann-wf You have an extra set of parentheses there, so that error is valid: -return builder()('Herro');
+return builder('Herro'); |
I feel so ashamed |
QA +10
Merging. |
Haha don't worry, easy mistake to make. |
Ultimate problem:
The following code is affected by a DDC issue affecting emulated functions and
noSuchMethod
(issue: dart-lang/sdk#29904):The easiest way for consumers to work around it, is to type
builder
. In this case, however, the least upper bound iscomponent_base.UiProps
, so consumers would have to import that.It would be nice if they could just do
UiProps builder;
, using theUiProps
exposed by over_react.dart.How it was fixed:
Make
DomProps
/SvgProps
implementUiProps
for more convenient typing in the scenario mentioned above.Testing suggestions:
Potential areas of regression: