-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
fix(upgrade): fix AngularJsUrlCodec to support Safari #32959
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR @agale123!
I think the fix could be simpler but otherwise LGTM.
I don't think this is the right approach, EDIT: May better be commented with notes like enable this when you use @angular/upgrade. |
@trotyl - I don't think that including this polyfill would solve the problem, unless I misunderstand how the polyfill would be applied. Safari supports |
Or perhaps I am wrong and that applying the polyfill will always override the native |
@petebacondarwin Core-js has a built-in feature testing for it to check whether it works well: https://github.com/zloirock/core-js/blob/ba63aec37db946081b40148521bdf27188c3f258/packages/core-js/internals/native-url.js#L7-L24 |
There is no check for |
@petebacondarwin It should be covered by all the single parameter cases like |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
This is not the issue, passing only one parameter works. In fact this was @agale123 's original fix. |
@agale123 could you rebase and squash all the commits into one please? |
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx, @agale123! One comment about the implementation, but the direction is right 😁
BTW, it would be great if we could add some tests for parse()
(but not blocking since we didn't have explicit tests before).
Safari throws an error when the new URL() constructor is called with an undefined base. This change checks whether the base is undefined and then calls the corresponding version of the URL constructor. fix(upgrade): simplify solution by replacing undefined with '' Co-Authored-By: Pete Bacon Darwin <pete@bacondarwin.com> Simplify solution by replacing undefined with '' Co-Authored-By: Pete Bacon Darwin <pete@bacondarwin.com> fix(upgrade): Avoid passing an empty string as the base as well. Browsers other than Safari may have issues with the empty string.
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
That's good to know, I'll go ahead and make that change. |
@petebacondarwin Raised zloirock/core-js#656 for core-js issue tracking. |
Safari throws an error when the new URL() constructor is called with an undefined base. This change checks whether the base is undefined and then calls the corresponding version of the URL constructor. fix(upgrade): simplify solution by replacing undefined with '' Co-Authored-By: Pete Bacon Darwin <pete@bacondarwin.com> Simplify solution by replacing undefined with '' Co-Authored-By: Pete Bacon Darwin <pete@bacondarwin.com> fix(upgrade): Avoid passing an empty string as the base as well. Browsers other than Safari may have issues with the empty string. PR Close #32959
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Safari throws an error when the new URL() constructor is called with an
undefined base. This change checks whether the base is undefined and
then calls the corresponding version of the URL constructor.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #32874
What is the new behavior?
The AngularJsUrlCodec used by the $locationShim works in Safari.
Does this PR introduce a breaking change?
Other information