scroll-timeline
scroll-timeline copied to clipboard
Make the polyfill more modular
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.
import the polyfill through typescript code
Not sure what you mean exactly since Typescript is a transpiler.
See #296 though. Maybe it will help.
@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.
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. :(