Skip to content

Mind explaining how this works? #266

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

Closed
stevefan1999-personal opened this issue Mar 16, 2019 · 4 comments
Closed

Mind explaining how this works? #266

stevefan1999-personal opened this issue Mar 16, 2019 · 4 comments

Comments

@stevefan1999-personal
Copy link

I'm very infatuated by this beautiful lovely thing but I found nobody had explained how it works onto at first! My gut feeling is that code-server simply reuses the frontend part of Code (e.g. the GUI part from Electron), and port each and every API calls into RPCs and is ultimately processed in a central server then re-signaled to the frontend.

I know I should have had RTFC since the code is right there but it would be better if we can have a much tl;dr feel.

@NGTmeaty
Copy link
Contributor

NGTmeaty commented Mar 16, 2019

Not sure if what @GAILBTC64 said was related but we should get maybe a more technical explainer in the readme.

@kylecarbs
Copy link
Member

@NGTmeaty I agree. We can def make that.

The inner workings are a bit complex. A very small amount of refactoring of the VS Code source had to occur. We did lots of work with webpack fills and overriding of functions to make everything work together. One part that was quite difficult is the single binary. It was very important to us that the installation required absolutely minimal setup.

VS Code has some great architecture that allowed this to happen without ripping everything apart.

@sr229
Copy link
Contributor

sr229 commented Mar 17, 2019

@stevefan1999-personal from what I can deduce, this is what they did:

basically the VSCode source is modified to run specifically for web browsers, seeing VSCode is already a web app itself, this is relatively easy by removing all reliances on Electron. VSCode's backend also runs with RPC (everything is done via Language Server for lang support that has it) which means we only need to serve the frontend via a HTTP Server along with a Websocket to perform requests such as opening files and modifying them, and delegating messages back and forth from Frontend to Backend.

@code-asher
Copy link
Member

This will be more fully addressed in #417.

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

No branches or pull requests

6 participants
@NGTmeaty @kylecarbs @sr229 @stevefan1999-personal @code-asher and others