-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
PR: Unify API between WebSerial and this #2238
Comments
Making a binding that uses web serial is a great idea. |
@reconbot it is not only about the binding there is more i also need to add some extra objects and functions. As also stop to force using buffer but all that is not needed. Will expose the same api that serialport uses in the W3C Specs and i will only add some interfaces to your application to support both syntaxes. so you can use node-serialport or WebSerialApi if it exists. i just created a repo for that where i also publish a pollyfill so that the WebSerialApi matches your API with the event emitter and all that. https://github.com/frank-dspeed/WebSerialToSerialPort-API |
ConclusionImplementing a WebSerial API brings no reuseable code because of the Permission System of the Browser and so the alternate methods of retriving ports. There exists a WebStream Ponyfill that can get used to reuse Logic between the implementations. At All i Come to the conclusion that nothing can be added here that would bring any benefits anyway i want to add similar behavior to some of the functions in here i think needs more evaluations of code samples |
closing this over #2271 |
💥 Proposal
What feature you'd like to see
(A clear and concise description of what the proposal is.)
I will implement functions that exist on the WebSerial API on this Project as also Port the most API's of this project to WebSerial.
Motivation
I want to enable Easyer Code ReUse between the both API's so that serialport and webSerialApi can be used with the same code.
Pitch
Will Allow people to use node-serialport as normal with NodeJS while allowing to switch to WebSerialAPI when running in Electron or NW.JS or the Browser.
Implementation State
Includes Interface and bindings for webserial
npm install @serialport/webserial
The Goal is to allow better code reuse between node-serialport and WebSerialAPI
Web StreamAPI
Break Able Read maybe implement able via https://github.com/MattiasBuelens/web-streams-polyfill
Related Issues
The text was updated successfully, but these errors were encountered: