Skip to content

Client side re-rendering of components #1077

Open
@fbarbare

Description

@fbarbare

We need some query parameters on the server side to do some checks, validate some params, etc... but in modern applications nowadays client-side rendering/re-rendering is common practice.

At the moment, if we want a property to dynamically change, we:

  • either need to trigger the re-rendering of ALL OC in the current page
  • either manipulate the data-attributes of the OC html so we can render only that component
  • either use events to give new "params" to our components, but we have to implement that logic in every OC that we create, which can be a bit tedious.

It would be good if this system would be built in.

One problem with the params is that we would need to differentiate between params that would be Client side params and others that would be Server side ones.

Coming from a mainly React background, triggering re-rendering based on new props/attributes seem a pretty good way to go.
We could allow setting data-attributes on the OC HTML element. The templates could set a Mutation Observer on that HTML element and then pass it down to e.g. the react template to pass the new "settings" which would automatically trigger the Client side re-rendering.

This implementation might have to be done on a template to template basis.
This feature might be related to this one: issue 295

Any thoughts on this?
If this is not clear, I am more than happy to create an example repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions