Conversation
85c0863 to
fa869d3
Compare
cb6bacd to
d30e722
Compare
0966299 to
f10ed13
Compare
src/cache.ts
Outdated
| // No hash for string parts for better readability. | ||
| const part = typeof f === 'string' ? f : hash(f) |
There was a problem hiding this comment.
For example, if we also hash values like the font provider’s name, it becomes difficult to identify files when checking what Storage has saved. So I think we shouldn’t hash string fields.
e1d8f29 to
9f764a1
Compare
|
@danielroe |
|
Since the commit history became too cluttered and conflicted with other PRs, I used a force push. |
danielroe
left a comment
There was a problem hiding this comment.
apologies for going back and forth on this.
we should definitely cache by key (font provider) + version of unifont.
my one reservation is that caching uniquely by options too, may be over-unique. for example, google fonts will have the same list of fonts, regardless of what options are passed to it. so I'd like to refactor later on to allow providers a little more control over what is dependent on the options and what isn't...
however, I think this is looking really good, and I don't want to hold it up, so I think we can merge and iterate (if you're happy to address the merge conflict 🙏
thank you for your work on this
|
Thanks! |
9f764a1 to
1113b6f
Compare
|
Conflict resolved in https://github.com/unjs/unifont/compare/9f764a10cd601db0add398a6f730db8cbb7cd5f0..1113b6febd3f96d2b4b5d3c69ad180e8f22f642d This diff is safe because it doesn’t affect any cache-related test cases and CI passes without differences. |
d8b20f2 to
adf9920
Compare
fixes #184
This PR updates the cache storage generation to automatically include the provider name and options in the cache key.
Users don’t need to do anything special when defining a provider.
Additional Context
Purpose 1 of #239 (comment).