Skip to content

fix(router): do not finish bootstrap until all the routes are resolved#14762

Merged
chuckjaz merged 1 commit into
angular:masterfrom
vsavkin:4x_router_bootstrap_fix
Mar 7, 2017
Merged

fix(router): do not finish bootstrap until all the routes are resolved#14762
chuckjaz merged 1 commit into
angular:masterfrom
vsavkin:4x_router_bootstrap_fix

Conversation

@vsavkin
Copy link
Copy Markdown
Contributor

@vsavkin vsavkin commented Feb 27, 2017

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x")

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

The bootstrap doesn't wait for the router to finish the initial navigation.

What is the new behavior?

There is an option you can pass to RouterModule.foRoot to make bootstrap wait. Since many depend on the current behavior, it is preserved as a default and is deprecated.

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[ ] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@vsavkin vsavkin force-pushed the 4x_router_bootstrap_fix branch 3 times, most recently from 7a1483f to b0c4fd9 Compare February 27, 2017 13:25
@vicb vicb added area: router action: review The PR is still awaiting reviews from at least one requested reviewer labels Feb 27, 2017
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • typos in "localtion"
  • could you be more verbose on what the preferred choice should be (ie most probably "enabled") and when you would like to switch to "disable". Also say that the "legacy_..." options are for backward compatibility and should not be used for new apps ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

back quote true/false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move these 2 mehtods out of the class ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initNavigationDone = false ?

@vicb
Copy link
Copy Markdown
Contributor

vicb commented Feb 28, 2017

Please add a DEPRECATIONS section in the commit message. Thanks !

@vsavkin vsavkin force-pushed the 4x_router_bootstrap_fix branch from b0c4fd9 to bd367dc Compare March 1, 2017 12:39
DEPRECATION

Use `RouterModule.forRoot(routes, {initialNavigation: 'enabled'})` instead of
`RouterModule.forRoot(routes, {initialNavigtaion: true})`.

Before doing this, move the initialization logic affecting the router
from the bootstrapped component to the boostrapped module.

Similarly, use `RouterModule.forRoot(routes, {initialNavigation: 'disabled'})`
instead of `RouterModule.forRoot(routes, {initialNavigation: false})`.

Deprecated options: 'legacy_enabled', `true` (same as 'legacy_enabled'),
'legacy_disabled', `false` (same as 'legacy_disabled').

The "Router Initial Navigation" design document covers this change.
Read more here:
https://docs.google.com/document/d/1Hlw1fPaVs-PCj5KPeJRKhrQGAvFOxdvTlwAcnZosu5A/edit?usp=sharing
@vsavkin vsavkin force-pushed the 4x_router_bootstrap_fix branch from bd367dc to dc49334 Compare March 1, 2017 17:46
@vicb vicb added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer state: blocked labels Mar 1, 2017
enableTracing?: boolean;
errorHandler?: ErrorHandler;
initialNavigation?: boolean;
initialNavigation?: InitialNavigation;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this a breaking change? when was this interface introduced?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see https://github.com/angular/angular/pull/14762/files#diff-c0baae5e1df628e1a217e8dc38557fcbR237

the changes are described in the commit comment: former options are valid and have the same meaning (true/false), new values have a new meaning and are documented,

@chuckjaz chuckjaz merged commit 5df998d into angular:master Mar 7, 2017
vsavkin added a commit to vsavkin/angular that referenced this pull request Mar 13, 2017
angular#14762)

Cherry-pick of 5df998d onto 2.4.x branch.

DEPRECATION:

Use `RouterModule.forRoot(routes, {initialNavigation: 'enabled'})` instead of
`RouterModule.forRoot(routes, {initialNavigtaion: true})`.

Before doing this, move the initialization logic affecting the router
from the bootstrapped component to the boostrapped module.

Similarly, use `RouterModule.forRoot(routes, {initialNavigation: 'disabled'})`
instead of `RouterModule.forRoot(routes, {initialNavigation: false})`.

Deprecated options: 'legacy_enabled', `true` (same as 'legacy_enabled'),
'legacy_disabled', `false` (same as 'legacy_disabled').

The "Router Initial Navigation" design document covers this change.
Read more here:
https://docs.google.com/document/d/1Hlw1fPaVs-PCj5KPeJRKhrQGAvFOxdvTlwAcnZosu5A/edit?usp=sharing
asnowwolf pushed a commit to asnowwolf/angular that referenced this pull request Aug 11, 2017
angular#14762)

DEPRECATION:

Use `RouterModule.forRoot(routes, {initialNavigation: 'enabled'})` instead of
`RouterModule.forRoot(routes, {initialNavigtaion: true})`.

Before doing this, move the initialization logic affecting the router
from the bootstrapped component to the boostrapped module.

Similarly, use `RouterModule.forRoot(routes, {initialNavigation: 'disabled'})`
instead of `RouterModule.forRoot(routes, {initialNavigation: false})`.

Deprecated options: 'legacy_enabled', `true` (same as 'legacy_enabled'),
'legacy_disabled', `false` (same as 'legacy_disabled').

The "Router Initial Navigation" design document covers this change.
Read more here:
https://docs.google.com/document/d/1Hlw1fPaVs-PCj5KPeJRKhrQGAvFOxdvTlwAcnZosu5A/edit?usp=sharing
juleskremer pushed a commit to juleskremer/angular that referenced this pull request Aug 28, 2017
angular#14762)

DEPRECATION:

Use `RouterModule.forRoot(routes, {initialNavigation: 'enabled'})` instead of
`RouterModule.forRoot(routes, {initialNavigtaion: true})`.

Before doing this, move the initialization logic affecting the router
from the bootstrapped component to the boostrapped module.

Similarly, use `RouterModule.forRoot(routes, {initialNavigation: 'disabled'})`
instead of `RouterModule.forRoot(routes, {initialNavigation: false})`.

Deprecated options: 'legacy_enabled', `true` (same as 'legacy_enabled'),
'legacy_disabled', `false` (same as 'legacy_disabled').

The "Router Initial Navigation" design document covers this change.
Read more here:
https://docs.google.com/document/d/1Hlw1fPaVs-PCj5KPeJRKhrQGAvFOxdvTlwAcnZosu5A/edit?usp=sharing
@angular-automatic-lock-bot
Copy link
Copy Markdown

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 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: router cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants