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

Web Serial API support #204

Open
patrykwegrzyn opened this issue Apr 12, 2023 · 6 comments
Open

Web Serial API support #204

patrykwegrzyn opened this issue Apr 12, 2023 · 6 comments

Comments

@patrykwegrzyn
Copy link

Does this package support Web Serial API when used in a browser rather than Chrome app?

@colinbdclark
Copy link
Owner

Not yet, but it would be a good feature to add. It's something I've looked into a bit, and I think it should be doable, but I don't anticipate having capacity to do the work myself for the next little while. PRs of course are hugely welcome.

@patrykwegrzyn
Copy link
Author

I'm already looking into it

@patrykwegrzyn
Copy link
Author

Hi @colinbdclark good news i spent evening on this and i have basic webserial implementation working, tested it so far with osc messages.

Its working ok only if i use build file from dist via script tag

<script src="/osc-browser.js"></script>

image

BUT fails if im trying to use via import keyword

import "../../osc-browser.js

image

looks like some thing to do with slip package

image

Im not familiar with gunt , i think build export it in a funky way.
I tried importing slip package from npm and it worked fine so it is not package issue.

import slip from "slip"

it may be related to this issue colinbdclark/slip.js#3

Have you ever come across this before ?

It also does this when trying to import chromeapp bundle ( not touched by my code ) so you can test it on your end.

Let me know your thoughts .
Best wishes

Pat

@patrykwegrzyn
Copy link
Author

I have done some digging in the issues and it’s look like it’s been mentioned several times.

Would you consider to moving to something like rollup ? And have multiple module types in the dist?

Example
osc-web-esm.js
osc-web-umd.js
….

I’m more than happy to open new issue and assist you with it if you are up for it .

In my mind it would open broader usage of this awesome package , a lot of people including me use react and other frameworks and esm module is standard these days , it would be a lot easier to use package with divergent frameworks rather than some funky monkey patching of webpack configs.

Currently I’m re building my euclidean sequencer from nodejs for my poor man’s monome arc clone ( Arduino , LED ring and LED encoder talking osc ), with react for the nice ui, it has so many gestures that deserve ui now , webserial will make it a lot easier as there is no need for the web socket anymore and make it more accessible all you need is a browser

Anyway Let me know your thoughts.
Pat

@colinbdclark
Copy link
Owner

Hi @patrykwegrzyn, thanks so much for looking into all of this, I really appreciate it. Moving to Rollup is fine with me, assuming we are able to continue to support the use case that is, in many ways, the polar opposite of the modern React/ES6 modules/WebPack "standard" toolchain paradigm: use with plain old script tags and no modules or imports or other things that often serve as a barrier to entry for artists who aren't professional corporate web developers. If we can add better support for ES6 modules and WebPack without cutting out that use case, I'd be delighted.

This is the busiest time of year for me, so I'll be a bit slow to respond, but I'm happy to help with whatever you need to make this happen.

@patrykwegrzyn
Copy link
Author

Great sounds like a plan i will continue of webserial PR and once we there i'll look into new build system

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