(fix): upgrade object-hash to support async/await syntax #203
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.
object-hash v2.0.2 adds/fixes support for async functions
Node < 6
was EOL April 2019, and Node 8 was EOL December 2019, so this is
still more tested support than is necessary
objectHashIgnoreUnknownHack isn't useful for its original purpose to
workaround this, but is still useful for other types of
objects/syntaxes that object-hash may not handle yet
(e.g. async generator functions), so leave the hack in
option for async/await can upgrade and remove it (and have a
stable cache again)
Note: I added an initial commit in here that auto-updates the
package-lock.json
as it hadn't been updated since at least v0.25.2, and I didn't want that to be part of the diff for the actualobject-hash
upgrade (which is a very tiny diff).I also noticed that
package.json
is set to v0.25.4, but v0.25.4 was never released.Fixes #105 with no need for a hack.
This was just fixed in puleos/object-hash#90 , which is a very similar fix to the one originally referenced in #105 (puleos/object-hash#68).
Like I mentioned in puleos/object-hash#90 , we're currently facing this problem in TSDX in several issues: jaredpalmer/tsdx#294 , jaredpalmer/tsdx#358 (comment) , jaredpalmer/tsdx#278 (comment) , jaredpalmer/tsdx#496 (comment), and a few in jaredpalmer/tsdx#379 , so it's one of the top issues.
The current
objectHashIgnoreUnknownHack
either makes the cache stale or withclean
makes for no caching, both of which are very suboptimal workarounds. Would be great to actually fix the main problemobjectHashIgnoreUnknownHack
addresses (it may still be used for future syntax, other object types, etc) instead of having hacky workarounds for the most common case of async functions!The bundling of dependencies (#80, #70) also means there's no way for TSDX to internally change
rollup-plugin-typescript2
's dependencies. This means we don't really have a way of fixing this without waiting for for a new release from this library, which is also suboptimal IMO.This issue was also one of the main reasons behind TSDX temporarily switching to
@wessberg/rollup-plugin-ts
in jaredpalmer/tsdx#200