(fix): upgrade rpts2 / object-hash to support async rollup plugins #506
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
rpts2 v0.26.0 upgrades object-hash to v2.0.2
overridden manually and that's also why the object-hash change isn't
visible in the yarn.lock file
previously, TSDX users who wanted to use rollup plugins (via
tsdx.config.js) that use async/await internally (e.g.
rollup-plugin-copy, rollup-plugin-url, rollup-plugin-visualizer,
rollup-plugin-smart-asset, etc, etc, etc), would run into
'Unknown object type "asyncfunction"' from object-hash as rpts2
hashes the rollup config itself for caching
tsdx.config.js (which requires brittle copy+paste as its config
isn't exposed) and then use a config option of rpts2,
objectHashIgnoreUnknownHack (which is hacky, per the name)
would disable the cache entirely, both of which are suboptimal
experiences
needed to use plugins that make use of async/await
NOTE: this does not affect source code that uses async/await, that
was already supported, this just affects plugins (in tsdx.config.js)
that use async/await
Phew, finally got here after puleos/object-hash#90 and ezolenko/rollup-plugin-typescript2#203 got merged and released.
Fixes #294 (the underlying root cause to be specific) and should simplify a lot in #379 and #278 , as well as unblock #358 and #496 .
With regard to rpts2 bundling some of its own dependencies, see ezolenko/rollup-plugin-typescript2#80, ezolenko/rollup-plugin-typescript2#70 .