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

Revisit Router implementation #4864

Open
kravets-levko opened this issue May 4, 2020 · 0 comments
Open

Revisit Router implementation #4864

kravets-levko opened this issue May 4, 2020 · 0 comments

Comments

@kravets-levko
Copy link
Collaborator

Based on discussion here.

When implementing Router we assumed that page controller should be bound to URL path fragment and reloaded only when path changes. Watching for URL query parameters should be responsibility of each controller. That was a sort of optimization, but looks that it's not relevant since Router has a different behavior for history PUSH/REPLACE events.

The idea is to update Router and make it passing URL query parameters as props to controller. When parameters change (for the same URL path) current controller should be updated with new parameters.

Two places that need extra attention:

  • ItemsList component (and all pages based on it): currently it does not watch URL changes by default, but it definitely should.
  • Query Source page. There is a behavior that depends on optimization mentioned above: when saving new query, URL is updated but page controller should stay the same. Proposed Router behavior shouldn't affect this, but when implementing it we should keep this in mind.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant