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
Performance improvement for templates using <template> #1839
Conversation
…element directly as the template for cloning nodes. This is instead of parsing the innerHTML.
This provides an added incentive to use |
Looks good! I am reviewing this one. |
}); | ||
}); | ||
|
||
describe('Anonymous templates', function () { | ||
beforeEach(jasmine.prepareTestNode); |
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.
Doesn't make much real difference, but prepareTestNode
is getting called already for each test in the outer beforeEach
.
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.
Thanks. I've cleaned those up now.
…eeded Performance improvement for templates using <template>
Figured out that putting in in IE11 it just get removed (inner nodes bubble up to the template node) Anyone seen that before? |
@lcorneliussen Can you provide an example? |
I thought |
[EDIT: I think the code isn't working yet :) - but you get the Idea] @IanYates Calling
Same with div as a wrapper element. So I'm back to cloning each node individually in IE 11 - and not clone at all for IE < 9.
And in my lazy template source I add nodes.wrapped to the templates:
|
For named templates that use
<template>
or a normal element, use the element directly as the template for cloning nodes. This is instead of parsing theinnerHTML
.