-
Notifications
You must be signed in to change notification settings - Fork 26.3k
refactor(Location): out of router and into platform/common #7962
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
Conversation
3027cff
to
0739788
Compare
244ce76
to
322b0f7
Compare
Ok. I just added 1 more commit that provides a 2nd alternative refactoring of After working with the first refactor pass into core (the 1st commit), it occurred to me that a For this reason, I wanted to provide an alternative refactor which instead wraps BEFORE:
AFTER:
Since Please let me know which path you like better and I'll squash/add breaking changes to commit message, then update the documentation throughout the files to appropriately reflect the changes as well as update CI breaking is due only to |
f01ab7e
to
a637f4b
Compare
you will probably have to wait for this to be merged #7984 |
we also need to merge |
Thanks for heads up @gdi2290, is there an issue or PR for merging History class? Also I would greatly appreciate your feedback on this PR. |
Hi @NathanWalker, thanks for your PR. I don't think that I could see how you may want to share the |
Agreed. On my 2nd commit I show an alternate refactor path placing it in Would it make sense to have a separate barrel for this, perhaps Just trying to create a path forward for those trying to upgrade from Angular 1.x which provided |
I think |
1f9e9fc
to
e56b777
Compare
I moved it into I'll update the documentation throughout the src by Monday/Tuesday. In meantime, when you can, please review these changes and let me know if you'd like anything else changed. Thanks for your attention to this. |
e56b777
to
cf657db
Compare
@@ -1,8 +1,8 @@ | |||
import {Directive} from 'angular2/core'; | |||
import {Location} from 'angular2/src/platform/browser/location'; |
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.
In general one should never import anything between libraries which includes src
in the URL. You can think of Angular2 and Router as separate libraries.
The correct import should be from angular2/platform/...
Which means that the Location
and friends need to be re-exported from there. Think of src
as private and angular2/platform
as public. Library can only import from another library public API.
This is a general issue I have seen in many imports. Please canonicalize them.
Other than inconsistent import's this looks good to me. Please ping when ready so that we can merge it. |
56708ac
to
febd6f1
Compare
Looking good. You have a broken test:
Can you have a look at it? Otherwise this is good to go. |
22824aa
to
c359249
Compare
Whenever I try to fix it for Dart it breaks for JS and vice versa.
It appears Dart expects them whereas JS (saucelabs) does not:
Am I missing something? Maybe a separate Dart file I'm not seeing? |
I think because |
c359249
to
c0e637b
Compare
You're brilliant @mhevery. Don't let nobody tell ya' different. |
c0e637b
to
d8d64fd
Compare
closes angular#4943 BREAKING CHANGE: `Location` and other related providers have been moved out of `router` and into `platform/common`. `BrowserPlatformLocation` is not meant to be used directly however advanced configurations may use it via the following import change. Before: ``` import { PlatformLocation, Location, LocationStrategy, HashLocationStrategy, PathLocationStrategy, APP_BASE_HREF} from 'angular2/router'; import {BrowserPlatformLocation} from 'angular2/src/router/location/browser_platform_location'; ``` After: ``` import { PlatformLocation, Location, LocationStrategy, HashLocationStrategy, PathLocationStrategy, APP_BASE_HREF} from 'angular2/platform/common'; import {BrowserPlatformLocation} from 'angular2/src/platform/browser/location/browser_platform_location'; ```
d8d64fd
to
1254f01
Compare
Thank you. Added the right labels to get it merged... |
Merging PR #7962 on behalf of @robertmesserle to branch presubmit-robertmesserle-pr-7962. |
+1 #8240 |
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. |
public_api_spec.ts
with new api changes@mhevery I don't want this to affect the hard work going into making the ~ 10 KB goal for core.
I could foresee
Location
,LocationStrategy
,HashLocationStrategy
,PathLocationStrategy
,APP_BASE_HREF
going intoangular2/common
.Please review when possible and let me know your thoughts.