[Snyk] Upgrade gsap from 3.7.1 to 3.8.0 #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to upgrade gsap from 3.7.1 to 3.8.0.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
Release notes
Package name: gsap
NEW: ScrollTrigger recognizes a new "containerAnimation" configuration property for when the trigger element is being "scrolled" into view by a linear Tween of its container, like when vertical scrolling causes elements to move horizontally into view. You could think of it like a nested ScrollTrigger.
NEW: ScrollTrigger recognizes a new "preventOverlaps" configuration property that forces all trailing ScrollTrigger animations to their end state when the ScrollTrigger is about to affect its own animation (like in a toggleAction)
NEW: ScrollTrigger recognizes a new "fastScrollEnd" configuration property that will automatically force the associated animation to completion if the scroll velocity exceeds 2500px/second (or whatever you define) when it LEAVES the active area (so onLeave or onLeaveBack). This helps avoid overlapping animations when the user scrolls quickly.
NEW: ScrollTrigger.isInViewport() method that lets you determine if a particular element is in the viewport. You can even define a certain proportion, like if at least 20% of it is in the viewport like ScrollTrigger.isInViewport(element, 0.2);
NEW: ScrollTrigger.positionInViewport() method that lets you get a normalized value representing an element's position in the viewport. For example, if the center of myElement is 80% down from the top of the viewport, ScrollTrigger.positionInViewport(myElement, "center") would return 0.8.
NEW: ScrollTrigger instances have new .previous() and .next() methods that return the ScrollTrigger that's immediately before or after (in the refresh order) which makes it simple to build function-based start/end values that are dependent on the previous one, like start: self => self.previous() ? self.previous().end : "top top"
NEW: ScrollTrigger snapping is now directional by default (except snap: "labels" because there's already a snap: "labelsDirectional" option) because that is what's most intuitive in the vast majority of situations. To prevent the directional part, you can set directional: false in the snap object, like snap: {snapTo: 1 / 5, directional: false}
NEW: ScrollTrigger.snapDirectional() is a utility method that you can give a snapping increment OR an Array of numbers and it will return a function that you can use to do directional snapping. For example, let snap = ScrollTrigger.snapDirectional(5) returns a function that'll snap in increments of 5 in the direction provided where 1 is positive and -1 is negative, so snap(11, 1) would return 15 whereas snap(11, -1) would return 10.
NEW: if you return a GSAP animation (Tween/Timeline) from an onEnter/onLeave/onEnterBack/onLeaveBack/onToggle callback, it will be set as the callbackAnimation property, effectively maintaining a reference to the most recent one which will cause it to be affected by preventOverlaps and fastScrollEnd behaviors.
NEW: ScrollTrigger.clearScrollMemory() erases any recorded scroll positions (this is almost never needed, but just in case...)
NEW: ScrollTrigger recognizes a new "pinSpacer" property that allows you to specify an element that should be used as the spacer instead of the default behavior where ScrollTrigger creates a DIV element internally. The main reason this is useful is if you're loading an iframe into the pinned element because on resize, the browser would refresh that content due to the fact that ScrollTrigger must remove/add the spacer element as a part of its ScrollTrigger.refresh() calculations.
NEW: TextPlugin lets you set preserveSpaces: true in order to maintain extra spaces, swapping in to make them show up in HTML. See https://greensock.com/forums/topic/29060-textplugin-and-format-preservation/
IMPROVED: in some browsers, a pinType of "transform" could appear to jump/vibrate while scrolling. It's impossible to completely eliminate all of that due to the fact that most modern browsers handle scrolling on a separate thread, thus repainting isn't synchronized but 3.8.0 forces updates more frequently while scrolling to minimize that jitter. See https://greensock.com/forums/topic/29205-scrolltrigger-wobbly-pinning/
IMPROVED: if you misspell selector text in a ScrollTrigger (like trigger: "#oopps"), you'll see a console.warn() message for easier troubleshooting. See #472
IMPROVED: TypeScript definition files cover gsap-trial package and "snap" property. See https://greensock.com/forums/topic/28966-how-to-snap-in-gsapto/
IMPROVED: if a ScrollTrigger's start value is numeric, it will be treated as absolute and won't be pushed further down when you pin the same element multiple times. See https://greensock.com/forums/topic/28845-scrolltrigger-long-scroller-with-multiple-animation-triggers/
IMPROVED: if you animate a CSS value to a value with a % unit and then reverse all the way back to the beginning, it won't revert to the equivalent px value (which is what the browser reported as the computed value). So % is maintained.
IMPROVED: if ScrollTrigger.refresh() is called in an environment where the document/window/body doesn't exist yet, it won't throw an error. See #415
IMPROVED: PixiPlugin warns if you haven't registered the PIXI object.
FIXED: if you refresh() a ScrollTrigger inside of a callback after the page has already been scrolled, it may remember that scroll position longer than it should in some rare scenarios.
FIXED: if you use a "random(...)" value in the "from" part of a .fromTo() animation on a CSS-related value, it wasn't applied properly. See https://greensock.com/forums/topic/28817-random-not-working-in-fromto/
FIXED: if the you use for a motionPath contains data that has no commas or spaces between values like 126.87-32.48-310.91-58-499 instead of 126.87,-32.48,-310.91,-58,-499, it may not be aligned correctly. See https://greensock.com/forums/topic/28827-what-am-i-doing-wrong-motionpathplugin/ and https://greensock.com/forums/topic/29031-my-motion-path-needs-offsets-but-why/
FIXED: if you create a getProperty() getter function and then try passing in a unit, it would always return a number instead of including that unit.
FIXED: if you set overwrite: "auto" and then before the tween's first render, you alter the progress (like tween.progress(1)), it may not properly overwite conflicting tweens in certain circumstances.
FIXED: when you .kill() a ScrollTrigger that has a numeric scrub value (or the associated animation), it didn't kill() the scrub tween, thus it wasn't made available for garbage collection. See https://greensock.com/forums/topic/29002-memory-leak-in-scrolltrigger-scrub/?
FIXED: in very rare circumstances, an addPause() callback may fire more than once.
FIXED: worked around Firefox bug that could throw an error if matrix values are needed from an SVG that has no width or height
FIXED: regression in MotionPathPlugin 3.7.1 could cause the final value in a MotionPath animation to be incorrect. See https://greensock.com/forums/topic/29097-motion-path-on-complete-sets-position-to-x0-and-y-0/
FIXED: GSDevTools didn't recognize if you set the time() of the selected animation to a non-zero value. See https://greensock.com/forums/topic/29113-force-gsdevtools-to-start-at-a-given-timeline-time/
FIXED: if you .kill() a GSDevTools instance and then attempt to create a new one, the keyboard events may not be listened to correctly. See https://greensock.com/forums/topic/29129-killed-gsdevtools-forgets-to-clean-its-event-listeners/
FIXED: regression in 3.7.0 caused keyframe animations not to inherit a default duration (or other defaults). See https://greensock.com/forums/topic/29180-keyframes-does-not-work-in-version-371/
FIXED: if you use gsap.utils.snap() with a number greater than 1 but also has a decimal, it would always eliminate the decimal.
FIXED: if you have an inline border-top-* style on the , ScrollTrigger may eliminate it upon instantiation. It would only happen if it's more specific than "border-top", like "border-top-width for example.
FIXED: Flip plugin may not properly factor in the page's scroll into the positioning properly under certain circumstances when the element is position: fixed. See https://greensock.com/forums/topic/29343-scrolltrigger-flip-to-fixed-position/ and https://greensock.com/forums/topic/29368-flip-plugin-error-state-position/
FIXED: regression in 3.7.1 could cause MotionPathPlugin not to properly align a root element on a path if it has a viewBox attribute with non-zero x/y values.
FIXED: if you set a liveSnap on a Draggable AND bounds, the bounds may not be respected (only the liveSnap).
FIXED: if you place a callback on a timeline with a ScrollTrigger that is set to scrub: true and then scroll down on a page past where that callback is and then refresh the browser, the callback may not be triggered. See https://greensock.com/forums/topic/29456-scrolltrigger-seemingly-inconsistently-updates-timeline-calls/
FIXED: in Draggable, if you use an Array for snap on multiple values like snap: { x: [0], y: [0] }, it would skip all but the first one (in terms of snapping). See https://greensock.com/forums/topic/29466-draggable-snap-only-affecting-x-value/
FIXED: in Draggable, if you tap (click) on certain mobile devices and the browser refreshed at a slow enough speed, it was possible that the onClick would fire twice. See https://greensock.com/forums/topic/29530-pointerup-fired-for-draggables-onclick-in-mobile-view
FIXED: if you change the timeScale() of an animation AFTER adding it to a timeline that has smoothChildTiming: false, it may not render at the correct time when the parent is played in reverse
IMPROVED: made the "wheel" event listener passive in ScrollTrigger. See #460
IMPROVED: made it possible to use CustomEase without loading GSAP.
IMPROVED: function-based inertia "end" values now receive the velocity as the 2nd parameter which makes it much easier to do directional snapping
IMPROVED: if you alter the repeatDelay() after the animation has already started, it maintains the playhead's local position as long as the parent timeline has smoothChildTiming enabled.
FIXED: if you call .update() with the "sticky" parameter true while dragging after the element has been changed in the document flow (repositioned), it may render at the incorrect position.
FIXED: if you kill() a ScrollTrigger instance, the previous scroll position may still be remembered. So, for example, in a SPA that goes to a new page and kills all the ScrollTriggers, it may still keep the scroll position instead of going back to the top/left. See https://greensock.com/forums/topic/28592-scrolltrigger-and-nextjs-scroll-position-after-route-change/ and https://greensock.com/forums/topic/28575-scrolltrigger-issue-with-scroll-position-when-i-navigate-to-a-page/
FIXED: if ScrollTrigger.update() was called during a ScrollTrigger.refresh(), it could cause pinned elements not to be positioned correctly. See https://greensock.com/forums/topic/28547-having-an-issue-with-scrolltrigger-locomotive-scroll/
FIXED: worked around a Firefox bug that could throw an error if you tried to Flip a root element. Firefox reports getCTM() as null on elements.
FIXED: improved Flip plugin's ability to correctly size root elements
FIXED: regression in 3.7.0 caused a tween's onStart callback to be called twice. See https://greensock.com/forums/topic/28644-370-onstart-in-fromto-fires-twice/
FIXED: if you define a "snap" value for ScrollTrigger as an Array in the shorthand syntax, like snap: [0, 0.1, 0.7, 1] instead of snap: {snapTo: [0, 0.1, 0.7, 1]}, it didn't work properly.
FIXED: if you resume a tween whose playhead is at the VERY end, it could render one last time unnecessarily, calling the onComplete when it really shouldn't because the playhead didn't move.
FIXED: regression in GSDevTools.create() caused it not to display all animations with "id" properties in the drop-down list. See https://greensock.com/forums/topic/28706-gsdevtools-animation-ids-not-working/
FIXED: an edge case could cause MotionPathPlugin could use a large amount of memory. See https://greensock.com/forums/topic/28744-multiple-gsap-motion-path-traces-on-the-same-timeline-simultaneously/
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:
🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs