snuggsi icon indicating copy to clipboard operation
snuggsi copied to clipboard

Examples not working under Edge / 15

Open robcole opened this issue 7 years ago • 14 comments

Using a cross-browser testing app to test a production app, however, this is also replicable in our local examples. Attaching screenshots of one in Chrome, other in Edge / 15 (similar issues exist in Edge / 14 and IE / 11).

Happy to debug more if someone can give me an area to look; it's looking like support for both IE and Edge is lacking.

My hunch is that this is due to the polyfills, but I haven't tracked down a way to actually gain any traction fixing it yet.


Example: http://snuggsi.herokuapp.com/examples/hello-world

Also tested: JS fiddle of example, http://jsfiddle.net/snuggs/3zwkj9wg/?utm_source=website&utm_medium=embed&utm_campaign=3zwkj9wg

Chrome

image

Edge / 15

image


Console Errors (Edge)

image

robcole avatar Aug 29 '17 19:08 robcole

@robcole seems like this is the "gold standard" at least 2 years ago. https://blogs.windows.com/msedgedev/2015/07/15/microsoft-edge-and-web-components/

snuggs avatar Aug 30 '17 18:08 snuggs

@robcole https://github.com/devpunks/snuggsi/issues/127

snuggs avatar Aug 30 '17 18:08 snuggs

@snuggs @brandondees - I was able to get the page load working with a new Polyfill (link) but there's a new issue with this.context not being defined. Tried accessing it in an onconnect function with no luck - small snippet of code + screenshot of error posted; sorry for screenshot, but can't copy/paste from Browserstack.

debugger call inserted so I can log what this and this.context look like before the error is triggered (on next line).

const supporterWallElement = class extends HTMLElement {
  initialize () {
    this.context.currentPage = 1; // pagination
    this.context.supporters = [];

    this.context.wallUrl = document
      .querySelector(`supporter-wall`)
      .dataset
      .wallUrl;
  }

  onconnect () {
    const template = Template(`supportercard`);
    debugger;
    template.bind(this.context.supporters);
    this.fetchSupporters();
  }
...

image

robcole avatar Aug 31 '17 15:08 robcole

I don't think this.context has any magic to it, just a convention pattern you can follow. basically, set it to an empty object yourself. right, @snuggs ?

brandondees avatar Aug 31 '17 17:08 brandondees

@brandondees What I mean by this is that this.context isn't being initialized in Edge the way it is in Chrome in the Component class, i.e. https://github.com/devpunks/snuggsi/blob/master/dist/snuggsi.js#L341 doesn't appear to be triggered.

robcole avatar Aug 31 '17 19:08 robcole

AHHH I See interesting @robcole that Polyfill is part of the solution we are coming up with. Thanks man!!!! @robcole /cc @brandondees

snuggs avatar Aug 31 '17 23:08 snuggs

Promising!!! Feelin' real good about this 💪 @robcole @brandondees @albertoponti @cristhiandick @angelocordon @codeSnorter capture d ecran 2017-09-01 a 06 49 54

snuggs avatar Sep 01 '17 10:09 snuggs

Internet Explorer 11

capture d ecran 2017-09-01 a 09 28 36

Firefox 54

capture d ecran 2017-09-01 a 09 35 28

snuggs avatar Sep 01 '17 13:09 snuggs

@brandondees @robcole @tmornini @kurtcagle I have been through (I.E.) Hell and back. Was an extremely dark place the past few days in IE land. (Couldn't even log on Slack let alone messenger due to resource hogging of Parallels). That said... Polyfill complete (from my testing). Big salute to @robcole for coming through with that document.registerElement polyfill as well. It filled in the missing pieces that was giving webcomponentsjs polyfill problems in IE. Also integrating into snuggsi.es so we can remove the polyfill noise from the README (confusing as fuck! and @cristhiandick hates it) . Which means we have custom elements in IE (back to 8 I believe) AND Firefox. That said, now getting snuggsi upgrades working which we have full control over. Still down by 1 in the football game. As soon as we get those undefined clear that's the 2 point conversion to win the Super Bowl.

/cc @albertoponti @cristhiandick 🏈 💯 🎉 :goal_net:

Polyfill Implementation

HTMLElement

  • https://github.com/devpunks/snuggsi/blob/master/elements/html-element.es

CustomElementRegistry

  • https://github.com/devpunks/snuggsi/blob/master/elements/custom-elements-registry.es

Screen Captures

Safari

capture d ecran 2017-09-05 a 09 47 31

Firefox

capture d ecran 2017-09-05 a 09 46 10

Chrome

capture d ecran 2017-09-05 a 09 45 40

Internet Explorer 11

capture d ecran 2017-09-05 a 09 37 16

snuggs avatar Sep 05 '17 13:09 snuggs

Thanks for the updates @snuggs - LMK when you're at a point where you'd like some real-world testers and I'd be happy to test against our current code! 🤞

robcole avatar Sep 05 '17 22:09 robcole

Sheds light on solution. From the spec maintainers. And their frustration with polyfill authors https://github.com/whatwg/html/issues/1704 Particularly https://github.com/whatwg/html/issues/1704#issuecomment-241881091

snuggs avatar Sep 12 '17 00:09 snuggs

@robcole @brandondees @albertoponti @cristhiandick.

Only 1 bug left in FF and all clear. I'd say 98% complete cross browser.

snuggsi

snuggs avatar Sep 12 '17 19:09 snuggs

... Sans webcomponentsjs pollyfill

@brandondees and it's getting worse... Good thing we got off the boat. github.com/webcomponents/webcomponentsjs/issues/830#issuecomment-328973451

snuggs avatar Sep 12 '17 19:09 snuggs

@robcole @brandondees @albertoponti @cristhiandick iOS & (as @robcole calls it) IE (Edge) #Touchdown 🏈 with 1% to go. ;-)

capture d ecran 2017-09-13 a 19 47 31

img_4154

snuggs avatar Sep 13 '17 23:09 snuggs