Skip to content

Commit

Permalink
eclipse-theiaGH-3204: Adjusted the contribution provider to `inversif…
Browse files Browse the repository at this point in the history
…y` `4.14.0+`.

 - The `guid` property has been removed in version `4.14.0`.
 - This patch makes sure both older and newer versions work.
 - POC: I have bumped up inversify to `4.14.0` and saved to `yarn.lock`.

Closes: eclipse-theia#3204.

Signed-off-by: Akos Kitta <[email protected]>
  • Loading branch information
Akos Kitta authored and kittaakos committed Oct 23, 2018
1 parent c2939ab commit 3c31f27
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"file-icons-js": "^1.0.3",
"font-awesome": "^4.7.0",
"fuzzy": "^0.1.3",
"inversify": "^4.2.0",
"inversify": "^4.14.0",
"lodash.debounce": "^4.0.8",
"lodash.throttle": "^4.1.1",
"perfect-scrollbar": "^1.3.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/common/contribution-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ class ContainerBasedContributionProvider<T extends object> implements Contributi
export type Bindable = interfaces.Bind | interfaces.Container;
export namespace Bindable {
export function isContainer(arg: Bindable): arg is interfaces.Container {
return 'guid' in arg;
return typeof arg !== 'function'
// https://github.com/theia-ide/theia/issues/3204#issue-371029654
// In InversifyJS `4.14.0` containers no longer have a property `guid`.
&& ('guid' in arg || 'parent' in arg);
}
}

Expand Down
7 changes: 4 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4977,9 +4977,10 @@ invariant@^2.2.2:
dependencies:
loose-envify "^1.0.0"

inversify@^4.2.0:
version "4.13.0"
resolved "https://registry.yarnpkg.com/inversify/-/inversify-4.13.0.tgz#0ab40570bfa4474b04d5b919bbab3a4f682a72f5"
inversify@^4.14.0:
version "4.14.0"
resolved "https://registry.yarnpkg.com/inversify/-/inversify-4.14.0.tgz#393c1f86ee92aef0592eb0e493623b9d88dfb376"
integrity sha512-DQLg2u2tWaiHo6V5lGr47a/M9YBX3g72c8Y58+JPH0Lx9fXugEsnXRc08mwsTvDg6gGWBKSkIgtBS/eJCQmDVg==

invert-kv@^1.0.0:
version "1.0.0"
Expand Down

0 comments on commit 3c31f27

Please sign in to comment.