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

Make the polyfill more modular #273

Open
MurhafSousli opened this issue Jun 30, 2024 · 3 comments
Open

Make the polyfill more modular #273

MurhafSousli opened this issue Jun 30, 2024 · 3 comments

Comments

@MurhafSousli
Copy link

I have a custom scrollbar library that relies on this polyfill https://ngx-scrollbar.netlify.app/. I get many issues related to the polyfill like font imports break in their app when the script is loaded and some get error loading the script especially in stackblitz environment.

Is it possible to breakdown the script into a modular features. for instance, you have view-timeline and scroll-timeline, and you have CSS animation usage and JS usage to make the scroll-timeline work.

I would like to only use the scroll-timeline the JS usage. also ability to import the polyfill through typescript code instead of loading the script the traditional <script> way.

@ADTC
Copy link

ADTC commented Mar 14, 2025

import the polyfill through typescript code

Not sure what you mean exactly since Typescript is a transpiler.

See #296 though. Maybe it will help.

@MurhafSousli
Copy link
Author

@ADTC No, here I meant to be able to import and use the library like

const lib = await import('link-to-polyfill')

Modern JS scripts has entry point and can be loaded via import() function.

But the way this polyfill is designed, it's only possible to load it via classic script and it automatically activates itself, it doesn't have a module entry point and I cannot exclude the function that I am not interested in such as the view-timeline.

@ADTC
Copy link

ADTC commented Mar 14, 2025

Ah okay. Dynamic imports and modules. I was also looking for something similar when adding it as NPM package.

Unfortunately this project seems very rough-cut in such regards. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants