ezolenko / rollup-plugin-typescript2

Rollup plugin for typescript with compiler errors.
MIT License
822 stars 71 forks source link

refactor(cache): `makeName` -> `createHash` for clarity #355

Closed agilgur5 closed 2 years ago

agilgur5 commented 2 years ago

Summary

Rename makeName -> createHash and name -> hash in tscache.ts code for clarity

Details

Misc Notes

Been digging into cache bugs more now that I've fixed a ton of the non-cache ones, so doing a bit of refactoring here as I'm going through it more frequently and in more depth.

ezolenko commented 2 years ago

Really it's more like a key, with additional requirement of being filesystem safe, but this works too

agilgur5 commented 2 years ago

Really it's more like a key

Hashes are keys, so I think that terminology works 👍

with additional requirement of being filesystem safe

Ah, that's a good point that I didn't think about, but I guess a sha1 hash is FS-safe, so it works so long as the implementation isn't changed. Might be good to add a typedoc @returns comment mentioning that for future readers or anyone who may think of changing the hash algorithm (I don't have any plans to do that, but I can imagine someone looking at sha1, saying "let's update that", and not be aware that FS-safe is a required property)