Skip to content

fix(router): bootstrap finishes before all routes are resolved #12162

Closed

Description

@jeffbcross

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting

Current behavior

If I have a router that requires resolving async data, bootstrap will complete before the router has finished resolving and rendering. Any parent components that have already loaded will be rendered while waiting for children to load. This behavior is most problematic with pre-rendered applications. The user will first see the pre-rendered content, then when bootstrap is complete and route resolution is still pending, they'll see either a blank page or partially-rendered page, then once all routes are resolved, the full page content will render and should match the pre-rendered content .

Expected behavior

I expect bootstrap not to complete before route resolution and rendering is complete.

Minimal reproduction of the problem with instructions

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

A smooth transition from pre-rendered page to dynamic page and preboot compatibility.

  • Angular version: 2.0.2 and router 3.1.0-rc.0

Activity

  1. vsavkin commented on Oct 12, 2016

    @vsavkin
    Contributor

    Notes:

    Currently we trigger the initial navigation in a bootstrap listener. Angular does not wait for bootstrap listeners to complete.Moving the logic naively into an application listener will not work because the root component is not created at that point. So the router can successfully run preactivation, but cannot run activation. We can split navigate into preactivate and activate. Runpreactivatein an application listener and runactivate ` in a bootstrap listener.

  2. diestrin commented on Jan 16, 2017

    @diestrin
    Contributor

    Is this being address by anyone? More than 3 months and it's still happening :/

  3. 11 remaining items

  4. added a commit that references this issue on Feb 7, 2017
    41dd62c
  5. added a commit that references this issue on Feb 9, 2017
    541de26
  6. DzmitryShylovich commented on Feb 15, 2017

    @DzmitryShylovich
    Contributor

    @vicb the fix was merged so it can be closed

  7. added a commit that references this issue on Feb 17, 2017
    f33f7b8
  8. added 2 commits that reference this issue on Feb 21, 2017
    2a191ca
    d550740
  9. added a commit that references this issue on Aug 11, 2017
    b473d12
  10. added a commit that references this issue on Aug 28, 2017
    a678e99
  11. angular-automatic-lock-bot commented on Sep 10, 2019

    @angular-automatic-lock-bot

    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.

  12. locked and limited conversation to collaborators on Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions