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

2.0 preview #64

Merged
merged 27 commits into from
May 12, 2017
Merged

2.0 preview #64

merged 27 commits into from
May 12, 2017

Conversation

valdrinkoshi
Copy link
Member

@valdrinkoshi valdrinkoshi commented Sep 16, 2016

I adapted it to work both in 1.0 and 2.0.

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@googlebot
Copy link

CLAs look good, thanks!

@bicknellr
Copy link
Contributor

The demo seems broken: nothing happens when I click on any of the buttons or the boxes labelled 'target'.

demo/index.html Outdated
@@ -96,7 +94,7 @@
</simple-fit>
<script>
var defaultTarget = Polymer.dom(myFit).parentNode;
var template = document.querySelector('template[is="dom-bind"]');
var template = document.querySelector('dom-bind');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work in 1.x?

@valdrinkoshi
Copy link
Member Author

@bicknellr re nothing happening on click => Polymer/polymer#4509

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@googlebot googlebot added cla: no and removed cla: yes labels Apr 7, 2017
button.selected {
background-color: #b3e5fc;
}
</style>
<template is="dom-bind">
<dom-bind><template is="dom-bind">
<template is="dom-repeat" items="[[containers]]">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this dom-repeat require a wrapper? I know that you don't need them within a dom-module's template but I can't remember if they're necessary in another dom-*'s template like this one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the demo's working so this one must not require a wrapper.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, Kevin says that template extensions don't need wrappers if they're nested in a template that's being managed by Polymer in some way (i.e. the template for a dom-module or anywhere in the dom-* elements`).

setTimeout(function() {
// If invisible or in a shadow root that's still not connected, wait a tick.
if (window.getComputedStyle(this).display === 'none' ||
document.body.contains(this) === false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

document.body.contains(this) will only be true when this isn't inside any ShadowRoot, even if its connected. Are you finding that attached is getting fired when this isn't connected? If so, this could be another reactions queue issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that the element wasn't centered correctly on firefox. After debugging i realized that it had all 0s in its getClientBoundingRect on attached. I should debug this more and discover where's the issue exactly - I was under the impression that attached would be called in cases like this

var ce = document.createElement('custom-element');
document.createElement('div').appendChild(ce);
// div not in body, though custom-element is attached! 

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attached only called in gets called as a result of connectedCallback (I don't think there are other places?) and connectedCallback reactions are only enqueued when an element's shadow-including root changes from a non-document to a document. So, running that snippet on its own won't cause ce'sattached to run. However, if attached is getting called as a result of that snippet, then this is likely a bug in the custom elements polyfill.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. I'll write a small repro & file a bug then 👌

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a different behavior compared to 1.x - awaiting news on webcomponents/shadydom#120

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to flush in b6f5441

this.fit();
}.bind(this));
} else {
// NOTE: shadydom won't apply the upgrades synchronously for performance reasons
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(same comment as this one in paper-ripple, this is problem is about distribution rather than upgrades)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👌

Copy link
Contributor

@bicknellr bicknellr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default positionTarget used by the IronFitBehavior element in the demo is different in 1.x vs 2.x because dom-bind seems to be putting things inside it next to the template in 1.x and outside itself in 2.x. This makes the demo seem really broken, particularly in 1.x since the dom-bind ends up with display: inline; (the default for unknown elements). I'll confirm with Kevin, but this should probably be considered a dom-bind bug. If not, the demo needs to be restructured to make this look consistent.

@valdrinkoshi
Copy link
Member Author

Wow good catch! 💯 Yeah it looks like a dom-bind bug...please update this PR with the issue! In case that's a "wontfix" from dom-bind, it would be still useful to have a pointer to that in a comment 👌

@bicknellr
Copy link
Contributor

Filed as Polymer/polymer#4536; sounds like they're planning on fixing this today.

@bicknellr
Copy link
Contributor

bicknellr commented Apr 17, 2017

^ Update on this bug: merged, so should be in v1.9.1.

@bicknellr
Copy link
Contributor

... and we're tagged. I'll give the demos another quick check.

Copy link
Contributor

@bicknellr bicknellr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, demo looks good with Polymer v1.9.1!

@googlebot
Copy link

CLAs look good, thanks!

@valdrinkoshi valdrinkoshi merged commit 06f7844 into master May 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants