UIP-2074 Dart2js warning workaround #52
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ultimate problem:
There are dart2js warnings incorrectly emitted (likely due to dart-lang/sdk#16030) by each component class declared using over_react, of the form:
These logs are annoying and get in the way of legitimate dart2js warnings.
How it was fixed:
call
in each UiProps impl classThis method was found to work by chance after messing around with the generated output a bit.
Illustration of the changes in generated output:
Results
Without these error messages, the
pub build
output for this repo went down from 54.3KB to 1.3KB.For our large UI library, web_skin_dart,
pub build
output was reduced from 223.3KB to 11.9KB.Testing suggestions:
pub serve
and verify that the component demos render properly in dart2jsPotential areas of regression:
Component base code.