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

[GPT-517] Exposing registry supported templates via context #423

Merged
merged 6 commits into from
Mar 29, 2017

Conversation

nickbalestra
Copy link
Contributor

@nickbalestra nickbalestra commented Mar 27, 2017

  • CLi dev configure with oc-template-jade and oc-template-handlebars by default
  • getTemplate() helper for the repository to leverage on template.getInfo() API
  • add templates to contextObj

@matteofigus did I miss anything? (Still WIP)

@nickbalestra nickbalestra changed the title [GPT-517] Exposing registry supported templates via context [WIP][GPT-517] Exposing registry supported templates via context Mar 27, 2017
@nickbalestra
Copy link
Contributor Author

Want to add some tests for this

});
}
return [];
},
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totally agree!

@nickbalestra
Copy link
Contributor Author

@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).

@nickbalestra nickbalestra changed the title [WIP][GPT-517] Exposing registry supported templates via context [GPT-517] Exposing registry supported templates via context Mar 29, 2017
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.

2 participants