Skip to content
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): upgrade object-hash to support async/await syntax #203

Merged
merged 2 commits into from
Feb 11, 2020

Conversation

agilgur5
Copy link
Collaborator

@agilgur5 agilgur5 commented Feb 11, 2020

  • object-hash v2.0.2 adds/fixes support for async functions

    • object-hash v2 has no breaking changes, just drops testing of
      Node < 6
      • Node 5 was EOL April 2018, and on top of that 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

    • might be good to add a warning though? so that those who used this
      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 actual object-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 with clean makes for no caching, both of which are very suboptimal workarounds. Would be great to actually fix the main problem objectHashIgnoreUnknownHack 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

- these are just the changes an `npm install` made
- it hadn't been changed since at least v0.25.2
- object-hash v2.0.2 adds/fixes support for async functions
  - object-hash v2 has no breaking changes, just drops testing of
    Node < 6
    - Node 5 was EOL April 2018, and on top of that 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
  - might be good to add a warning though? so that those who used this
    option for async/await can upgrade and remove it (and have a
    stable cache again)
@agilgur5 agilgur5 changed the title (feat): upgrade object-hash to support async/await syntax (fix): upgrade object-hash to support async/await syntax Feb 11, 2020
@ezolenko
Copy link
Owner

Thanks, I'll check it out

@ezolenko ezolenko self-assigned this Feb 11, 2020
@ezolenko ezolenko merged commit 9afc8df into ezolenko:master Feb 11, 2020
@ezolenko
Copy link
Owner

I also noticed that package.json is set to v0.25.4, but v0.25.4 was never released.

This is to support pointing npm directly to github, committed version is always higher than last released.

@ezolenko
Copy link
Owner

ezolenko commented Feb 12, 2020

In 0.26.0 now

@agilgur5
Copy link
Collaborator Author

Big thanks for the super fast turnaround @ezolenko !! Hopefully this ends a lot of hackiness 😄

@agilgur5 agilgur5 added kind: bug Something isn't working properly scope: dependencies Issues or PRs about updating a dependency labels May 7, 2022
Repository owner locked as resolved and limited conversation to collaborators May 7, 2022
@agilgur5 agilgur5 added scope: integration Related to an integration, not necessarily to core (but could influence core) scope: cache Related to the cache labels May 7, 2022
@agilgur5 agilgur5 deleted the object-hash-update branch July 2, 2023 21:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind: bug Something isn't working properly scope: cache Related to the cache scope: dependencies Issues or PRs about updating a dependency scope: integration Related to an integration, not necessarily to core (but could influence core)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not work with async plugins
2 participants