This repository has been archived by the owner on Mar 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 120
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('[' + modelIdAttributeName + ']', el).each(function() { | ||
var id = this.getAttribute(modelIdAttributeName), | ||
model = self.collection.get(id); | ||
if (!model) { |
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.
sorry to be sense but if the collection item was rendered for a model in the collection, what would be the case where the model would no longer exist?
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.
Two cases: the there is no constant id value and somehow the data changed between data sources between the time that the client and server data was rendered. The later generally shouldn't happen but we want to play it safe.
Released in v3.0.0-alpha.1 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements the logic necessary to restore server rendered views on the client side.
At a high level this is a hueristic that tracks the references made in handlebars templates and allows for views to be associated with the rendered HTML. Should we not be able to associate under a variety of cases, discussed below, the view will be rerendered at the deepest node possible given the specific error case.
These are covered in the tests, but the primary restore cases are:
{{../foo}}
for example, the entire view will be rerendered on the client side.Layout.setView
: Restores named views automatically. In the event of name mismatch, the layout element is cleared and standard rendering continues.This may be kicked off by calling the
restore
method on the view directly but generally it's expected thatLayout.setView
restore path will be the primary path for views to be restored.Assumptions/Caveats:
contextPath
data attribute.