-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Show resolved homeserver configuration on the mobile guide #9726
Conversation
This doesn't cover default_server_name because that pulls in a questionable amount of JS. See #9290
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 fine, but ideally would be nice to have the duplicated code in common files (especially as the mobile guide is already webpack-ed for this purpose).
let config = await getVectorConfig('..'); | ||
|
||
// We manually parse the config similar to how validateServerConfig works because | ||
// calling that function pulls in roughly 4mb of JS we don't use. |
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.
could move validateServerConfig to getconfig.js?
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.
That'd cost us 4mb of JS because it pulls in most of the react-sdk and most of the js-sdk
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.
to expand on that: the problem is that we use multiple webpack layers, so the 4mb consists of things like bluebird, browser-request, etc. If we had a single webpack for the 3 projects, we'd be able to dedupe/eliminate a lot of that cruft
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.
yep, I was just suggesting taking validateServerConfig stuff you have here and putting it into a separate file so both things can use it (the js-sdk bit would have to stay duplicated) but if there's a reason that's not an option then lgtm.
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.
yea, that's what I tried first and it's where the 4mb metric came from :(
The logic is slightly different in that here the goal is to resolve a homeserver as fast as possible with minimal safety whereas the validateServerConfig function tries to find a homeserver that's actually safe to use. It's not directly transferable without avoiding the js-sdk's implementation of stuff, which renders those classes nearly pointless.
Reviewer: Note that this is pointed at the .well-known feature branch, not develop. This is intentional as the feature branch is still unsafe to merge to develop.
See #9290