Skip to content

Commit

Permalink
(fix): upgrade rpts2 / object-hash to support async rollup plugins (#506
Browse files Browse the repository at this point in the history
)

- object-hash v2.0.2 adds/fixes support for async functions
- rpts2 v0.26.0 upgrades object-hash to v2.0.2
  - rpts2 currently bundles several of its dependencies, so they can't be
    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
  - the only fix was to hackily override the rpts2 config in
    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)
    - this could cause stale cache issues, or, if used with clean,
      would disable the cache entirely, both of which are suboptimal
      experiences
  - now this really common issue is solved and there's no hacking
    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
  • Loading branch information
agilgur5 authored Feb 26, 2020
1 parent 68f26c9 commit b17a0be
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^5.1.2",
"rollup-plugin-typescript2": "^0.25.3",
"rollup-plugin-typescript2": "^0.26.0",
"sade": "^1.4.2",
"shelljs": "^0.8.3",
"tiny-glob": "^0.2.6",
Expand Down
39 changes: 16 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2925,10 +2925,10 @@ fill-range@^4.0.0:
repeat-string "^1.6.1"
to-regex-range "^2.1.0"

find-cache-dir@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.1.0.tgz#9935894999debef4cf9f677fdf646d002c4cdecb"
integrity sha512-zw+EFiNBNPgI2NTrKkDd1xd7q0cs6wr/iWnr/oUkI0yF9K9GqQ+riIt4aiyFaaqpaWbxPrJXHI+QvmNUQbX+0Q==
find-cache-dir@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.2.0.tgz#e7fe44c1abc1299f516146e563108fd1006c1874"
integrity sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg==
dependencies:
commondir "^1.0.1"
make-dir "^3.0.0"
Expand Down Expand Up @@ -5613,10 +5613,10 @@ [email protected]:
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=

resolve@1.12.0:
version "1.12.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6"
integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==
resolve@1.15.1:
version "1.15.1"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8"
integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==
dependencies:
path-parse "^1.0.6"

Expand Down Expand Up @@ -5703,25 +5703,18 @@ rollup-plugin-terser@^5.1.2:
serialize-javascript "^1.7.0"
terser "^4.1.0"

rollup-plugin-typescript2@^0.25.3:
version "0.25.3"
resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.25.3.tgz#a5fb2f0f85488789334ce540abe6c7011cbdf40f"
integrity sha512-ADkSaidKBovJmf5VBnZBZe+WzaZwofuvYdzGAKTN/J4hN7QJCFYAq7IrH9caxlru6T5qhX41PNFS1S4HqhsGQg==
rollup-plugin-typescript2@^0.26.0:
version "0.26.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.26.0.tgz#cee2b44d51d9623686656d76dc30a73c4de91672"
integrity sha512-lUK7XZVG77tu8dmv1L/0LZFlavED/5Yo6e4iMMl6fdox/yKdj4IFRRPPJEXNdmEaT1nDQQeCi7b5IwKHffMNeg==
dependencies:
find-cache-dir "^3.0.0"
find-cache-dir "^3.2.0"
fs-extra "8.1.0"
resolve "1.12.0"
rollup-pluginutils "2.8.1"
resolve "1.15.1"
rollup-pluginutils "2.8.2"
tslib "1.10.0"

[email protected]:
version "2.8.1"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz#8fa6dd0697344938ef26c2c09d2488ce9e33ce97"
integrity sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg==
dependencies:
estree-walker "^0.6.1"

rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.5.0, rollup-pluginutils@^2.6.0, rollup-pluginutils@^2.8.1:
[email protected], rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.5.0, rollup-pluginutils@^2.6.0, rollup-pluginutils@^2.8.1:
version "2.8.2"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e"
integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==
Expand Down

0 comments on commit b17a0be

Please sign in to comment.