Refactor the rendering for 9.x and 10.x #907
Closed
oliverklee
started this conversation in
Ideas
Replies: 3 comments
-
See my comments in #895. If those are in line with a way forward, with |
Beta Was this translation helpful? Give feedback.
0 replies
-
@sabberworm ping |
Beta Was this translation helpful? Give feedback.
0 replies
-
I have created #921 for moving |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Triggered by these PRs/tickets …:
OutputFormat
/OutputFormatter
#895OutputFormatter
as@internal
#896OutputFormat
#898… I've thought about how to proceed a bit. I've taken these guidelines into account:
This is what I'd like to propose:
Moving the responsibility for rendering elements
Generally, I'd like to move the responsibility for rendering CSS elements (including the document) to a new class:
I'd like to introduce this class sometime after releasing 9.0, and deprecate the
Renderable::render()
methods then (to be removed in 10.x).This class should use the Visitor design pattern.
This would unburden the CSS element classes from the responsibility of rendering the CSS (for which they need the output format, the formatter etc., all of which should be of no concern to a CSS element).
The dependency loop
OutputFormat
/OutputFormatter
I propose we keep the loop for 9.x, and drop the format -> formatter dependency when we drop the
Renderable::render()
methods in 10.x (which AFAIK are the only places where this dependency is relevant).OutputFormatter
As the new
CssRenderer
will take care of rendering (and formatting) the CSS, we will be able to drop theOutputFormatter
class in 10.x.Until then, we make it
@internal
so that users of our library only need to pass an `OutputFormat' instance to render elements.Rendarable::render()
I propose we keep these methods with an unchanged signature in 9.x (to avoid breaking part of the interface which we're going to to remove anyway), mark them as
@deprecated since V9.x, will be removed in 10.0
.@sabberworm @JakeQZ What do you think?
Beta Was this translation helpful? Give feedback.
All reactions