Skip to content

[web] Multi-view Embedding Support #118481

@ditman

Description

@ditman

Get the code ready to support the multi-view embedding feature. Some changes:

  • Accept a hostElements array in the Engine configuration
  • Refactor the current View Embedder so it's not a singleton anymore.
    • Each View should know how to embed itself, or have an Embedding Strategy associated with it. See this doc.

There's multiple assumptions made in the current view embedder that only one view is going to exist at a time (like the addSceneToSceneHost method, which need to be delegated to each view implementation).

For simplicity, the new design should be something similar to:

  • The platform_dispatcher continues being a singleton that coordinates the engine (in the future, this should be an actual object that gets instantiated).
    • The platform_dispatcher contains a Map<ViewId, View> where all the views are cached for access later.
    • The platform_dispatcher can initialize new Views depending on their configuration (create the appropriate DOM structure for the view, create the view itself), and cache it in the view cache.
    • The platform_dispatcher should receive a view Id for every view "operation".
      • Operations should fetch a view by its id, and operate on it, rather than delegate it to the view_embedder. Look how the current implementation of render ignores the passed-in view.

Most of the above should be implementable in the current state of the engine, without having to wait for the full-blown multi-view setup (at least, to make it work in single-view with the refactored multi-view architecture).

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: existing-appsIntegration with existing apps via the add-to-app flowengineflutter/engine related. See also e: labels.platform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions