sidorares / node-x11

X11 node.js network protocol client
MIT License
518 stars 72 forks source link

Replaced os-homedir (deprecated) with os.homedir() #192

Closed mat-sz closed 4 years ago

mat-sz commented 4 years ago

os-homedir was deprecated in 2018, in favor of require('os').homedir() which is built into node.js.

Also, I'm working on a project using this package and there's a chance I may find something to improve - for example I'm working on creating TypeScript definitions for X11 - would you be interested in receiving those improvements as PRs?

sidorares commented 4 years ago

would you be interested in receiving those improvements as PRs?

yes, definitely. What sort of improvements you have in mind?

mat-sz commented 4 years ago

@sidorares

Mostly performance improvements (since I had performance issues, especially with the window manager example) and TypeScript type definitions (for better interoperability with TS).

I'm not sure if I can make the performance better, though. If I succeed then I will definitely try to push the changes here so everyone can benefit from that. I also thought about rewriting some pieces with new ES features to improve code quality.

sidorares commented 4 years ago

@mat-sz I'd like to rewrite core deserealising/serialising part, I didn't touched it in last 9 years :) Back then even Buffer wasn't available, hence everything is string based. I'd expect enormous performance boost here

Also would be good to revisit api and migrate to async/await, but that would be difficult to do in a backwards compatible way

mat-sz commented 4 years ago

@sidorares

The easy way to keep compatibility would be to return a Promise if the callback argument is undefined, I've seen quite a few projects do this.

I'm currently using C++ (XCB) instead of node.js because I wanted to get my project off the ground faster but that doesn't mean I'm not interested in improving the X11 landscape on node.js.