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

short icon names only #2072

Merged
merged 4 commits into from
Feb 2, 2018
Merged

short icon names only #2072

merged 4 commits into from
Feb 2, 2018

Conversation

giladgray
Copy link
Contributor

@giladgray giladgray commented Feb 2, 2018

Fixes #2067

Changes proposed in this pull request:

  • 🔥 remove LegacyIconName type and support
  • add generated IconNames module: export const ARROW_DOWN = "arrow-down"; ...
  • generate-icons-source produces files that export many consts instead of one object. upside is they're all string literals without the as cast.
    • use import * as to glob generated consts into objects.
    • ⚠️ IconName becomes derived type from shape of IconNames. comes out the same and works identically in VS Code 👍

Gilad Gray added 3 commits February 2, 2018 12:24
…of one object. upside is they're all string literals without the `as` cast.
IconName becomes derived type from shape of IconNames
@@ -24,7 +24,8 @@ describe("<Icon>", () => {

it("renders iconName class", () => assertIcon(<Icon iconName="calendar" />, "calendar"));

it("supports prefixed iconName", () => assertIcon(<Icon iconName={IconClasses.AIRPLANE} />, "airplane"));
// uncomment for compiler error
// it("does not support prefixed iconName", () => assertIcon(<Icon iconName="pt-icon-airplane" />, "airplane"));
Copy link
Contributor

Choose a reason for hiding this comment

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

with TS 2.6 you can use // @ts-ignore to ignore the compiler error. then you could make this test verify that it doesn't render anything

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoa

@blueprint-bot
Copy link

remove normalizedIconName, ts-ignore test compiler error

Preview: documentation | landing | table

@giladgray giladgray merged commit ac0103b into develop Feb 2, 2018
@giladgray giladgray deleted the gg/short-icon-only branch February 2, 2018 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants