This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bbecquet
force-pushed
the
poc-router
branch
9 times, most recently
from
August 6, 2019 16:36
18e93ea
to
4fa40d9
Compare
bbecquet
force-pushed
the
poc-router
branch
2 times, most recently
from
August 7, 2019 09:28
6d7cf9c
to
1c19109
Compare
center: poi.getLngLat(), | ||
zoom: poi.zoom, | ||
offset, | ||
maxDuration: 1200, |
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.
A magical value. :)
amatissart
reviewed
Aug 7, 2019
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.
Looks good to me.
I have just a few questions about URL parsing.
Code looks good to me. Still need to check it locally though. |
amatissart
reviewed
Aug 8, 2019
This includes the new QueryContext
amatissart
approved these changes
Aug 9, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
After trying to simplify the "URL shards" system, I'm introducing a real router as a better way to manage navigation between the app states and interaction with the browser history.
This is a really simple, ad-hoc implementation, very easy to remove or replace if we decide to use something more elaborate in the future (
src/proxies/app_router.js
).In this new architecture, the root component (
src/panel/app_panel.js
) defines URL templates with optional parameters, corresponding to valid app states, and for each template a rendering function. The panels are now only switched on or off through this function. Re-renders are the result of new URL states and not the contrary.Transition between valid states is made explicit through a single dedicated function (
navigateTo
), so it happens reliably at a single place.Why
back
/forward
buttons resulted in new pushes. With the new system this is seamless.