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

Absence of Object.setPrototypeOf on IE10 since rxjs@6 #24488

Closed
johnny-mh opened this issue Jun 13, 2018 · 13 comments
Closed

Absence of Object.setPrototypeOf on IE10 since rxjs@6 #24488

johnny-mh opened this issue Jun 13, 2018 · 13 comments
Labels
area: core Issues related to the framework runtime state: needs eng input
Milestone

Comments

@johnny-mh
Copy link

johnny-mh commented Jun 13, 2018

I'm submitting a...


[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

Since rxjs@6.0.0 IE10 need polyfill of Object.setPrototypeOf. breaking changes of rxjs6

Angular depends on core-js polyfill. but core-js's Object.setPrototypeOf polyfill needs IE11+ you can check here.

So if Angular want to support IE10. need other polyfill like set-prototype-of or else.

Or just add commented module import syntax like classlist.js.

Or don't support IE10... 😢

Expected behavior

Minimal reproduction of the problem with instructions

After uncomment some lines in polyfill.ts for supporting IE10 but. If browser ran rxjs's EmptyError.js or ArgumentOutOfRangeError.js. throw is not function error.

You can see the source codes

https://github.com/ReactiveX/rxjs/blob/d0ea152f3c5575455a73cc43b8fad6a750d24208/src/internal/util/ArgumentOutOfRangeError.ts#L17

https://github.com/ReactiveX/rxjs/blob/d0ea152f3c5575455a73cc43b8fad6a750d24208/src/internal/util/EmptyError.ts#L17

What is the motivation / use case for changing the behavior?

Environment


Angular version: 6.0.4


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [x] IE version 10 (modern.ie)
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 8.9.3  
- Platform: Windows  

Others:

2018-06-14 5 08 15

@johnny-mh johnny-mh changed the title Absence of Object.setPrototypeOf on IE10 after rxjs@6 Absence of Object.setPrototypeOf on IE10 since rxjs@6 Jun 13, 2018
@alexeagle alexeagle added the area: core Issues related to the framework runtime label Jun 13, 2018
@ngbot ngbot bot added this to the needsTriage milestone Jun 13, 2018
@hLittle
Copy link

hLittle commented Jun 15, 2018

I was able to get it working in IE10 by adding

(function() {
  Object.setPrototypeOf = Object.setPrototypeOf || ({__proto__: []} instanceof Array ? setProtoOf : mixinProperties);

  function setProtoOf(obj, proto) {
    obj.__proto__ = proto;
    return obj;
  }

  function mixinProperties(obj, proto) {
    for (const prop in proto) {
      if (!obj.hasOwnProperty(prop)) {
        obj[prop] = proto[prop];
      }
    }
    return obj;
  }
})();

To polyfills.ts (before core-js/es6) imports

@johnny-mh
Copy link
Author

johnny-mh commented Jun 16, 2018

@hLittle Yes i already know that. but currently. Angular didn't notice this problem to developer. and I think this issue need to fix.

@hLittle
Copy link

hLittle commented Jun 19, 2018

Agreed, just putting this here if anyone is looking for a workaround for this issue, and for use as possible documentation.

@FernandoIbaePLiborio
Copy link

@hLittle, thanks for the comment. Sorry for my ignorance, but this function only solved for angle 6 applications or earlier versions as well?

@johnny-mh
Copy link
Author

@FernandoIbaePLiborio rxjs use that method since 6.0.0-alpha.1 version and it released at Jan 12. Angular upgraded it to 6.0.0-alpha.3 at Mar 20. b43f8bc.

I wonder why this is not a problem. Am i just misusing it? Why peoples dislike this issue? Because of I do not have a PR for solving this problem?

@richflee
Copy link

@hLittle Thanks so much for the workaround! This is great, whilst there's seemingly not something more robust that works.

@lasimonne
Copy link

@everedifice Thanks 🔥🔥

@mhevery
Copy link
Contributor

mhevery commented Jul 12, 2018

This is an RXjs issue not angular. @benlesh could you move this issue to your repo. Also we should not be using setPrototypeOf due to performance.

@jenniferfell
Copy link
Contributor

Per note from @mhevery , assigned this to @benlesh
Marked as "state: needs eng input" to indicate that it's on hold wrto Angular docs work, pending additional information or instructions from @benlesh

@mhevery
Copy link
Contributor

mhevery commented Jul 31, 2018

Closing in favor of ReactiveX/rxjs#3966

@mhevery mhevery closed this as completed Jul 31, 2018
@Moulde
Copy link

Moulde commented Aug 27, 2018

I wonder when rxjs will make a release with the fix?

@prad9
Copy link

prad9 commented Aug 28, 2018

I have the same issue with ie11 aswell. Have used above code from @hLittle and added to polyfills.ts. It worked like a charm.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to the framework runtime state: needs eng input
Projects
None yet
Development

No branches or pull requests