Openui5: Suggestion: hyperscript-like API for render manager

Created on 24 Oct 2016  路  3Comments  路  Source: SAP/openui5

Hello, I find hyperscript very convenient to produce HTML code. It might be easier to write custom controls' renderers in this manner.

For example, something like this:

return r('div.profile', { id: control }, [
  r('img', { src: control.getPictureUrl() }),
  r('div.name', control.getName())
])

Instead of

rm
  .write('<div')
  .writeControlData(control)
  .addClass('profile')
  .writeClasses()
  .write('>')
  .write('<img'
  .writeAttribute('src', control.getPictureUrl())
  .write('/>')
  .write('<div class="name">')
  .writeEscaped(control.getName())
  .write('</div>')
  .write('</div>')

I'd like to suggest evaluate the idea and consider its implementation.
Will it be suitable for OpenUI5 codebase?

consulting in progress

Most helpful comment

Hi,

We are working on improving the API of RenderManager.

Jordan

All 3 comments

Hi @yaruson,

Thanks for the ticket.
Internal ticket 1670521190 with your request has been opened for this.

Hi,

We are working on improving the API of RenderManager.

Jordan

Hi again,

We have introduced a new rendering API that is semantic in a way that it works quite like hyperscript. We will roll it out soon but it's basically there under the hood and can be used.

I am closing this issue now and stay tuned for details.

Best regards,
Jordan

Was this page helpful?
0 / 5 - 0 ratings