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

Refactor rendering #312

Merged
merged 1 commit into from
Sep 28, 2023
Merged

Refactor rendering #312

merged 1 commit into from
Sep 28, 2023

Conversation

jonathanhefner
Copy link
Member

This reimplements the SDoc::Templatable module as an SDoc::Renderer class. An SDoc::Renderer is instantiated per file render, which provides an isolated scope for each rendering. Utilizing that isolation, the context object (the RDoc::CodeObject instance) is now stored in @context so that it doesn't have to be explicitly passed to partials.

Also, as an optimization, SDoc::Renderer memoizes compiled ERB.

This reimplements the `SDoc::Templatable` module as an `SDoc::Renderer`
class.  An `SDoc::Renderer` is instantiated per file render, which
provides an isolated scope for each rendering.  Utilizing that
isolation, the context object (the `RDoc::CodeObject` instance) is now
stored in `@context` so that it doesn't have to be explicitly passed to
partials.

Also, as an optimization, `SDoc::Renderer` memoizes compiled ERB.
@jonathanhefner jonathanhefner merged commit 040d2f7 into rails:main Sep 28, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant