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

Add support for Custom Elements #68

Closed
jeluard opened this issue Jan 9, 2014 · 12 comments
Closed

Add support for Custom Elements #68

jeluard opened this issue Jan 9, 2014 · 12 comments

Comments

@jeluard
Copy link

jeluard commented Jan 9, 2014

Custom Elements is a new w3c specification that introduces a new API to create DOM element: document.createElement(localName, typeExtension). This API reflects a new html syntax <button is="my-button"></button> where button would be the localName and my-button the typeExtension.

The equivalent hiccup syntax [:button {:is "my-button"}] should generate the proper DOM call when used with dommy to support this spec as setting is as an attribute (current behavior) has no effect.

@jeluard
Copy link
Author

jeluard commented Jan 27, 2014

Any comment? Is that something you would consider addressing? Thanks!

@cpetzold
Copy link
Contributor

Yeah, I think this is definitely a reasonable thing to add! If you're interested in taking a stab at it, it should just be a small change to base-element in template.cljs and compile-compound in macros.clj:

https://github.com/Prismatic/dommy/blob/master/src/dommy/template.cljs#L32-L34
https://github.com/Prismatic/dommy/blob/master/src/dommy/macros.clj#L126

@jeluard
Copy link
Author

jeluard commented Jan 27, 2014

Great, I'll take a look then.

@cpetzold
Copy link
Contributor

@jeluard thanks for contributing -- sorry to say we're deprecating templating. Please see #85

Let us know if you'd like to see templating maintained as a separate project!

@jeluard
Copy link
Author

jeluard commented Nov 5, 2014

Actually yes I would be interested in creating a separate project that would be based on the templating code and add some more features on top of it.
Would that be fine from your side?

@cpetzold
Copy link
Contributor

cpetzold commented Nov 5, 2014

Definitely! Let me know if you need any help getting started.

@jeluard
Copy link
Author

jeluard commented Nov 5, 2014

Great! I'll let you know how it goes.

@jeluard
Copy link
Author

jeluard commented Nov 6, 2014

I pushed a first release that just bundle dommy templating code. Let me know if something looks incorrect.

@loganlinn
Copy link
Member

@jeluard That's giving me a 404. Might it be a private repo?

@jeluard
Copy link
Author

jeluard commented Nov 6, 2014

Oups it should be public now.

@jeluard
Copy link
Author

jeluard commented Nov 9, 2014

I am curious to know why there was 2 versions of node, one as a macro and one as a function. Is there a specific reason you would not want to use the macro one?

@cpetzold
Copy link
Contributor

I think the function version was dead code that wasn't ever removed after the introduction of ->node-like. It's probably not necessary anymore.

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

No branches or pull requests

3 participants