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
ie8 support #1517
Comments
I managed to get it working with a hacked up version of the es5-sham. I haven't pinned down what caused the error yet, I started with an empty file and kept adding until the app started working (fortunately this happened before IE started crashing). I've also added it to a forked version of ember-todos-cli for a slightly more thorough test. The app I'm working on still isn't working though(it's fine in IE9) so I'll have to keep digging tomorrow. |
My main app worked fine after reinstalling all the node modules so that version of the es5-sham looks like it works fine. It could do with a little tidying up around the edges but for now I'm just happy to have it running in ie8! |
I've pinned it down to a single line and updated the gist to include everything except the problematic line https://gist.github.com/opsb/1d2569b89ab7d9d0f662#file-es5-sham-js-L345. It gets called once when ember starts up. IE8's debugger crashes when I try to open it so it's a bit hard to pin it down further than that. |
sorry for the silence on this thread, i am reading it. Just extremely busy with work this week. This sounds like an issue that should also be opened up on es5-shim/sham repo |
@stefanpenner yup, it does seem to be a problem with their implementation, the values that were causing ie8 to crash were as below: (quite remarkable really that this could cause ie8 to crash...)
I've opened an issue at es-shims/es5-shim#264 |
@opsb nice thanks for digging into this. |
@stefanpenner see the thread over at es-shims/es5-shim#264 for more details, but the short version is that ember stubs Object.create itself and when it does so it sets a flag isSimulated which is used in other parts of the ember codebase. Because es5-sham stubs Object.create before ember the flag is never set. There's an Ember.ENV.STUB_OBJECT_CREATE which you can use to force ember to stub Object.create as well and thus set the flag. Where would be the place to put Ember.ENV.STUB_OBJECT_CREATE = true ? I'm thinking index.html is probably the right place to do this as I can put an ie8 conditional around it. Do you think this is the best approach? |
The ember-cli-ie8-demo now runs without crashing in ie8. I'll leave the repo up and I've added some instructions for setting up a project to work in ie8. |
Why is ember relying on a manually set flag, rather than a feature test? That seems the source of the problem here. If ember did |
ember canary does this correctly: https://github.com/emberjs/ember.js/blob/master/packages/ember-metal/lib/platform.js#L109 |
@stefanpenner I think the issue is the use of the isSimulated flag. It's only set if Object.create hasn't already been stubbed before ember tests for it. |
@opsb im not sure how the isSimulated flag could possible change the outcome of: |
@stefanpenner it won't, but the flag not being set (which is the case if you use es5-sham before ember - neccessary with ember-cli) will mean the following workaround won't be applied. https://github.com/emberjs/ember.js/blob/v1.6.1/packages_es6/ember-runtime/lib/keys.js#L15 |
@opsb my comment above was referring to ember canary, not 1.6 |
@stefanpenner I finally got the debugger working so I can see what's going on a bit more. The call stack is pretty deep where the error gets thrown, 2904 calls, most of it recursion inside the wireState method from ember-data. The call originates at RootState = wireState(RootState, null, "root"); I'm not familiar with the code so I'm not sure whether this is a reasonable level of recursion or if there's an infinite loop happening. |
@opsb thats seems absolutely crazy. Do you mind providing steps for me to reproduce i'll try to find some time to dig in. |
@opsb should we move this over to ember.js proper or does this not happen with master? |
@stefanpenner I'm not sure where to put this issue as it occurs in ember-data but I presume it's just the first piece of code to hit the issue caused by the implementation of Object.create. To recreate just check out https://github.com/opsb/ember-cli-ie8-demo, change the ember version to canary and then load it up in ie8 (I use the image from modern.ie). To get it to break at the right point I use a call counter inside Object.create i.e.
|
Just ran into this too @opsb - thanks for digging in |
This is also happening on the jj-abrams resolver: https://github.com/stefanpenner/ember-jj-abrams-resolver/blob/master/dist/ember-resolver.js#L47 IE8 fails here, complaining |
@jdjkelly i should have done. |
PR up here: ember-cli/ember-resolver#63 - matches what Ember canary is doing - I'll submit a version bump PR for ecli if that gets merged |
@jdjkelly merged |
Unfortunately, this issue still exists for me on Ember canary (as of emberjs/ember.js@793dbf3). To be precise, with the basic "Hello Ember.js" app:
I'm not sure if the latter error is something else entirely, and the original |
That node error is unrelated and a new regression since Sunday night... |
Also entirely unrelated to ember cli |
I've been working on trying to get our app working with IE8, and tried importing the ES5 shim and sham in the If this is desired functionality, I'll create a new issue and work on a PR for this. |
@trabus which version of ember are you using? |
Also, I finally got IE8 loading with: Removing es5-sham.js entirely fixed the crashing issue described in ember data #9430 (I was still experiencing the same crash even with the 'Ember.create' fix in place). |
@trabus How did you accomplish getting the vendorFiles being put first? I need the es5-shim but not the sham. |
I was using Ember CLI 0.1.1, there was a change in 0.1.2 that changed the order of vendorFiles. I made a pull request that fixes this recently. It just got merged into master and will be available in 0.1.5. You will be able to import the file with
|
I've put together a demo app that uses es5-shim to add the missing bits. https://github.com/opsb/ember-cli-ie8-demo. The Brocfile loads up the shim and sham but apart from that the repo is a vanilla ember-cli app(they're loaded before ember via the vendor-files option). If I just load up the shim I get an error when Object.create is used. The sham polyfills this but unfortunately when it's included in the build it also causes ie to crash completely.
The text was updated successfully, but these errors were encountered: