-
Notifications
You must be signed in to change notification settings - Fork 273
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
Custom app paths #846
Custom app paths #846
Conversation
- Add Jest - parsePath(): Move history.replace() outside of parsePath(), to remove any side effect from the function. - Send the current custom path to the connected app. - Update the browser path based on the path requested by the connected app.
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.
Some in-progress comments as we get closer to this being a reality 🎉
src/routing.test.js
Outdated
}) | ||
) | ||
|
||
path = `/p/${ADDRESS}///` |
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.
Is this a valid path?
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.
I don’t think anyone will use a slash followed by another one, but I don’t see a reason to forbid it. Do you think it should be the case?
@@ -107,26 +104,27 @@ export function getAppPath({ | |||
return `/${action}` | |||
} | |||
|
|||
if (!fullDao) { | |||
return `/${search}` | |||
// Only keep the DAO name if it ends in aragonid.eth |
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.
It seems a bit odd that we're doing this here in routing, but moving the redirect out into the app itself.
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.
The redirect used to be done here, but I don’t think this function should have any side effect. I don’t think it should stay in App
either, I was thinking of moving all of the history
/ window.location
handling in the routing provider that remain to be added. What do you think?
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.
I was thinking of moving all of the history / window.location handling in the routing provider that remain to be added
Yes! This sounds like exactly what we need!
Co-Authored-By: Brett Sun <qisheng.brett.sun@gmail.com>
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! So excited for this :D
// params need to be a string | ||
handleParamsRequest = params => { | ||
this.openApp(this.props.locator.instanceId, { params }) | ||
handleAppMessage = ({ data: { name, value } }) => { |
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.
😅 I didn't even realize before that we removed this function and we were always passing down undefined
@@ -107,26 +104,27 @@ export function getAppPath({ | |||
return `/${action}` | |||
} | |||
|
|||
if (!fullDao) { | |||
return `/${search}` | |||
// Only keep the DAO name if it ends in aragonid.eth |
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.
I was thinking of moving all of the history / window.location handling in the routing provider that remain to be added
Yes! This sounds like exactly what we need!
@bpierre I've pushed an update to fix the hook dependencies :). |
history.replace()
outside ofparsePath()
, to remove any side effect.?p=
) support.