-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(*): cache tracedSVG calculations when cache is present #12044
Conversation
bd811ad
to
7c970ec
Compare
sweet, mind adding some tests to make sure your cachekeys are working |
hey, thanks for the feedback! I am not sure i follow here. |
oh sorry, more or less I mean if we call base64 twice it is only ran once. An even better way is to mock sharp and see it only been called once but that might be not so trivial. it(`caches base64 result`, async () => {
const result = await base64({
file,
args,
})
const result2 = await base64({
file,
args,
})
expect(result).toMatchSnapshot()
// it needs to be a === equal check
expect(result).toBe(result2)
}) |
Heya, doing so would produce the same result but without actually testing cache keys. I won't be able to pass a cache object in the arguments since there is no way to import the cache as a standalone (i think). |
Would be cool to have this in! Any follow-up questions/additions from your side @wardpeet ? |
@wardpeet kind reminder :) |
@oorestisime oh my bad. It looks great, can you fix conflicts and we'll merge! 👍 |
7c970ec
to
770ad57
Compare
Rebased :) please have a close look i hope i did a correct merge, there were a lot of changes |
Patched a few things. I'll be testing this one and getting this in. Thanks for your patience and rebasing it! |
Yeah sorry i did this quickly because i ll be with no pc for a week so i didn't want to get it stalled! thanks for taking over ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge @oorestisime thanks for your work and patience!
Danger run resulted in 1 fail; to find out more, see the checks page. Generated by 🚫 dangerJS |
Fix: #11997
Similar to #9059 but for tracedSVG.