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

[web] Migrate Flutter Web to JS static interop - 7. #32519

Merged
merged 1 commit into from
Apr 14, 2022

Conversation

joshualitt
Copy link
Contributor

This is CL 7 in a series of CLs to migrate Flutter Web to the new JS static interop API.

This CL migrates more of canvaskit_api.dart(about 59% through that file).

@flutter-dashboard flutter-dashboard bot added the platform-web Code specifically for the web engine label Apr 8, 2022
@joshualitt
Copy link
Contributor Author

@srujzs ptal. Mostly just a trivial migration, aside from:

  1. SkPath generative constructor to factory
  2. Deleting some unused methods off _CkCubicFilterOptions and _CkTransformFilterOptions. I originally added extensions for them, but the analyzer complained causing a test to fail.

class _CkCubicFilterOptions extends CkFilterOptions {
external double get B;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What errors were you getting from moving these to extensions? Are these unused (similar question for the other removed members)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, they appear to be unused and so the analyzer warned. The flutter web project has a check that turns the analyzer warnings to errors. It sort of makes sense that the analyzer is stricter with extension methods because they are static.

I'm not sure what we can really do here other than maybe some annotation that makes the warnings go away, but given that the methods really are seemingly unused, it may make sense to just remove them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I was just mostly curious why warnings started to appear now instead of before when they were unused anyways.

@srujzs
Copy link
Contributor

srujzs commented Apr 8, 2022

LGTM

@joshualitt joshualitt marked this pull request as ready for review April 8, 2022 21:13
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@joshualitt joshualitt requested review from yjbanov and eyebrowsoffire and removed request for yjbanov April 8, 2022 21:13
@Hixie
Copy link
Contributor

Hixie commented Apr 14, 2022

test-exempt: code refactor with no semantic change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs tests platform-web Code specifically for the web engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants