Jump to content
Search Community

Best way to use GSAP with Webpack

hendrikeng test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I don't think jquery.gsap is actually a supported product, that's why you don't see any mention of it in the docs. @Carl might be able to clarify that.

 

If you really need it, I would just change stale to false.

stale = false;

 

And const is still in the output because a newer version hasn't been released yet.

 

3 hours ago, einomi said:

Now we have to include node_modules/gsap folder in babel config, so it could be transpiled into ES5 code, but it's not correct.

 

What's not correct?

 

  • Like 1
Link to comment
Share on other sites

34 minutes ago, OSUblake said:

 

What's not correct?

 

I mean that we have to include external library in transpiling process which is considered as a bad practise ?

 

35 minutes ago, OSUblake said:

And const is still in the output because a newer version hasn't been released yet.

OK, great!

Link to comment
Share on other sites

19 hours ago, einomi said:

I mean that we have to include external library in transpiling process which is considered as a bad practise ?

 

I wouldn't say it's a bad practice. I think it's better for the developer to decide what language features should be transpiled. There's really no need to build a single, one size fits all solution anymore as ES6 can run in most browsers now.

 

I use prpl-server to do differential serving, which serves a bundle that is optimized for a browser's capabilities. That works really well with HTTP/2 as you can basically create a bundle on the fly.

https://github.com/Polymer/prpl-server-node#as-a-library

  • Like 3
Link to comment
Share on other sites

Hi einomi,

 

regarding jquery.gsap we still make it available for legacy users but we don't actively promote its use anywhere. It was originally created many years ago when people still considered jQuery.animate() a practical animation solution. The only purpose of jquery.gsap was to make it easy to show people that GSAP could hijack existing jQuery animations and perform equally as well if not better (in most cases).

 

In other words it was more of a tool to help convince people that it was safe to move away from jQuery for animations, not something that you should use in every project so that you could avoid doing things properly with GSAP. 

 

Our recommendation these days is that if you want the power of GSAP you should actually be writing your animations using TweenLite, TweenMax, etc.

 

Some users mistakenly believe that since they are using jQuery for anything on their site and GSAP that jquery.gsap must be loaded. This isn't true. GSAP has no dependencies on jQuery and you can use the 2 together without loading jquery.gsap. jquery.gsap is only for the fairly un-common case that you want jQuery.animate() to use GSAP under the hood.

 

Hopefully this helps clear some things up.

 

 

 

 

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 4 weeks later...

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...