-
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
Granular app locator #1124
Granular app locator #1124
Conversation
Also updated @babel/core, @babel/preset-env and @babel/preset-react.
Allows to get the app locator based on the asset bridge provided.
src/app-locator.js
Outdated
// "0x6b20…:3333": load the app with 0x6b20… ID from localhost & the 3333 port. | ||
// "Voting:http://example.com:4444/": load the Voting app from example.com & the 4444 port. | ||
// | ||
export default function getAppLocator(assetBridge) { |
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.
What do you think about calling this an "override"?
We still fallback to loading apps that aren't included in this by using their IPFS content.
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.
Yes 👍
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 renamed it parseAppLocator()
, I think it makes more sense and doesn’t conflict with getAppLocator()
which returns the string from the env. What do you think?
} | ||
|
||
// Get the default URL for this appId (when location=local). | ||
if (!location || location === 'local') { |
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.
Hmm wondering about this; right now, this would force all apps to use the default local override even if they're not part of the list.
I think we should still be checking that DEFAULT_LOCAL_URLS[appId]
exists?
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.
mmm we don’t have an appId
at this stage? We are only getting the list of defined app locators. Then in appBaseUrl()
, we only override if the app ID exists in that object.
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.
Let's also add some documentation to CONFIGURATION.md 😄
Done! |
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.
Awesome 🙌🙌
So excited this is finally done :).
Allows to set the app locator in a more granular way:
.aragonpm.eth
), or its known name if it exists (Finance
,TokenManager
, etc.).http://localhost:<port>/
), that gets used by default if not provided.localhost
is used as a domain.Load all known apps from the local host, as before:
Only load the finance app from the local host (known port):
Load the finance app from
localhost:1234
:Load the finance app and the Tokens app from the local host (known port):
Load the
0x6b20…
app (app ID) fromlocalhost:3333
:Load the
my-app.aragonpm.eth
app (ENS ID) fromlocalhost
:Load the Voting app from
https://example.com:4444
: