UI5 / UI5/docs

Central topic to learn about rendering in UI5

Open
#17 4 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

In Process
Dominant language
No language data
Stars
74
Forks
59
PR merge metrics
No merged PRs in 30d

Description

It would be nice if there is a central place to learn about how renderings are done in UI5 (Especially for new developers with experience in popular frameworks).

1. General understanding

For newcomers and researchers:

  • Basics: what does "rendering" mean in the first place in the context of UI5? (I feel people often confound "rendering" with the paint event of the browser)
  • When, in which situation, or by which actions do controls get invalidated to rerender in UI5?
  • When rerendering, how is the DOM update in UI5 realized? String-based? VDOM? Incremental DOM / in-place DOM patching / semantic rendering? Using a third-party lib like lit-HTML (e.g. in case of UI5 Web Components)? Or something else? How does it work?
    And: how does the current rendering approach differ from other popular concepts? Is the rendering engine itself tree-shakable? Lower memory consumption? Any performance or complexity analysis (Big O)? Does UI5 require diffing the DOM trees to detect changes? Or is the DOM manipulation done directly without diffing?
  • What other concepts does UI5 provide to optimize DOM manipulation?
    Linking to other resources like Extended Change Detection, InvisibleRenderer.render, etc…
2. Implementing renderers

For advanced UI5 developers:

Motivation

Currently, it is easy to lose track of what best practices are, in which situation. Trying to understand the above mentioned points to get a full picture is not easy either. When going through the documentation:

  • Information about rendering seems scattered in different topics.

  • Code snippets in some topics still use the deprecated rendering APIs (write*(), add*(), …)
    Some use the new semantic rendering APIs (openStart(), class(), attr(), …).
    For beginners, it's not clear which one is new and which one is old.

  • Code snippets with inconsistent renderer assignments:

  • Code snippets with inconsistent renderer definitions:

    • In the control definition itself as renderer: {/*...*/}
    • A separate renderer module (e.g. MyControlRenderer.js)
      • Returning a plain object with bExport true (Not intended to be used for non-SAP developers)
      • Returning Renderer.extend(/*...*/); whereas Renderer is required from sap/ui/core/Renderer (Current best-practice AFAIK)
  • One or two topics that explain all the above points would help people to grasp rendering in UI5 quickly. Additionally, the Best Practices for Developers section "Control rendering" should be also enhanced afterwards.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing Renderer Methods, Writing a Control Renderer, Extended Change Detection, and Best Practices for Developers topics referenced in the issue. Map the scattered rendering guidance and identify which examples use deprecated or inconsistent APIs. Done means producing one or two coherent rendering topics and updating the control-rendering best-practices section.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.