-
Notifications
You must be signed in to change notification settings - Fork 122
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
[GPT-517] Exposing registry supported templates via context #423
Conversation
Want to add some tests for this |
src/registry/domain/repository.js
Outdated
}); | ||
} | ||
return []; | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good, but I am thinking performance here. This if+map+getInfo() is executed on each component execution (when the context is baked) by making this call and I don't think there is actually any need for that, as the templates are kind of statically initialised during registry's start anyways. What about moving this to the constructor on the top (around line 17) and memorising that in a variable, so that this method just exposes it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
totally agree!
@matteofigus Added some test, and some error handling. Also removed the need to define core-templates in the conf (next will need to see how to extend this dinamically for dev). |
oc-template-jade
andoc-template-handlebars
by defaultgetTemplate()
helper for the repository to leverage on template.getInfo() API@matteofigus did I miss anything? (Still WIP)