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

Why is content not a property an requires attribute style binding $=? #18

Closed
lbustelo opened this issue Mar 29, 2016 · 8 comments
Closed
Assignees

Comments

@lbustelo
Copy link

Would be nice if content could be set using property binding in a dom-bind template. Right now it requires $=. At the very least, the README needs to reflect that requirement.

@tomalec
Copy link
Member

tomalec commented Apr 25, 2016

Good point @lbustelo, thanks!
I'll try to make it in some spare time. In meantime I've updated README to match current implementation.

@tomalec tomalec self-assigned this Apr 25, 2016
@tomalec
Copy link
Member

tomalec commented Sep 26, 2016

Hopefully it could benefit in performance with Polymer 1.x, the question is how it applies to Polymer 2.0 Template binding.

@tomalec
Copy link
Member

tomalec commented Oct 11, 2016

It seems, that there is a bug, which make this one required to work, as $= does not work for template element (Polymer/polymer#4060).
The main problem is that, we need a new name - we cannot override native .content property of the HTMLTemplateElement

@warpech, @miyconst, @lbustelo, @deadlyfingers any ideas?

I'd like to keep it short, meaningful and similar/related to content and href as they match conceptually similar thing.

tomalec added a commit that referenced this issue Oct 11, 2016
in non-code-intrusive way,
to make it work with Polymer 2.0-preview - workaround `$=` bug

/issues/18
Polymer/polymer/issues/4060
@tomalec
Copy link
Member

tomalec commented Oct 11, 2016

(work in progress is available at issues/18-content-property branch)

@tomalec
Copy link
Member

tomalec commented Oct 13, 2016

My proposition for the new name is href

  • usually, that's what it is - hyperlink with reference to document to fetch template from,

    but..

  • it could look weird for inline markup.

WIP: https://github.com/Juicy/juicy-html/compare/issues/18-href-attr?expand=1

@tomalec
Copy link
Member

tomalec commented Aug 4, 2017

@warpech Maybe we should do it otherwise. Instead of facing dilemma whether to have attribute name that matches inline content and hyper link, and maintain hidden heuristic rules that guesses that you want to load external content. Just make it explicitly separated?

  • for external content: href
  • for internal content:
    a. content - and don't code it just forward attribute to use native template.content property, just control the (auto)stamping via stamp attribute - stamp attribute to take control on lifecycle of stamping #10)
    b. html which works as before, but no longer collide with property
  • to avoid collisions and headache of mixing those two, setting one, will remove the other.

tomalec added a commit that referenced this issue Aug 4, 2017
make `content` attr an alias to href

tests for chenging proeprty are missing.
#18
@tomalec tomalec mentioned this issue Sep 5, 2017
@warpech
Copy link
Contributor

warpech commented Sep 11, 2017

The above was agreed between me and @tomalec on Hangouts.

tomalec added a commit that referenced this issue Sep 18, 2017
tomalec added a commit that referenced this issue Sep 26, 2017
@tomalec
Copy link
Member

tomalec commented Sep 26, 2017

@lbustelo Sorry, that it took that long.
Starting from https://github.com/Juicy/juicy-html/releases/tag/2.0.0 you can use attributes and properties: href for URLs and html for inline content. So you no longer have to remember about $=

@tomalec tomalec closed this as completed Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants