Fix module compatibility, SVG className crash, deprecated API and also add TypeScript types - #387
Open
Tejakshaya wants to merge 1 commit into
Open
Conversation
…pertyCSSValue, and add TypeScript
|
Hello,我是林昕,我已收到来信~
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
getComputedStylepolyfill crashing in module contexts (React, Vue, ES modules) wherethisisundefinedgetPropertyCSSValue()withgetPropertyValue()(removed from Chrome since v41)show()andresetAnimation()crashing on SVG elements by replacingclassNamemanipulation withclassListAPIdist/wow.d.ts) andtypesfield inpackage.jsonChanges:
getComputedStyle polyfill ( fixes issues #352 and #372 ) -> the polyfill set
this.getPropertyValue = ...and returnedthis, but in strict mode / module scope,thisisundefinedwhich causesCannot set properties of undefined (setting 'getPropertyValue'). Now creates and returns a plain object insteadDeprecated getPropertyCSSValue ( fixes #358 ) ->
vendorCSS()usedgetPropertyCSSValue()which was removed from Chrome in v41 (2015) and was replaced withgetPropertyValue()and also simplifiedanimationName()by removing the completley unnecessary try/catch and.cssTextaccessSVG className (fixes #349) ->
show()andresetAnimation()usedelement.classNamedirectly which returns anSVGAnimatedStringon SVG elements and replaced withclassList.add()/classList.remove()which work on both HTML and SVG elements, also supersedes #354 ( stale since 2021, only fixedresetAnimation)TypeScript types (fixes #351) -> added
dist/wow.d.tswith type definitions for theWOWclass andWOWOptionsinterface and now supports both default and named exportsCloses #349
Closes #351
Closes #352
Closes #358
Closes #372
Prexisting issue: The 'requestAnimationFrame' in window check on line 337 crashes when window is undefined but that's in the original code and out of scope