Skip to content
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

Merged
merged 2 commits into from
May 17, 2019

Conversation

turt2live
Copy link
Member

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

This doesn't cover default_server_name because that pulls in a questionable amount of JS.

See #9290
@turt2live turt2live changed the title Show most homeserver options on the mobile guide Show resolved homeserver configuration on the mobile guide May 14, 2019
@turt2live turt2live marked this pull request as ready for review May 15, 2019 00:02
@turt2live turt2live requested a review from a team May 15, 2019 00:02
Copy link
Member

@dbkr dbkr left a 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.
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member Author

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.

@turt2live turt2live merged commit 7a65dc9 into travis/feature/wellknown2 May 17, 2019
@turt2live turt2live deleted the travis/wk/mobileguide branch May 17, 2019 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants