Jump to content
Search Community

Upgraded from 2.0.2 to 3.7.0

hardya test
Moderator Tag

Recommended Posts

I have this code...

 

(function(name) {
	"use strict";
	var getGlobal = function() {
		return (_gsScope.GreenSockGlobals || _gsScope)[name];
	};
	if (typeof(module) !== "undefined" && module.exports) { //node
		require("./CustomEase");
		require("gsap/TweenLite");
		module.exports = getGlobal();
	} else if (typeof(define) === "function" && define.amd) { //AMD
		define(["gsap/TweenLite", "./CustomEase"], getGlobal);
	}
}("CustomBounce"));

But "gsap/TweenLite" can no longer be found.

 

I guess there will have been significant changes between versions, but I'm looking for a simple resolve at this stage with a more detailed rewrite at a later stage.

Can anyone help me with where this module may now be?

Thanks

Link to comment
Share on other sites

I'm not super great with install stuff and I'm not quite sure from your snippet what setup you're using - but you definitely don't need to be loading TweenLite.

 GSAP3 will support old TweenLite syntax but if you're using the latest files you'll just be looking for GSAP as the core tweening library.

From the installation guide you'll be looking for something like this

UMD/CommonJS (require syntax)

const { gsap } = require("gsap/dist/gsap");

Link to comment
Share on other sites

12 hours ago, hardya said:

So is a significant rewrite required for the code in question?

That entire code block that you included in your original post was written by me and it was inside CustomBounce. There's absolutely no need for that whatsoever in v3. It almost sounds like you're trying to use an old v2 plugin with the v3 core which isn't going to work. Just use the latest files (including CustomBounce) and you'll be fine. You probably don't even need to rewrite any of your own code since it's largely backwards compatible, but of course I'd strongly recommend updating to the more modern syntax because it's more concise, clear and powerful. See

 

 

Have fun!

  • Like 1
Link to comment
Share on other sites

Jack,

 

Thank you so much for your response, I really appreciate it.

It's old code, only just come to it, I am also new to gsap
under a gsap folder we have these files with code in written by you I think
CustomBounce
CustomEase
CustomWiggle
DrawSVGPlugin
MorphSVGPlugin
Physics2DPlugin
PhysicsPropsPlugin
ScrambleTextPlugin
SplitText
ThrowPropsPlugin
GSDevTools

 

then an index with this

import "gsap";
// import "./CustomBounce";
// import "./CustomEase";
// import "./CustomWiggle";
// import "./DrawSVGPlugin";
// import "./MorphSVGPlugin";
// import "./Physics2DPlugin";
// import "./PhysicsPropsPlugin";
// import "./ScrambleTextPlugin";
// import "./SplitText";
// import "./ThrowPropsPlugin";

export * from "gsap";

I guess GSDevTools was always present but never used

 

commenting out the features which I understand are now in gsap
leads to successful compile and UI presentation. Just early quick fix.

 

I think the animation code only uses
TweenMax
SteppedEase

 

It will take me time to setup the right related data in order to properly fully the animation
but since it all compiles I am hoping our existing use of
TweenMax
SteppedEase
won't present anything unexpected.

 

What do you think?

 

Thank you again, really appreciate it.


 

Link to comment
Share on other sites

3 hours ago, hardya said:

I am hoping our existing use of
TweenMax
SteppedEase
won't present anything unexpected.

 

What do you think?

It's difficult to know for sure without analyzing all your code, but the majority of TweenMax code is indeed backward compatible. Of course I'd strongly recommend updating to the newer syntax which is more concise. 

 

3 hours ago, hardya said:

then an index with this

import "gsap";
// import "./CustomBounce";
// import "./CustomEase";
// import "./CustomWiggle";
// import "./DrawSVGPlugin";
// import "./MorphSVGPlugin";
// import "./Physics2DPlugin";
// import "./PhysicsPropsPlugin";
// import "./ScrambleTextPlugin";
// import "./SplitText";
// import "./ThrowPropsPlugin";

export * from "gsap";

That's because you don't have a Club GreenSock membership - CustomBounce is a membership benefit that's only available to Club GreenSock members. After you sign up, you'd get a .zip that contains those files as well as an index.js file that doesn't have those commented-out. You shouldn't be using  CustomBounce if you don't have the proper membership. But it sounds like maybe you only need the core anyway (no bonus plugins) in which case you're fine. 

 

Enjoy!

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