hardya Posted June 24, 2021 Share Posted June 24, 2021 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 More sharing options...
Visual-Q Posted June 24, 2021 Share Posted June 24, 2021 Hey Hardya, Check out the new install page https://greensock.com/docs/v3/Installation#CDN I believe tweenLite/max and the others are combined into a single core build which is just gsap now. 1 Link to comment Share on other sites More sharing options...
hardya Posted June 24, 2021 Author Share Posted June 24, 2021 So is a significant rewrite required for the code in question? Link to comment Share on other sites More sharing options...
Cassie Posted June 24, 2021 Share Posted June 24, 2021 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 thisUMD/CommonJS (require syntax)const { gsap } = require("gsap/dist/gsap"); Link to comment Share on other sites More sharing options...
Cassie Posted June 24, 2021 Share Posted June 24, 2021 There's an installation guide here, maybe you can find what you're looking for there if my directions didn't help! - https://greensock.com/docs/v3/Installation?checked=core,requireSyntax#requireSyntax Link to comment Share on other sites More sharing options...
GreenSock Posted June 25, 2021 Share Posted June 25, 2021 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! 1 Link to comment Share on other sites More sharing options...
hardya Posted June 25, 2021 Author Share Posted June 25, 2021 Thank you all so much I'll take a look Link to comment Share on other sites More sharing options...
hardya Posted June 25, 2021 Author Share Posted June 25, 2021 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 CustomWiggleDrawSVGPlugin 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 More sharing options...
GreenSock Posted June 25, 2021 Share Posted June 25, 2021 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 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