-
Notifications
You must be signed in to change notification settings - Fork 48
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
Support the DOM? #162
Comments
Another related question: If we don't expose the DOM tree, is it possible to expose an accessibility tree for accessibility APIs to provide a representation that can be understood by assistive technologies (such as screen readers)? Can developers use JavaScript to modify the accessibility tree in a MiniApp? |
Thanks for capturing this issue. Since in current MiniApp implementations, pages are NOT fully native HTML5, I assume supporting native DOM APIs would need certain translation/transformation. |
Because it was proposed by the authors of MiniApp frameworks in the CJK meeting, I will try to ask them. IMHO the biggest benefit is that website client-side JavaScript code can run in a MiniApp with few modifications. |
Sorry for my ignorance, but MiniApps don't support HTML and JavaScript? |
MiniApps do support JS but not native HTML. Currently, many pre-standard implemenations use HTML-like languages to describe the page layout and UI components (new tags and events). In order to simplify data binding and component interactions, most of them adopt a Vue-like framework that provides convenient templating mechanism ( Note: It is a question under discussion whether MiniApps would need a new markup language or just a HTML extension. |
@marcoscaceres, I have documented the way this works today in an article (which is part of a wider series). |
That's a great document! Thanks @tomayac |
It seems that at least some MiniApp implementations support adding attributes that can be used to provide additional semantics and improve accessibility: |
Filed #166 for the accessibility tree issue. |
Currently, MiniApp platforms do not seem to support DOM manipulation.
MiniApps are based on Web technology, but they are different from ordinary web pages. In the browser, page rendering and JavaScript logic are executed in the same thread. However, MiniApps use multiple threads to complete the rendering of MiniApps: one thread is dedicated to rendering, which we generally call the view layer; and one or multiple thread(s) deals with data and logic, which we generally call the logic layer. Each MiniApp page can have one or multiple independent threads (also known as workers) in the logic layer. In the view layer, there is usually one thread, but some MiniApp implementations uses multiple threads to preload WebViews to improve the performance of page navigation.
These threads run concurrently and exchange data through MiniApps platform. The logic layer processes the data and sends it to the view layer, and receives feedback from the view layer.
Because the rendering and background logic processing can run concurrently, this makes the MiniApp more responsive.
In other words, the actual DOM tree exists in the rendering layer, but not in the logic layer, so the logic layer does not contain a
document
orwindow
object and is not able to do DOM manipulation.Can we consider exposing some DOM APIs to the logic layer so that MiniApps can make better use of JS libraries for the Web? And if we expose DOM APIs, what interfaces need to be exposed? Are there any performance considerations?
The text was updated successfully, but these errors were encountered: