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

[Custom]: mixin pattern: custom elements should be able to extend any base tag with is= (bugzilla: 27977) #153

Closed
hayatoito opened this issue Jul 6, 2015 · 2 comments

Comments

@hayatoito
Copy link
Contributor

Title: [Custom]: mixin pattern: custom elements should be able to extend any base tag with is= (bugzilla: 27977)

Migrated from: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27977


comment: 0
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27977#c0
Randy Harmon wrote on 2015-02-07 19:02:20 +0000.

As a creator of web components, I'd like to be able to have a component perform element-type-agnostic concerns, such that it could be mixed in to any specific tag, thus specializing the prototype for that tag instance.

This would affect the attachedCallback, where the component author would need to be given a tag-instance prototype, ideally already prepared for doing mixins on, and might indicate some fine-tuning of element registration, to support the late assignment of prototype to tag instance. I imagine non-mixin custom tags would have a largely unchanged lifecycle, not least for API compatibility.

Ideally, multiple is= values would allow multiple mixins, each overlaying the prototype chain defined by the attachedCallback from the prior mixin.

@annevk
Copy link
Collaborator

annevk commented Mar 11, 2016

I suggest we close this since doing mixins before JavaScript has them seems premature here. @domenic?

@domenic
Copy link
Collaborator

domenic commented Mar 11, 2016

Right. Also, http://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/ should give you a way to do mixins through a JavaScript-compatible prototype chain mechanism which would work well with existing infrastructure.

@domenic domenic closed this as completed Mar 11, 2016
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