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

Change createElement(localName, typeExtension) to createElement(localName, { is }) #408

Closed
domenic opened this issue Mar 2, 2016 · 2 comments

Comments

@domenic
Copy link
Collaborator

domenic commented Mar 2, 2016

In #405 @annevk suggested changing the proposed signature of createElement from (localName, typeExtension) to (localName, options) so that we don't keep piling parameters onto it. This makes sense to me. I think a dictionary containing "is" is pretty reasonable.

This would impact Blink negatively since they are already shipping the string-taking version. I guess maybe they could use an overload for the transition period? Dictionaries and strings are distinguishable, right? I should really memorize that table.

This is all operating under the assumption that we don't just completely remove type extensions from v1. My understanding of the F2F was that we were going to leave them in and see if they got 2 shipping implementations.

@rniwa
Copy link
Collaborator

rniwa commented Mar 2, 2016

Right, we're not going to implement it (is/extends) in WebKit, and we're not going to have this additional argument on createElement as a result. But the rough consensus at F2F was indeed to leave it in the spec and see what happens in the implementations.

@annevk
Copy link
Collaborator

annevk commented Mar 2, 2016

Dictionaries and strings are distinguishable, yes (the only problem would be with existing code relying on stringification of some object).

The main reason I want to make this change is that we might extend createElement() further. I sort of thought at some point it was going away in favor of constructors, but that does not seem to be happening anytime soon, so we might add other features here, just like custom elements is trying.

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