-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add server #2
Add server #2
Conversation
This is a huge PR but I will review soon! |
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.
Great work @TeffenEllis!
I think the hardest part is knowing what you added compared to what was already there. Feel free to dismiss most things that are not related to things you changed.
Most comments are questions or nits.
I'm not going to approve since I think @code-asher should really be the one to approve since he has the most context on everything VSCode-related in code-server.
Overall though, super thankful you're tackling this and can't wait to be using this instead of the subtree we currently have 🙏
.eslintignore
Outdated
@@ -16,3 +16,4 @@ | |||
**/extensions/markdown-language-features/notebook-out/** | |||
**/extensions/typescript-basics/test/colorize-fixtures/** | |||
**/extensions/**/dist/** | |||
|
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.
❓ Intentional?
@@ -825,10 +825,12 @@ | |||
"target": "**/vs/server/**", | |||
"restrictions": [ | |||
"vs/nls", | |||
"**/vs/code/**/{common,server,browser,node,electron-sandbox,electron-browser}/**", |
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.
❓ Why do we add these two entries in here?
"typescript.format.insertSpaceAfterConstructor": false, | ||
"javascript.format.insertSpaceAfterConstructor": false, | ||
"javascript.format.insertSpaceBeforeFunctionParenthesis": false, | ||
"typescript.format.insertSpaceBeforeFunctionParenthesis": false, | ||
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, | ||
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, |
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.
❓Guessing you didn't add this, but do we know why we do this?
build/gulpfile.reh.js
Outdated
// NOTE@coder: Fix version due to .yarnrc removal. | ||
return process.versions.node; |
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.
❓This seems like a temp fix. Should we open an issue to fix later?
@@ -67,7 +67,7 @@ function fromLocal(extensionPath: string, forWeb: boolean): Stream { | |||
if (isWebPacked) { | |||
input = updateExtensionPackageJSON(input, (data: any) => { | |||
delete data.scripts; | |||
delete data.dependencies; | |||
// https://github.com/cdr/code-server/pull/2041#issuecomment-685910322 |
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.
👏
src/vs/server/protocol.ts
Outdated
// export const createSocketWrapper = (netSocket: net.Socket, { skipWebSocketFrames, permessageDeflate, inflateBytes }: ServerProtocolOptions): ISocket => { | ||
// const nodeSocket = new NodeSocket(netSocket); | ||
// if (skipWebSocketFrames) { | ||
// return nodeSocket; | ||
// } | ||
|
||
// return new WebSocketNodeSocket( | ||
// nodeSocket, | ||
// permessageDeflate || false, | ||
// inflateBytes || null, | ||
// // Always record inflate bytes if using permessage-deflate. | ||
// permessageDeflate || false, | ||
// ); | ||
// }; |
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.
remove?
src/vs/server/protocol.ts
Outdated
// Kick off the handshake in case we missed the client's opening shot. | ||
// TODO: Investigate why that message seems to get lost. |
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.
Add follow-up issue?
$('p', { style: 'margin-bottom: 0; display: flex; align-items: center' }, | ||
$('span', { class: 'codicon codicon-warning', style: 'margin-right: 2px; color: #C4A103' }), | ||
'WARNING'), | ||
$('p', { style: 'margin-top: 0; margin-bottom: 4px' }, | ||
'These extensions are not official. Find additional open-source extensions ', | ||
$('a', { style: `color: ${linkColor}`, href: 'https://open-vsx.org/', target: '_blank' }, 'here'), | ||
'. See ', | ||
$('a', { style: `color: ${linkColor}`, href: 'https://github.com/cdr/code-server/blob/master/docs/FAQ.md#differences-compared-to-vs-code', target: '_blank' }, 'docs'), | ||
'.' |
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.
this looks super janky but is that because it's jQuery? 😂
src/vs/base/common/ipc.d.ts
Outdated
// export interface Args { | ||
// 'user-data-dir'?: string | ||
|
||
// 'enable-proposed-api'?: string[] | ||
// 'extensions-dir'?: string | ||
// 'builtin-extensions-dir'?: string | ||
// 'extra-extensions-dir'?: string[] | ||
// 'extra-builtin-extensions-dir'?: string[] | ||
// 'ignore-last-opened'?: boolean | ||
|
||
// locale?: string | ||
|
||
// log?: string | ||
// verbose?: boolean | ||
|
||
// _: string[] | ||
// } |
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.
remove?
src/vs/base/common/ipc.d.ts
Outdated
export interface OptionsMessage { | ||
id: string | ||
type: 'options' | ||
// options: WorkbenchOptions |
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.
remove?
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.
Nice work fixing the .yarnrc
notes!
Looks really good - I'm getting excited!
src/vs/server/entry.ts
Outdated
@@ -68,17 +44,15 @@ export async function main(args: ServerArgs) { | |||
let query = new URLSearchParams(); | |||
|
|||
if (request.url) { | |||
// TODO use `socket.remoteAddress` |
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.
Not sure if this is our todo or theres? (entry is our file right?)
// TODO use `socket.remoteAddress` | |
// TODO@coder use `socket.remoteAddress` |
src/vs/server/server.ts
Outdated
// import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; | ||
// import { ExtensionService } from 'vs/workbench/services/extensions/browser/extensionService'; |
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.
Should we remove?
dd3adc1
to
a5c23aa
Compare
558335d
to
61f19b7
Compare
Fix issues surrounding IPC interfaces. Update names. Fix spacing. Add missing property. Flesh out web socket cleanup. Flesh out web socket migration. WIP. Fix issues surrounding web socket frames. Touch up. Combine web command with server. Allow JS interop. Fix issues surrounding built in extensions. WIP Fix issues surrounding net socket lifecycle, and frequent restarts. Clean up socket lifecycle. Remove unused socket wrappers. Fix issues where logger is defined before ready. Clean up extension lifecycle.
61f19b7
to
572311e
Compare
Resolved in coder/code-server#4010 |
WIP
This PR cleans up much of our server protocol logic to use upstream’s existing IPC behaviors. Previously, we would translate WebSockets into a child process socket which behaves more consistently with the Electron approach to server communication. However, upstream has since made a more generic protocol interface which connect directly with a WebSocket.
Development usage
Open 4 terminals and run the following commands:
# Client watcher yarn watch-client
# Web extensions watcher yarn watch-web
# Start front-end server yarn web
# Start back-end server node out/cli.js --server localhost:8082 some_file_path
TODO
VSBuffer
and how we parse message payloads