Skip to content

Typeguard icon usage in composites#1533

Merged
JamesBurnside merged 40 commits intomainfrom
jaburnsi/typeguard-icon-usage-in-composites
Mar 1, 2022
Merged

Typeguard icon usage in composites#1533
JamesBurnside merged 40 commits intomainfrom
jaburnsi/typeguard-icon-usage-in-composites

Conversation

@JamesBurnside
Copy link
Copy Markdown
Member

@JamesBurnside JamesBurnside commented Feb 23, 2022

What

  • Add strongly typed icon wrappers that ensure the icon is customizable and no silly things like a typo existing.
  • Expose the customizable icons we weren't currently exposing
  • Adds Download, ChevronLeft and Cancel icons to the list of customizable icons
  • Added eslint rule to enfore

Note: this is only for composites-only icons. It's gets tricky for ensuring react-components icons are listed in the composite icon interfaces (but a problem that should definitely be tackled -- just not in this PR)

Why

<Icon iconName={_name_} /> accepts a plain string as an icon name. This means when developing we could enter anything here and we won't know of an issue until runtime (or perhaps far later when a developer tries to customize the icon!).
This ensures we hit build time errors when using icons we have not set up to be customized.

How Tested

eslint rule fails build if Icon or FontIcon is used directly:
image

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 1, 2022

@JamesBurnside JamesBurnside enabled auto-merge (squash) March 1, 2022 00:15
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 1, 2022

@JamesBurnside JamesBurnside merged commit e9622a0 into main Mar 1, 2022
@JamesBurnside JamesBurnside deleted the jaburnsi/typeguard-icon-usage-in-composites branch March 1, 2022 00:23
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