Skip to content

Inject template and tests#3

Open
wswoodruff wants to merge 7 commits into
masterfrom
inject-template
Open

Inject template and tests#3
wswoodruff wants to merge 7 commits into
masterfrom
inject-template

Conversation

@wswoodruff

Copy link
Copy Markdown
Collaborator

No description provided.

@wswoodruff

Copy link
Copy Markdown
Collaborator Author

Test 4 is failing to prove there's an issue with this.$.* in base elements. Test 5 proposes a possible fix by doing a regex search and replace?

@wswoodruff

Copy link
Copy Markdown
Collaborator Author

Let's add a test for the CSS as well! Is that getting copied over just fine?

@devinivy

Copy link
Copy Markdown
Owner

Awesome start! Can we nix the console.logs?

Comment thread misbehave.html Outdated

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This should be another method passed to _addFeature.

Comment thread misbehave.html Outdated

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

What if base isn't an element that's being mixed in to the ext component? I suppose this function could care and enforce that, or it could work for any base element type. What do you think?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The purpose of injectFrom is to be an accessory of .toBehavior and should only be used in a misbehaving element for the purpose of getting the inherited template. I think we should enforce that base be 'one of' the elements .toBehavior-ing in the ext component.

@devinivy

Copy link
Copy Markdown
Owner

Will this respect bindings? We need an injectBoundHTML() type of thing, don't we? Have you seen http://stackoverflow.com/questions/30836412/polymer-1-0-injectboundhtml-alternative ?

I'm not sure about how to deal with styles...

@wswoodruff

Copy link
Copy Markdown
Collaborator Author

loL that SO post is where I found the misbehavy fix for injecting HTML grabbed from an ajax call. <element inner-h-t-m-l="{{prop}}"></element>
Looks like it does have its issues but we aren't binding with anything passed in here for the project I needed it for.

As for styles... Let's just look for a <style> tag or <link> (with type 'css') in the base!

@wswoodruff

Copy link
Copy Markdown
Collaborator Author

There's an issue in my code with the code from 'another-component' executing once with all undefined props, etc. and a 2nd time with everything working fine.
On line 34 of 'another-component' I have to run a check to see if it exists before calling a function, otherwise we get an error.

@wswoodruff

Copy link
Copy Markdown
Collaborator Author

And I'm failing the 'preserves sub-behaviors' test still, I haven't tried to fix it, hoping for it to work itself out while merging this with your other things. The this.$.* tests pass though!!

Comment thread misbehave.html

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

What about children's children, etc.? Hopefully there's a way we can get Polymer to do this work. More info possibly here: https://github.com/Polymer/polymer/blob/b0733d3c07f071cb05ae88473cd07caee20ffe03/src/standard/annotations.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants