-
Notifications
You must be signed in to change notification settings - Fork 50
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
Proxy'd component missing setState in IE 9/10 #27
Comments
Woah woah, that's the best issue description I've seen in a while. 👍 I think it happens because IE did not support assigning I'm not sure if there's any meaningful fallback we could use.. |
Yep, that lack of |
If you can detect it, you can fall back to prop copying. |
I can confirm this is also happening in IE10. Any workaround for this? |
The biggest issue for me is that I don't have IE at hand, and can't verify whether any changes to the code fix this. If you'd like to work on this please look here: react-proxy/src/createClassProxy.js Lines 88 to 89 in d1b975d
This is the line which, from what I understand, has no effect in IE < 11 because it doesn't support |
Just hit this. Testing on IE10 using the VMWare image via https://dev.modern.ie/tools/vms/mac/. I can't dig into it at the moment, but I thought I'd plug the site in the interim. |
Babel docs contains a caveat about |
I didn't have any luck getting the transform to work. Anyone else? |
I've also noticed that the transform in the docs is now a plugin, you can try that instead of |
The plugin does transform that line from |
Never mind the transform. I don't know how to fix this. I'd say we likely won't support IE 9 and IE 10 as dev environment anymore. |
Dropping <= IE10 support is fine by me as long as it's done in a clean way. I would love for browsers that don't have access to Right now I just export an environment variable in my build to disable hot loading when testing in IE10 ( |
I agree with @nhunzaker. I'm fine with that as well, since I didn't expect the hot reloading stuff to work in IE9 anyway. |
Yeah let's do that. Anybody would like to make a PR? We should have a feature test ( We should also find a way to mock the feature test for unit tests. |
I probably can't get to it until Thursday, but I'd be happy to dig in. |
I added you to collabs, feel free to work in a branch. Don't commit to master. ;-) |
Only supporting hot reloading in newer browsers is perfectly fine for me as well! |
Basically we'll just give you your component back if |
Just an update here. I was hoping to achieve at least IE9 support by playing around with prototypes (maybe this stirs some inspiration): var prototype = Object.create(React.Component)
var proxy = Object.create(prototype)
// Instead of re-assigning __proto__, operate on prototype However I get into trouble mapping the properties from the component over to I'm wrapping up work on testing export default function supportsProtoAssignment () {
return Object.prototype === ({}).__proto__
}; Now I just need to figure out the best way to test this... @gaearon We can obviously do manual testing, but you have an ideas how we can automate it? I imagine a whole load of tests will fail if we run the whole suite in < IE11. Right now, the only thing that I can think of is to stub out |
👍 |
Huzzah! Any follow up work I can do?
|
Two things:
let x = {};
let y = { supports: true };
try {
x.__proto__ = y;
} catch (err) {}
export default function supportsProtoAssignment() {
return x.supports || false;
}; (Not tested but should match the intended behavior from the name.) I'm not sure how we'd test this behavior in the unit tests though. |
I think I probably solved this with d34f121. |
Note that React Proxy 2.x isn't yet used in React Transform HMR so it'll take some time to get this available directly. |
I backported it to 1.x. Should be out both in 2.0.1 and 1.1.2. |
Awesome! Sorry for the extra leg work.
|
No problem, thanks for contributing! |
Only in IE9:
did not test 10, ok in 11, Edge, Chrome, FF. testing repo: https://github.com/kentor/react-transform-hmr-ie9
Pretty stumped on this one...
I put a debugger on where the Warning would have been emitted and went up the call stack to see what's different from the other browsers. Also here
this instanceof Constructor
returnsfalse
in ie9 vs other browsers.This is a place of suspicion.
I set the
internalInstance
to a variable and then went down a stack framethis
which should have been the caller,internalInstance
, is not the case in ie9 vs other browsers.The text was updated successfully, but these errors were encountered: