Jump to content
Search Community

Should only one version of gsap be installed?

sukjae test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

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

  • Solution

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...