Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] UI: centralise ComponentRenderer::render() #7469

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

thibsy
Copy link
Contributor

@thibsy thibsy commented May 3, 2024

Hi folks,

This is one part of the PR I created to introduce JavaScript hydration to the UI framework (#6948).

It centralises the ComponentRenderer::render() function inside our AbstractComponentRenderer by using a new abstract method called renderComponent() and gets rid of the AbstractComponentRenderer::checkComponent() calls. I also tried to streamline the instanceof checks a bit, and returned null in methods which threw a LogicException or returned an empty string if the component could not be handled.

Also note that I changed the exception from a LogicException to a RuntimeException, because at this point errors will only ever be discovered at runtime.

Kind regards,
@thibsy

@thibsy thibsy added kitchen sink improvement php Pull requests that update Php code labels May 3, 2024
@thibsy thibsy force-pushed the feature/10/ui-central-render-function branch from 2b50431 to bf5d501 Compare May 3, 2024 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement kitchen sink php Pull requests that update Php code
Projects
None yet
3 participants