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

Simplify templates API #944

Merged
merged 1 commit into from
Nov 17, 2015
Merged

Simplify templates API #944

merged 1 commit into from
Nov 17, 2015

Conversation

dvoytenko
Copy link
Contributor

The refactoring changes:

  1. Remove Promisable response from Template.render. This has proven to NOT be useful.
  2. Remove render APIs from runtime.js

@@ -76,8 +65,8 @@ export class BaseTemplate {

/**
* To be implemented by subclasses.
* @param {!Object<string, *>} data
* @return {!Element|!Promise<!Element>}
* @param {!JSON} data
Copy link
Member

Choose a reason for hiding this comment

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

LOL <3

Is this defined anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. Not yet. But I noticed that in different JS specs, "JSON" typedef is used very consistently. And IMHO it's a lot better at communicating what's expected in cases like this.

@cramforce
Copy link
Member

LGTM

dvoytenko added a commit that referenced this pull request Nov 17, 2015
@dvoytenko dvoytenko merged commit 58923f7 into ampproject:master Nov 17, 2015
@dvoytenko dvoytenko deleted the templ2 branch November 17, 2015 02:34
@mborof mborof mentioned this pull request Jan 13, 2020
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