social-elements/github-button

Remove IFrame and directly use API instead

Nevraeka opened this issue · 6 comments

[An example] is in @mdo 's iframe html (https://github.com/mdo/github-buttons/blob/master/github-btn.source.html) This could potentially reduce the overhead incurred by using IFrames.

Hmm, but then we would have to duplicate his code, right? What if he gets updates and PRs merged, we'll end up with an outdated repo.

mdo commented

Let's do it right in my project then :D.

I have no idea how to write any of that code, so if someone wants to join up and commit to the project, I'm all for it.

Good points. Mark - I'm happy to help on your project. I am unsure the approach that would be best without encapsulating it inside an iframe or web component . Thoughts?

My feelings were that we eliminate the dependency on the original library at the cost of some extra maintenance . Also having a web component encapsulate an iframe seems like a step away from what we want with web components. That said, I'm open to ideas on alternative approaches

mdo commented

Most of the serious players for these kind of buttons take regular HTML and modify it with JS. Check out the Tweet button's page: https://about.twitter.com/resources/buttons#tweet.

@mdo I totally agree that this is a great approach. I just don't want to wrap the html twice. :) I was thinking that we could breakup your repo into the 2 repos. One that contains the html, css, javascript and one that wraps that in an iframe. The 1st could be a submodule of the 2nd. Then we could do the same in the web component repo here. This is just one approach - what do you think? cc @zenorocha