ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
50.66k stars 13.52k forks source link

feat: extract reusable utils as own package #24344

Closed Samuel-Schober-USU closed 2 years ago

Samuel-Schober-USU commented 2 years ago

Prerequisites

Describe the Feature Request

I would love to have some core utils as own package without the Ionic components.

Describe the Use Case

We are currently using StencilJS to build our own web components. Since Ionic has built up a lot of best practices and utils, we try to adapt them for our project.

It would be great to have a own package just for the Ionic utils (e.g. animation builder, framework delegate or the overlay controller) which could be used by our project.

Describe Preferred Solution

Extract the reusable utils from @ionic/core into a package @ionic/utils.

This could be

@ionic/core could then have @ionic/utils as a dependency

Describe Alternatives

Currently we copied a lot of the utils code but we have to keep it up to date if something changes. It is also a problem, that nobody dares to touch this code, because nobodey understands it completelly.

We also tried to import @ionic/core but then we have also the overhead with having the components in the package in the node_modules, which caused e.g. our Stencil outputtargets to somehow also generate files for all Ionic components (not sure if this is a bug or desired behaviour of Stencil).

Related Code

No response

Additional Information

No response

liamdebeasi commented 2 years ago

Thanks for the issue. Can you try importing from @ionic/core/components instead? That import should work better with treeshaking.

ionitron-bot[bot] commented 2 years ago

Thanks for the issue! This issue is being closed due to the lack of a reply. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Thank you for using Ionic!