parsec-cloud / parsec-sdk

Low latency, peer-to-peer, interactive streaming.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Alternative Web SDK proposal

maciejpedzich opened this issue · comments

Hello!

I have already sent an email to sdk@parsecgaming.com, but having received no response for almost a week now, I thought I would open an issue here. And although there already exists an official Web SDK, I would like to propose my own, WIP JavaScript/TypeScript Parsec SDK as an alternative community binding.

Motivation

  • Unavailability on Node.js package managers and external CDNs. Currently, the only way to obtain the SDK is downloading this entire repository, which also contains source code of bindings for other platforms (approx. 146 MB total). It's not the best approach, given that in a modern web application development workflow, third-party libraries are most frequently installed via the aforementioned package managers and CDNs.
  • Single, minified entry point, while perfect for production use, it's not ideal from a project maintainer's perspective... especially if minification may have removed any sort of code comments, but introduced single-letter variable, function, object property names, etc. This makes code analysis and debugging incredibly difficult, thus significantly reducing chances of other developers introducing their own updates/improvements to the library, as well as lowering overall interest in the SDK.
  • No IntelliSense or linting/type-checking out of the box. In a way a byproduct of the previous 2 cons; especially prevalent in popular IDEs and projects utilising TypeScript. Since the latter was named one of the most popular languages in the StackOverflow 2021 Developer Survey, poor developer experience with this JS superset could possibly deter even more programmers.

Advantages over the official Web SDK

Despite still being very early in development, I am confident that my binding has already got plenty of advantages over the current library:

  • Use of TypeScript, which enables one to take advantage of the latest ECMAScript features without worrying about compatibility with older browsers and JS runtime environments. It is also known for great developer tooling/IDE support as well as its interoperability with plain JavaScript... just to name a few
  • Unit testing setup with Jest, ensuring high quality of code, early defect identification, auto-documentation and making the whole development process more agile overall.
  • My library is available on NPM and external CDNs (UNPKG and jsDelivr), allowing for flexible and easy setup as well as integration with modern web applications and module bundlers.
  • Github Actions workflows for Continuous Integration, as well as online docs generation and publishing to NPM upon each new (pre)release

I am certain that Parsec will benefit greatly from an overhauled Web SDK, just as other web developers will from the fantastic, low-latency remote desktop solutions you provide.

We completely support you on this idea! Will check it out asap

We completely support you on this idea! Will check it out asap

Hey, thanks for reaching out! While plenty of core features are yet to be implemented (there's only a Client class with a method for personal authentication strategy), it's a very solid foundation as I've shown above. After the 1.0 version release, I'm also planning to create a sample repository, showcasing the library in a Vue 3 app, as I've also seen a couple of issues/comments requesting an SPA demo. And once again, thank you for the positive response, really appreciate it!

Also, it's only now that I've realised you're not from the Parsec team, but still glad you like it!