Skip to content

Conversation

@xster
Copy link
Member

@xster xster commented Sep 2, 2020

Description

This PR makes a forward and backward compatible move to cupertino_icons 1.0.0 currently available in pre-release in https://pub.dev/packages/cupertino_icons/versions/1.0.0-dev.1.

Generation is done via https://github.com/xster/framework7-icons.

This file still works and will continue to work with cupertino_icons 0.1.3 (the latest version). When users upgrade past this commit and also pub upgrades cupertino_icons to 1.0.0, icons will be replaced in-place for the newer icon version based on the same glyph codepoint. Users can't accidentally upgrade to 1.0.0 before this PR since cupertino_icons SDK constrains to Flutter 1.22+ only.

A few cupertino_icons icons have no SF Symbol equivalent however. Those will have deprecation warnings.
There are deprecations because I didn't want to waste space and duplicate the same glyphs over multiple codepoints to fill something in for the deprecated fonts. And I can't change their definitions to a different codepoint in the SDK in case they're still on cupertino_icons 0.1.3 where those codepoints are still valid.

The new font's 390B bigger than before but that's inevitable since we ~tripled the amount of available font.

Next PRs:

  • micro-adjust Cupertino usages of new icon for aesthetic fidelity.
  • figure out some inline dartdoc with image preview.

Related Issues

#33916.
#16102.
Partly addresses #60034

Tests

This just changes mapping that isn't used anywhere.

Checklist

Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read [Handling breaking changes].

@xster xster requested a review from goderbauer September 2, 2020 08:49
@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.

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

@flutter-dashboard flutter-dashboard bot added f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels. labels Sep 2, 2020
@xster
Copy link
Member Author

xster commented Sep 2, 2020

Actually I can improve this slightly to make it a non-breaking change. It seems like adding the glyph svgs to multiple codepoint doesn't increase the font size. Maybe the fontforge script API has some automatic optimizations. Retweaking.

Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

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

LGTM

@xster
Copy link
Member Author

xster commented Sep 2, 2020

cc @devoncarew @DanTup

I just noticed there's special code in the ide plugins to draw previews of the icon in the gutter. I'm updating the ttf in the cupertino_icons package. What needs to be updated in the plugins?

@xster
Copy link
Member Author

xster commented Sep 2, 2020

I won't be able to conform to the deprecation annotation lint pattern (since it's deprecated by a package, not a flutter version). Maybe it's a good thing since I just went back and undeprecated all the glyphs by extracting the old svgs, adding them to the new ttf and auto width'ing the new glyph bounds in cupertino_icons 1.0.0-dev.3

@DanTup
Copy link
Contributor

DanTup commented Sep 2, 2020

@xster there's a repo at https://github.com/flutter/tools_metadata that collects metadata for the tools, including icon previews. Dart-Code is still using its own repo for icons right now, but I'm planning to switch to using them from that repo soon.

@devoncarew
Copy link
Contributor

Yup, we re-generate the framework metadata here: https://github.com/flutter/tools_metadata#regenerating-metadata, then commit the updated metadata back to the repo. We re-generate from the dev channel (we want something more stable than master).

It then a manual process to copy the updated metadata into the flutter/flutter-intellij repo (https://github.com/flutter/flutter-intellij/tree/master/resources/flutter).

@xster
Copy link
Member Author

xster commented Sep 2, 2020

Understood. So the next step is to wait for this to bubble through the pipeline a bit first?

@devoncarew
Copy link
Contributor

Understood. So the next step is to wait for this to bubble through the pipeline a bit first?

Yup; unless it's critical - the current previews become incorrect or something - we'll see a latency of about a month (wait for dev; re-generate; copy to the IDEs, and, wait for the next monthly IDE release).

@xster
Copy link
Member Author

xster commented Sep 2, 2020

That's fine. I'm gonna generally going to point people to https://flutter.github.io/cupertino_icons/ as the source of truth for the time being (wonder if you can reuse some of that css stuff to make things easier for you)

@xster
Copy link
Member Author

xster commented Sep 2, 2020

Soft visual breaking change doc at flutter/website#4570

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants