Skip to content

revert '* as tweens' import introduced with v6.2 due to vitest tests…#179

Merged
alampros merged 1 commit intoalampros:developfrom
bonev93:develop
May 19, 2025
Merged

revert '* as tweens' import introduced with v6.2 due to vitest tests…#179
alampros merged 1 commit intoalampros:developfrom
bonev93:develop

Conversation

@bonev93
Copy link

@bonev93 bonev93 commented May 15, 2025

… failing because of the cjs import

I work on a private repository where tests started failing after bumping react-confetti from v6.1 to v6.4.
Turns out the cjs import in Confetti.ts makes vitest fail with an error saying tweenFunction is not a function.
Sorry for not being able to provide codesamples.

@alampros
Copy link
Owner

Thanks for the PR! Sorry you ran into issues.

I'd like to check that this doesn't re-export the whole tweens lib when I get time.

If it does, it might just be easier to yoink that one func out of the lib and include it statically.

@bonev93
Copy link
Author

bonev93 commented May 19, 2025

@alampros my pleasure - it's a cool library.

As for the re-export check you would like to make - I checked again and this is the only place within the source code where tween-functions is referenced so yoinking(not a native speaker here so I learned a new word:D) the function and including it statically is an option as well, however I think rollup is doing a tree-shaking on your behalf when "npm run build" script is executed. (see tree-shaking paragraph here https://www.npmjs.com/package/rollup).

https://bundlephobia.com/package/tween-functions@1.2.0 - gzipped version sits at 885b

let me know if I can help with any changes needed :)

@alampros
Copy link
Owner

Excellent - thanks! Sorry for the delay. I'll try to get this merged today

@alampros alampros merged commit dad1411 into alampros:develop May 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants