-
Notifications
You must be signed in to change notification settings - Fork 9
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
Use pure JS node-dbus ? #6
Comments
You mean, switch to https://github.com/sidorares/node-dbus? Yeah, that would be much better. What's more, the currently used dbus implementation makes fixing bugs like #1 very difficult. |
Service implementation example: https://github.com/sidorares/node-dbus/blob/master/examples/service/server2.js |
I'd looked into this, but I have 0 experience with dbus and this repo does not have any tests, so I either need some guidance or need to add some tests |
I think the first thing to do would be to describe the Letters used are data types (yeah, it kind of sucks), here is the spec: https://dbus.freedesktop.org/doc/dbus-specification.html#type-system It seems that for methods, the last item in the types list is the return value. All others are arguments. Then, we'll need to implement Tests are a very good idea, but I don't really know how to implement them. Created an issue for that: #7 |
actually, that module is not purely native too, instead, it uses |
Yeah looked over the code and what it would take to patch the current dbus library, and I think it's easier just to write it out. Working on this now. |
I found a bug in 0.2.5 of dbus-native that won't handle functions that return nothing, but it's fixed in the master branch. |
Now I have found that the |
Thanks for looking into this! Indeed we do need a full |
There's an internal implementation of the properties interface that's different from the exported interface implementation. There's no way to emit events on the internal implementation, so we can't emit The There's no way to make a property readonly either. I'll do some probing PRs and see if the maintainer has a will to make this work. |
Eh, these are pretty severe limitations. :\ |
Another problem with dbus-native is it has a very unusual and undocumented variant object format you'd need to write a converter for. The current library node-dbus is no better. It completely ignores the types of the properties. There is no way to represent "1.0" as anything other than a byte which is needed for volume and rate. I'm beginning to think the best way to fix this is to just write your own dbus service in C because there's not a good library for writing the services in node. |
Hey, I'm redesigning the dbus-native service interface so it can work for this project. https://github.com/acrisci/node-dbus-next See a working example here. Let me know what you think. |
Looks great! Keep up the good work! |
Migration to dbus-next (a fork of dbus-native) is a rewrite, but fixes some outstanding bugs in the project related to variant types. The project is now transpiled to use the experimental decorator feature that will be available in the language at some later time. gulpfile.js contains build instructions. Build with `npm run build`. The dist/ folder contains what will be published on npm. Interfaces are implemented as classes with decorators specifying the properties of the member that is exported on the bus. Update examples and add a new tracklist example. Other bugfixes may have been a side effect of the rewrite. fixes dbusjs#1 fixes dbusjs#6 fixes dbusjs#13
Migration to dbus-next (a fork of dbus-native) is a rewrite, but fixes some outstanding bugs in the project related to variant types. The project is now transpiled to use the experimental decorator feature that will be available in the language at some later time. gulpfile.js contains build instructions. Build with `npm run build`. The dist/ folder contains what will be published on npm. Interfaces are implemented as classes with decorators specifying the properties of the member that is exported on the bus. Update examples and add a new tracklist example. Other bugfixes may have been a side effect of the rewrite. fixes dbusjs#1 fixes dbusjs#6 fixes dbusjs#13
Can I say I love you guys? |
😎 |
@emersion Can we expect a release soon? |
Yes. I wonder if this should be a new major release. @acrisci, thoughts? |
Yes definitely a new major release. I'm pretty confident it works ok. Electron integration is what worries me a little. I've tested it in the Electron sample app and it works fine. However, I can't get it to work in GPMDP. I think they might have some security thing that's disabling the node interfaces. I'm still looking into it. |
Ok just figured it out. They use an invalid interface name (includes the |
Nice. I'll wait a little to get your fix in. |
@emersion I have a branch of GPMDP with mpris functional for playerctl. Ready for release 👍 . |
2.0 released! 🎉 Thanks again for your hard work! |
@acrisci When trying to use
I am a bit confused because Electron 4 is based on Node 10 so everything "should" work, any idea?
|
@martpie can you open a new issue with some more information on the error? |
If all required features are there, I think it would be nice to switch into pure JS version to improve portability.
The text was updated successfully, but these errors were encountered: