Skip to content

Support the DOM? #162

@xfq

Description

@xfq

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 or window 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    a11y-trackerGroup bringing to attention of a11y, or tracked by the a11y Group but not needing response.unknown/future spec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions