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

UNMET PEER DEPENDENCY #12

Closed
Nastras opened this issue Jul 21, 2019 · 6 comments
Closed

UNMET PEER DEPENDENCY #12

Nastras opened this issue Jul 21, 2019 · 6 comments

Comments

@Nastras
Copy link

Nastras commented Jul 21, 2019

Hello, Erik,

i just noticed that when calling npm list -g --depth=0 on homebridge-lib an error is displayed. I installed Homebridge-lib again Error is still present.

King Regards
Nastra

@Nastras
Copy link
Author

Nastras commented Jul 21, 2019

Bildschirmfoto 2019-07-21 um 07 00 45

@Nastras
Copy link
Author

Nastras commented Jul 21, 2019

Could it be that version homebridge-lib@4.3.0 is too new for homebridge-hue@0.11.29. That's how I understand the error?

@ebaauw
Copy link
Owner

ebaauw commented Jul 21, 2019

Yes. Homebridge-hue doesn’t (yet) use the functionality in homebridge-lib that had breaking changes between v4.2.9 and v4.3.0, so it will work alright with this newer version.

I introduced the peer dependency setup so multiple plugins could share a single instance of homebridge-lib, using fewer system resources. This way, the plugins share the heartbeat timer and UPnP listener. I’ve also been fantasising about other shared functionality, like exposing a switch to enable/disable homebridge debug logging dynamically (so you would have to restart homebridge with or without -D).

However, the peer dependency setup seems far more challenging that I had anticipated. While technically fit for purpose, it’s an a-typical setup, too complex for users, and causing too many issues. I might have to revert to homebridge-lib being a regular dependency, installed with each plugin, and find another way share a single instance, very much like homebridge provides a single instance of HAP-NodeJS to all plugins.

@Nastras
Copy link
Author

Nastras commented Jul 22, 2019

Yes. Homebridge-hue doesn’t (yet) use the functionality in homebridge-lib that had breaking changes between v4.2.9 and v4.3.0, so it will work alright with this newer version.

  • That's what I suspected.

I introduced the peer dependency setup so multiple plugins could share a single instance of homebridge-lib, using fewer system resources. This way, the plugins share the heartbeat timer and UPnP listener. I’ve also been fantasising about other shared functionality, like exposing a switch to enable/disable homebridge debug logging dynamically (so you would have to restart homebridge with or without -D).

  • I think that's a great idea.

However, the peer dependency setup seems far more challenging that I had anticipated. While technically fit for purpose, it’s an a-typical setup, too complex for users, and causing too many issues. I might have to revert to homebridge-lib being a regular dependency, installed with each plugin, and find another way share a single instance, very much like homebridge provides a single instance of HAP-NodeJS to all plugins.

  • I wish I could help you, unfortunately I don't know anything about this topic. But I want to thank you for the detailed description and your great work in the homebridge project. I hope that you find a solution for the problem!

Greetings Nastra

@ebaauw
Copy link
Owner

ebaauw commented Jul 22, 2019

Thanks, @Nastras.

@ebaauw
Copy link
Owner

ebaauw commented Jul 23, 2019

The latest versions of my plugins, once again, list homebridge-lib as regular dependency.

homebridge-lib@4.3.3 can no longer be loaded by Homebridge. The first plugin loaded also registers homebridge-lib with Homebridge, providing the heartbeat and UPnP listener to the other plugins.

@ebaauw ebaauw closed this as completed Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants