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

Install templates service right away #1129

Merged
merged 1 commit into from
Dec 10, 2015

Conversation

dvoytenko
Copy link
Contributor

Since templates are always compiled into base runtime, there's no real cost to install right away, rather risk the custom element override it.

@erwinmombay
Copy link
Member

@dvoytenko LGTM

dvoytenko added a commit that referenced this pull request Dec 10, 2015
Install templates service right away
@dvoytenko dvoytenko merged commit 6d05cd4 into ampproject:master Dec 10, 2015
@dvoytenko dvoytenko deleted the install-templates branch December 10, 2015 23:43
@@ -49,6 +50,7 @@ try {
installHistoryService(window);
viewerFor(window);
vsyncFor(window);
templatesFor(window);
Copy link
Member

Choose a reason for hiding this comment

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

Don't understand this: Why do we need templates in core?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They were always compiled in because runtime.js registers the AMP.registerTemplate function. The issue was that depending on download order, either the core's templates service would be installed (if template implementation is downloads first and calls AMP.registerTemplate) or another version, downloaded with amp-list or similar using element, would be installed first. I didn't like this ambiguity. This is subject to the service/implementation refactoring.

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.

3 participants