-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Navigation #31
Navigation #31
Conversation
https://www.npmjs.com/package/fast-equals Used in Program.js for comparing objects.
Compare these with the changes in the 'navigation' PR in the 'mint' repo.
Ok, I tried running that linter locally ( |
You can format the files with |
I've tried |
Thank you, did so. |
Ignore I have recreated mint-navi-test.tar.gz with hopefully better explanation. Run
|
And here is some manual explanation from memory, what this and the other PRs do:
|
Thanks for the explanation, it's clearer to me now (also I had to hard hard refresh Shift+Ctrl 😅 ) I agree with most of the changes, however not with this:
I usually have the search value as a query parameter The second use case is hash based navigation |
I forgot to mention this: A route gets (re-)triggered in three cases:
This is done here in the code. (I call the parameters So, If one defines a route It is also possible to define a route It is correct, a variable can not catch a
So, trigger route handler, but do not update history. I actually thought of this use case but did not implement it. It suggests a fourth Mint function
(all in the However, one may for example just want to set the URL and update the history but not trigger the route handler, so it is probably best to have all this combined in one function Addon 2023-9-4:
I guess you are referring to the fact that a route defined inside the application, e.g. |
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.
LGTM 🚀
There is one issue: Currently, no one is reacting to the PR in the route-parser repo. So these changes will not be applied when one does The other questions, should we add a fourth function |
I'd take over the library or use |
I have just tried replacing the dependency ( So something like |
Great stuff 🙏 |
Like promised here, I took a look at how navigation works in Mint, and I (hopefully) streamlined things a bit. It is best explained by example, so open
mint-navi-test.tar.gz
and compare
dist now (current issues)
withdist then 1 (issues resolved)
. Run e.g.npx serve
in the folders, or use the tool of your choice. You may have to reload without cache, ctrl+f5.If you want to check my changes using the mint development server,
yarn install
here. (there is a new dependency)node_modules/route-parser/lib/route/visitors/regexp.js
here.make
here.make development
in the mint repo.mint-dev start
in themint-navi-test
folder from above.(make sure these three folders –
mint
,mint-runtime
,mint-navi-test
– are side by side)None of these changes are applied in
dist now
from the above zip.dist then 1
anddist then 2
have all of them applied.dist then 2
shows the differences betweenWindow.setUrl()
,Window.navigate()
andWindow.jump()
.So, this is my suggestion how we could do the navigation.