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

Add optional way to strip whitespace from templates #2511

Closed
sorvell opened this issue Sep 30, 2015 · 7 comments
Closed

Add optional way to strip whitespace from templates #2511

sorvell opened this issue Sep 30, 2015 · 7 comments
Assignees
Labels

Comments

@sorvell
Copy link
Contributor

sorvell commented Sep 30, 2015

It's typically a very minor performance improvement if whitespace is stripped from templates, but it's cumbersome to write html this way. We could expose a strip-whitespace option to templates that would be processed at registration time and would strip all whitespace from templates.

@sorvell sorvell added the p1 label Sep 30, 2015
@sorvell sorvell self-assigned this Sep 30, 2015
@ebidel
Copy link
Contributor

ebidel commented Sep 30, 2015

Could this just be the default? You can't look inside a template in the
tools and generated dom will be formatted.

On Wed, Sep 30, 2015, 4:37 PM Steve Orvell notifications@github.com wrote:

It's typically a very minor performance improvement if whitespace is
stripped from templates, but it's cumbersome to write html this way. We
could expose a strip-whitespace option to templates that would be
processed at registration time and would strip all whitespace from
templates.


Reply to this email directly or view it on GitHub
#2511.

@samccone
Copy link
Contributor

whitespace sometimes can be really important in templates, I wonder if automatically stripping by default might break what people expect and be quite difficult to debug.

@ebidel
Copy link
Contributor

ebidel commented Oct 1, 2015

is DOM based, where whitespace doesn't matter.

On Wed, Sep 30, 2015, 4:48 PM Sam Saccone notifications@github.com wrote:

whitespace sometimes can be really important in templates, I wonder if
automatically stripping by default might break what people expect and be
quite difficult to debug.


Reply to this email directly or view it on GitHub
#2511 (comment).

@samccone
Copy link
Contributor

samccone commented Oct 1, 2015

oh perhaps I am not correctly understanding what

whitespace is stripped from templates

means then 😉

@ebidel
Copy link
Contributor

ebidel commented Oct 3, 2015

@samccone it's a blink bug where style recalc takes a large amont of time on textnodes:
https://code.google.com/p/chromium/issues/detail?id=399816

@ebidel
Copy link
Contributor

ebidel commented Nov 6, 2015

This is fixed from Steve's commit.

@idanen
Copy link

idanen commented May 3, 2016

The addition of this feature caused a weird bug for me when using paper-toggle-button in an AngularJS app.
When used in a container that repeats using ng-repeat the toggle-button is drawn twice.
I made a plunkr demoing the issue: plunkr
When removing the strip-whitespace attribute, it goes back to normal.
I'm not sure whether to open a new issue or just re-opening this one...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants