-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Implemented async attributes and content. #428
Conversation
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.
LGTM
Hi guys! This is important stuff for templates forward compatibility with async / prepping code for Async / Meteor 3.0 in Meteor 2.x. Any chance that this'll be merged soon & possibly be included in the 2.14 release? It's this PR and this one: Added support for Promises in #if and #each which would be important I think. The previous one [https://github.com//pull/424](Added support for Promises in #if and #each) we're running in our fairly big meteor blaze app for some weeks now & it looks like it has no bad side effects on existing code as well as doing what it's supposed to do. This one I could try to give a shake this week as well in our codebase. What do you think @StorytellerCZ @Grubba27 @radekmie ? |
@jankapunkt @radekmie I leave this to you guys to figure out if it is ready to merge. I'm happy to get all the async stuff merged and release an alpha of Blaze 3. |
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.
lgtm
@Grubba27 This PR was supposed to be merged later 🙈 |
Sorry 😢 I thought we were merging those PRs. |
No, it's all good. I just wanted to merge them in the opposite order, so their diffs would be meaningful - now this one includes the other one. |
This is an extension of #424, where both async attributes and content are now supported. That means the following code is now correct:
Just like the
#if
and#each
in #424, nothing is rendered until resolved. There's only one problem with async content - since a new view is created each time, the value may flicker. I decided to leave it for now and look into it later.Note that async spread attributes, e.g.,
<img {{attributes}}>
are NOT supported yet.