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

ui: session - Preloading page cannot redirect to a state that is part of a lazy loaded module #810

Closed
christophercr opened this issue Oct 30, 2018 · 1 comment · Fixed by #814

Comments

@christophercr
Copy link
Collaborator

christophercr commented Oct 30, 2018

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/NationalBankBelgium/stark/blob/master/CONTRIBUTING.md#got-a-question-or-problem

Current behavior

When trying to navigate to a specific page by typing the URL in the navigation bar of the browser, the app PreloadingPage tries to find the corresponding Router state. In case the URL matches an state that only defines a lazy loaded module, the PreloadingPage navigates to that state which is in fact wrong because it is only a "placeholder" state for the "future" states that will be loaded lazily.

Expected behavior

The Preloading page should redirect to the correct final state regardless of whether that state is part of a lazy loaded module or not. This means that in case the state is part of a lazy loaded state, then that module should be loaded first before doing the redirection.

Minimal reproduction of the problem with instructions

  1. Define a lazy loaded module in your app and its different child routes.
  2. Run the application in PROD mode and navigate to one of the routes of the lazy loaded module.
  3. Put the cursor on the navigation bar of the browser and press Enter so that the browser opens the application again but with that URL.
  4. The application shows the PreloadingPage and then it redirects to the "otherwise" state since it tried to redirect to the wrong state (a placeholder for "future" states of the lazy loaded module without even loading such module).

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

Seamless integration with lazy loaded modules.

Environment


Angular version: 6.1.9
Stark version: 10.0.0-beta.0

@christophercr christophercr added this to the 10.0.0-beta.1 milestone Oct 30, 2018
@christophercr christophercr self-assigned this Oct 30, 2018
christophercr referenced this issue in christophercr/stark Oct 31, 2018
… lazy loaded modules. Adapt Showcase to make DemoModule and NewsModule lazy loaded

ISSUES CLOSED: #810
christophercr referenced this issue in christophercr/stark Oct 31, 2018
…om lazy loaded modules. Adapt Showcase to make DemoModule and NewsModule lazy loaded

ISSUES CLOSED: #810
@christophercr christophercr changed the title ui: session pages - Preloading page cannot redirect to a state that is part of a lazy loaded module ui: session - Preloading page cannot redirect to a state that is part of a lazy loaded module Oct 31, 2018
christophercr referenced this issue in christophercr/stark Oct 31, 2018
…om lazy loaded modules. Adapt Showcase to make DemoModule and NewsModule lazy loaded

ISSUES CLOSED: #810
christophercr referenced this issue in christophercr/stark Oct 31, 2018
…om lazy loaded modules. Adapt Showcase to make DemoModule and NewsModule lazy loaded

ISSUES CLOSED: #810
christophercr referenced this issue in christophercr/stark Nov 2, 2018
…om lazy loaded modules. Adapt Showcase to make DemoModule and NewsModule lazy loaded

ISSUES CLOSED: #810
christophercr referenced this issue in christophercr/stark Nov 2, 2018
…om lazy loaded modules. Adapt Showcase to make DemoModule and NewsModule lazy loaded

ISSUES CLOSED: #810
@SuperITMan
Copy link
Member

Closed by #814

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment