Skip to content

Update VS Code to 1.50.0 #2204

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

Merged
merged 6 commits into from
Oct 21, 2020
Merged

Update VS Code to 1.50.0 #2204

merged 6 commits into from
Oct 21, 2020

Conversation

code-asher
Copy link
Member

Planning on making a 3.6.1 release with this.

@code-asher code-asher requested a review from nhooyr as a code owner October 14, 2020 22:09
- The .js build files are no longer committed so they're gone.
- ParsedArgs and EnvironmentService are now NativeParsedArgs and
  NativeEnvironmentService.
- Interface for environment service was moved.
- getPathFromAmdModule was deprecated.
It's a new module used by 1.50.0.
It needs to have the scheme otherwise when resolving these modules the
loader will default to the file scheme and fail to fetch.
This matches with the html in the VS Code repo and also fixes a problem
with the worker which loads HTML using data: and then can't load any
scripts because 'self' doesn't work.
This makes the fetch work independently of the worker's origin which is
no longer the same as the main thread (the main problem is the inability
to send cookies without setting SameSite to None).
@code-asher code-asher force-pushed the vscode-1.50.0 branch 3 times, most recently from 70292c4 to c27f2d8 Compare October 14, 2020 22:26
@code-asher code-asher changed the base branch from v3.6.0 to master October 14, 2020 22:27
@code-asher code-asher mentioned this pull request Oct 14, 2020
@code-asher code-asher changed the title Update VS Code 1.50.0 Update VS Code to 1.50.0 Oct 14, 2020
Removing them just for peace of mind even though they seem to get
filtered out later. This line is meant to only add remote extensions
that aren't capable of running in the browser. If they are
browser-capable they don't need to run in our shimmed Node environment.
input = updateExtensionPackageJSON(input, (data) => {
delete data.scripts;
- delete data.dependencies;
+ // https://github.com/cdr/code-server/pull/2041#issuecomment-685910322
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was an accidental removal.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless the file is gone?

Copy link
Member Author

@code-asher code-asher Oct 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, for all of these .js build files, they're no longer committed.

Check out the comment on e3699cf for a bit more info.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to move the patches into the .ts files then right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, they're already there. They don't show up in the diff though since we already had 'em.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohhh, nice!

}
exports.streamToPromise = streamToPromise;
function getElectronVersion() {
+ return process.versions.node;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this intended as well?

-const yarnrcPath = path.join(root, 'remote', '.yarnrc');
-const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
-const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)[1];
+const version = process.versions.node;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this removal intended?

--- a/src/vs/platform/product/common/product.ts
+++ b/src/vs/platform/product/common/product.ts
@@ -30,6 +30,12 @@ if (isWeb) {
@@ -37,6 +37,12 @@ if (isWeb || typeof require === 'undefined' || typeof require.__$__nodeRequire !
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this change required?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just the context of the patch, so VS Code made this change. This patch is seriously too hard to diff.

@@ -1049,6 +1024,21 @@ index 0000000000000000000000000000000000000000..0d2e93edae2baf34d27b7b52be0bf496
+ }
+ }
+
+ async $fetchExtension(extensionUri: UriComponents): Promise<VSBuffer> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have to implement this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a comment on f20f7ac but the gist is that the worker is now in a separate origin so it can't fetch the extension (cross origin domain issues) and even if you resolve that by setting the appropriate headers it still doesn't work because it doesn't send the cookie. So instead I have it asking the main thread to fetch the extension. Since this mechanism already exists for the extension to communicate with the main thread (for example to make file read calls) I figured it was a decent solution.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should comment this in the code and not just in the commit.

Copy link
Contributor

@nhooyr nhooyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now other than the patch removals of the build files. We need to apply the same patch to the .ts files now.

@code-asher code-asher merged commit 14287df into master Oct 21, 2020
@code-asher code-asher deleted the vscode-1.50.0 branch October 21, 2020 19:14
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