microsoft / fluentui-system-icons

Fluent System Icons are a collection of familiar, friendly and modern icons from Microsoft.
https://aka.ms/fluentui-system-icons
MIT License
5.93k stars 517 forks source link

Expose `createFluentIcon` in package.json exports #636

Closed dlannoye closed 1 year ago

dlannoye commented 1 year ago

We are currently upgrading our codebase to Webpack v5 and I found some code in our codebase using deep imports to do import { createFluentIcon } from '@fluentui/react-icons/lib/utils/createFluentIcon'. I understand that doing deep imports like this is not advised and that the new exports property in package.json allows your package to better control the paths you want to treat as public. Currently this utility is both not re-exported through index.js or available via the exports property.

Is this createFluentIcon util something you could consider making publicly exported?

The use case I saw in our code base was similar that what you have internally, creating a new custom icon from paths. This custom icon isn't something in the core set provided by your package today, but it looks like the authors wanted to create it in similar way before using the exported bundleIcon utility.