-
Notifications
You must be signed in to change notification settings - Fork 12
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
6.0 build target with comment nodes #701
Comments
Check out these tests in can-stache for places where comment nodes are forced outside of can-view-target:
Seems like a pattern. |
|
@bmomberger-bitovi can you give an update on where you got on this? |
What's complete by package:
Still to do:
|
For, point 4, running the
There are still a ton of these warnings: https://github.com/canjs/can-view-live/blob/805b4757a6e77db46737daf9ae2093c28338a434/lib/helpers.js#L20 Can you explain what this case is @justinbmeyer ? |
To make building templates faster, make sure to render with comment nodes.
Currently,
can-stache
creates placeholder text nodes for anything "live" usingcan-view-target
.presentation
For stache like
start{{#if(foo)}}BAR{{/if}}end
instead of placeholder textNodes, create two comment nodes. Resulting DOM would look like:Before:
can-view-target
has already been changed to "force" comments instead of textNodes:https://github.com/canjs/can-view-live/blob/d541c95d04d6db7f6ec2988bc319c98c049328ea/lib/helpers.js#L63
If you have something like
{{foo}}
... this should create a placecholder textNode, however, there are times where you can opt out of this, likesafeString
or components, with those, we'd need to "force" into comment nodes.Approach
can-view-live
warn if it's forcing a "comment node". You will see a LOT of warnings withcan-view-target
, ignore those.can-stache
.Code you might want to change
instead of just adding a function, add two comment nodes:
can-stache/src/html_section.js
Line 60 in 49fea89
should we be forcing comment nodes here:
can-stache/can-stache.js
Line 113 in 49fea89
... or in the
.add()
function?The text was updated successfully, but these errors were encountered: