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

Bundle icon files #611

Open
epessina opened this issue Sep 17, 2024 · 0 comments
Open

Bundle icon files #611

epessina opened this issue Sep 17, 2024 · 0 comments
Labels
enhancement New feature or request Icon component Icon component and hooks related activities

Comments

@epessina
Copy link
Contributor

The icon files shipped with the package following #477 have the same structure as the react-icons ones, meaning that each icon is represented through a js file that internally imports (or requires) the function GenIcon exposed by a lib directory (which is also shipped with the icons).

For example:

var GenIcon = require('../lib').GenIcon
module.exports.AiFillAccountBook = function AiFillAccountBook (props) {
  return GenIcon({ /* icons svg tree */ })(props);
};

We should consider making icon files auto-conclusive bundling the GenIcon function or directly shipping the result of GenIcon parametrized with the props. This would help with dynamic import since the fetched js code should not need to perform import when executed.

@epessina epessina added enhancement New feature or request Icon component Icon component and hooks related activities labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Icon component Icon component and hooks related activities
Projects
None yet
Development

No branches or pull requests

1 participant