sukjae Posted November 21, 2022 Share Posted November 21, 2022 Hello. Should I stick to one version while using gsap? Suppose service-a depends on lib-a and lib-b, and lib-a and lib-b depend on gsap. From the point of view of service-a, several versions of gsap can be installed. Are there any problems that may occur here? Or is one instance used even if multiple versions are installed? Does each initialization (settinggsap.registerPlugin, setting gsap.defaults, etc.) through different versions merged into one place? Thank you Link to comment Share on other sites More sharing options...
Solution GreenSock Posted November 21, 2022 Solution Share Posted November 21, 2022 I would definitely recommend sticking with one version. The way it's handled really depends on your environment, your bundler, etc. Like if you do ES Module imports and you use one package and compile, obviously that code would use that version, but then if you subload something else that uses a totally different version and it was compiled that way, there's a good chance it'd use that different version. Again, it depends on how things are bundled/loaded. If you use a standard <script> tag, it'd probably just use the one loaded last. But plugins will register with whichever one you're referencing at that point. So if you register when version A is loaded, and then you load a new GSAP version that replaces the old one, that plugin registration would likely get wiped away because it wasn't registered with the new one. You can avoid complications by just using a consistent version But as with everything, the best way to verify is to just test in your environment. 👍 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now