-
-
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
serve config.json statically instead of bundling it #1516
Conversation
By the way, I developed and tested my changes against v0.6.1 before rebasing them on develop as per https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.rst#how-to-contribute. The develop branch is broken at least in my environment, with or without this PR, so I haven't been able to test my changes on the branch the PR merges against. |
cool - thanks for this! :) i am a bit dubious about mixing the promises libraries (vector has enough deps already) but the change in general looks good. I'm on mobile atm but will merge it in using the existing http client & promise libs later today. And very cool to have vector pkged for Arch - thanks! |
dev shouldn't be broken, btw - did you pull in the dev branches of matrix-react-sdk and matrix-js-sdk? |
Thanks @vith! |
we haven't forgotten this - just running low on tuits. this will close #1344 |
If there is anything I can do to help, tell me :) |
Sorry, you're right about develop branch working, I hadn't manually replaced the npm modules. |
I've updated the PR to use |
ah, thanks; that looks much better. @dbkr can you take a look please once you are back in vectorland? |
Is there any risk that the request for the config file could fail and leave the user stuck with a broken vector (could a browser fetch the page entirely from cache and then fail to get the config if you had no internet connection?) Also this has just been broken by us adding a We could probably also remove the json webpack loader too as I think this is the only thing using it. |
@dbkr That worry crossed my mind as well, but since it's a static file I figured the chance of However, an argument against that could be that the request for HTTP/2 Server Push could be used to make Anyway, if it's desired I can change this PR to immediately render a "loading" message and/or retry failed requests and/or render a "loading failed" message. |
That's a good point that I didn't really address, a webpack bundle could use long-term caching by including a hash in the filename. Wouldn't the document have to be uncached so that new versions of the document can get loaded that point to new webpack bundles though? I suppose there may be a possibility of falling back to a cached version if the request fails. I would have to do some research into that. |
Agree with you on the failure modes for fetching the config: we can easily add a retry down the line if it turns out to be necessary. I'm going to try & merge this although will have to make sure we haven't broken it in the meantime by adding |
Merging now that I've fixed the place that requires config.json (f9aaf7d). |
issue #1344
If you don't like the use of es7 features and/or fetch, let me know. I just wanted to throw something together quickly so I could package vector-web for the Arch Linux AUR.