-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Finalize public API #924
Comments
Short version: I have no objection to making all the modules internal, although I think there is value in the Keyboard module that make it interesting to other people/projects. Longer version: My original intention was that each of these modules would be generic enough that others could use them independently. I do think there is value to the maintainability of the project to keep those modules modular and independent of each other module. Documenting the public API of each module was a way of keeping myself honest about that modularity. However, at this point, I don't think any external projects would be likely use Mouse or Display. There are a lot of projects/frameworks that have similar functionality and the current Mouse and Display modules are somewhat specific to what we need in noVNC. On the other hand, I think all the effort that we have put into the Keyboard module to work around browser limitations and quirks is fairly unique and solves a problem that a number of different types of web applications have (and will continue to have in the future). So I still think there is some value in keeping it documented for possible external use. However, that would require a level of commitment from our team and if none of us want to own that, then we don't want to mislead people into thinking it's something it's not (and then filing bugs that would just be noise for us). On the topic of RFB module APIs: I recently ran across https://github.com/mikeal/webtorrent-element. I think something like that might be interesting for noVNC as a future feature. |
If you are referring to the shadow DOM thing, then yes please. :) |
The API, yes. But the actual code can wait. I don't think it's a regression? I'd also like to have a look at our properties, making them a bit more standard. I'll submit a PR with what I'd like to change. |
Actually, we need this in order to clean up the API. Argh... |
Some more issues I've found whilst going over things:
|
I actually wrote a quick-and-dirty custom element for noVNC a while ago. It worked pretty well. Needed polyfills for Firefox, worked natively in Chrome. Had to do some translation from the noVNC callbacks to the more element-style events, though. |
My thoughts (written on #927 as well):
Probably not, but it's hard to decide. It's a tricky balance between good API surface and too much API surface.
Mostly? Can't think of anything off the top of my head, but I do recall a couple of awkward names. Will try and look for some. I like most of the name changes made in the linked PR.
Are you suggesting implementing
I'll need to look in more detail, but the general gist seems reasonable.
You mean on the fly in the UI? That would be interesting, but I don't think we need it for 1.0.0
Huh? That's what
Do you have any specific complaints here? On keeping the mouse/keyboard/display APIs:Generally agree with @kanaka -- I don't mind moving more things internal, but keeping keyboard separate would probably be nice. I do think that keeping a limited external API is nice in terms of separating abstraction though -- I like the division, I just don't think we need to guarantee the entire API (for instance, keep |
Indeed. But it's easier to add things than to remove them. So I would prefer if we start with a conservative approach.
Which is internal, so I think we would need a better interface. But I think we can live with logging not being configurable for the 1.0 release. We can add something later.
The user-facing boundary is
Not more than the fact that we have quite a bit of interaction in One idea is to move towards a shadow DOM approach. We would give the |
ah, you have a slightly different boundary of "user facing". I think it's allowable to have some stuff that's not in the RFB object be user-facing. Namely, anything that doesn't seem to belong in the RFB object, but is used in |
I have a PR in the works to adress this issue, stay tuned. |
See #950 |
I feel satisfied with the API for now. If someone has anything else they want do discuss or change before a release, please reopen this soon. |
I want to make a suggestion to improve scale/resize handling first. |
#960 is merged so closing this issue. |
Before we release a 1.0 of noVNC we really should take a look at our public API, mainly on the RFB module. If we want to remove or change anything, now is the time.
A few things that we might want to think about:
Event
type for our callbacks. More in line with general JavaScript API's. Also, currently with the "onEvent" style we can only have one listener at a time.PS:
I think that we should stop looking at Mouse, Keyboard and Display the same way. In my eyes the main API we have towards other applications that use our code is the RFB module. Mouse, Keyboard and Display are more internal help-modules. Therefore I don't think we have to preserve those API's as much. I don't think we need to document the API of Mouse, Keyboard and Display either.
The text was updated successfully, but these errors were encountered: