forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Enable live share support #4645
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
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
299f623
Test infrastructure for liveshare
rchiodo 2e0a5c5
Simplest host test passing
rchiodo 41b7df7
Get host and guest test working
rchiodo 05e06f1
Add test for restart
rchiodo ad1f40b
Fix jupyter server and execution to be up and running after connect
rchiodo ed7face
All tests passing
rchiodo fcb0d73
Add color tests. Try to fix liveshare on release bits
rchiodo 5353f0c
Fix webpacking of the liveshare extension.
rchiodo 9d19e62
Merge from master
rchiodo 3c20567
Fix hygiene
rchiodo 34ca172
Turn on the live share feature
rchiodo 93477f4
Add news entries
rchiodo 8ea5ec4
Fix failing unit test
rchiodo fe43687
Fix release mode, some code review feedback, and handle
rchiodo 25cd33e
Merge from master
rchiodo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,50 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
| 'use strict'; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const glob = require("glob"); | ||
| const path = require("path"); | ||
| const webpack_bundle_analyzer_1 = require("webpack-bundle-analyzer"); | ||
| const constants_1 = require("../constants"); | ||
| exports.nodeModulesToExternalize = [ | ||
| 'unicode/category/Lu', | ||
| 'unicode/category/Ll', | ||
| 'unicode/category/Lt', | ||
| 'unicode/category/Lo', | ||
| 'unicode/category/Lm', | ||
| 'unicode/category/Nl', | ||
| 'unicode/category/Mn', | ||
| 'unicode/category/Mc', | ||
| 'unicode/category/Nd', | ||
| 'unicode/category/Pc', | ||
| '@jupyterlab/services', | ||
| 'azure-storage', | ||
| 'request', | ||
| 'request-progress', | ||
| 'source-map-support', | ||
| 'diff-match-patch', | ||
| 'sudo-prompt', | ||
| 'node-stream-zip', | ||
| 'xml2js', | ||
| 'vsls/vscode' | ||
| ]; | ||
| function getDefaultPlugins(name) { | ||
| const plugins = []; | ||
| if (!constants_1.isCI) { | ||
| plugins.push(new webpack_bundle_analyzer_1.BundleAnalyzerPlugin({ | ||
| analyzerMode: 'static', | ||
| reportFilename: `${name}.analyzer.html` | ||
| })); | ||
| } | ||
| return plugins; | ||
| } | ||
| exports.getDefaultPlugins = getDefaultPlugins; | ||
| function getListOfExistingModulesInOutDir() { | ||
| const outDir = path.join(constants_1.ExtensionRootDir, 'out', 'client'); | ||
| const files = glob.sync('**/*.js', { sync: true, cwd: outDir }); | ||
| return files.map(filePath => `./${filePath.slice(0, -3)}`); | ||
| } | ||
| exports.getListOfExistingModulesInOutDir = getListOfExistingModulesInOutDir; | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
| 'use strict'; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const glob = require("glob"); | ||
| const path = require("path"); | ||
| const webpack_bundle_analyzer_1 = require("webpack-bundle-analyzer"); | ||
| const constants_1 = require("../constants"); | ||
| exports.nodeModulesToExternalize = [ | ||
| 'unicode/category/Lu', | ||
| 'unicode/category/Ll', | ||
| 'unicode/category/Lt', | ||
| 'unicode/category/Lo', | ||
| 'unicode/category/Lm', | ||
| 'unicode/category/Nl', | ||
| 'unicode/category/Mn', | ||
| 'unicode/category/Mc', | ||
| 'unicode/category/Nd', | ||
| 'unicode/category/Pc', | ||
| '@jupyterlab/services', | ||
| 'azure-storage', | ||
| 'request', | ||
| 'request-progress', | ||
| 'source-map-support', | ||
| 'diff-match-patch', | ||
| 'sudo-prompt', | ||
| 'node-stream-zip', | ||
| 'xml2js', | ||
| 'vsls/vscode', | ||
| ]; | ||
| exports.nodeModulesToReplacePaths = [ | ||
| ...exports.nodeModulesToExternalize | ||
| ]; | ||
| function getDefaultPlugins(name) { | ||
| const plugins = []; | ||
| if (!constants_1.isCI) { | ||
| plugins.push(new webpack_bundle_analyzer_1.BundleAnalyzerPlugin({ | ||
| analyzerMode: 'static', | ||
| reportFilename: `${name}.analyzer.html` | ||
| })); | ||
| } | ||
| return plugins; | ||
| } | ||
| exports.getDefaultPlugins = getDefaultPlugins; | ||
| function getListOfExistingModulesInOutDir() { | ||
| const outDir = path.join(constants_1.ExtensionRootDir, 'out', 'client'); | ||
| const files = glob.sync('**/*.js', { sync: true, cwd: outDir }); | ||
| return files.map(filePath => `./${filePath.slice(0, -3)}`); | ||
| } | ||
| exports.getListOfExistingModulesInOutDir = getListOfExistingModulesInOutDir; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,21 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
| 'use strict'; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const common_1 = require("../common"); | ||
| function replaceModule(contents, moduleName, quotes) { | ||
| const stringToSearch = `${quotes}${moduleName}${quotes}`; | ||
| const stringToReplaceWith = `${quotes}./node_modules/${moduleName}${quotes}`; | ||
| return contents.replace(new RegExp(stringToSearch, 'gm'), stringToReplaceWith); | ||
| } | ||
| // tslint:disable:no-default-export no-invalid-this | ||
| function default_1(source) { | ||
| common_1.nodeModulesToExternalize.forEach(moduleName => { | ||
| if (source.indexOf(moduleName) > 0) { | ||
| source = replaceModule(source, moduleName, '"'); | ||
| source = replaceModule(source, moduleName, '\''); | ||
| } | ||
| }); | ||
| return source; | ||
| } | ||
| exports.default = default_1; | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
| 'use strict'; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const common_1 = require("../common"); | ||
| function replaceModule(contents, moduleName, quotes) { | ||
| const stringToSearch = `${quotes}${moduleName}${quotes}`; | ||
| const stringToReplaceWith = `${quotes}./node_modules/${moduleName}${quotes}`; | ||
| return contents.replace(new RegExp(stringToSearch, 'gm'), stringToReplaceWith); | ||
| } | ||
| // tslint:disable:no-default-export no-invalid-this | ||
| function default_1(source) { | ||
| common_1.nodeModulesToReplacePaths.forEach(moduleName => { | ||
| if (source.indexOf(moduleName) > 0) { | ||
| source = replaceModule(source, moduleName, '"'); | ||
| source = replaceModule(source, moduleName, '\''); | ||
| } | ||
| }); | ||
| return source; | ||
| } | ||
| exports.default = default_1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,51 +1,57 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
| 'use strict'; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const path = require("path"); | ||
| const constants_1 = require("../constants"); | ||
| const common_1 = require("./common"); | ||
| const entryItems = {}; | ||
| common_1.nodeModulesToExternalize.forEach(moduleName => { | ||
| entryItems[`node_modules/${moduleName}`] = `./node_modules/${moduleName}`; | ||
| }); | ||
| const config = { | ||
| mode: 'production', | ||
| target: 'node', | ||
| entry: entryItems, | ||
| devtool: 'source-map', | ||
| node: { | ||
| __dirname: false | ||
| }, | ||
| module: { | ||
| rules: [ | ||
| { | ||
| // JupyterServices imports node-fetch using `eval`. | ||
| test: /@jupyterlab[\\\/]services[\\\/].*js$/, | ||
| use: [ | ||
| { | ||
| loader: path.join(__dirname, 'loaders', 'fixEvalRequire.js') | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| externals: [ | ||
| 'vscode', | ||
| 'commonjs' | ||
| ], | ||
| plugins: [ | ||
| ...common_1.getDefaultPlugins('dependencies') | ||
| ], | ||
| resolve: { | ||
| extensions: ['.js'] | ||
| }, | ||
| output: { | ||
| filename: '[name].js', | ||
| path: path.resolve(constants_1.ExtensionRootDir, 'out', 'client'), | ||
| libraryTarget: 'commonjs2', | ||
| devtoolModuleFilenameTemplate: '../../[resource-path]' | ||
| } | ||
| }; | ||
| // tslint:disable-next-line:no-default-export | ||
| exports.default = config; | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
| 'use strict'; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const path = require("path"); | ||
| const constants_1 = require("../constants"); | ||
| const common_1 = require("./common"); | ||
| const copyWebpackPlugin = require("copy-webpack-plugin"); | ||
| const entryItems = {}; | ||
| common_1.nodeModulesToExternalize.forEach(moduleName => { | ||
| entryItems[`node_modules/${moduleName}`] = `./node_modules/${moduleName}`; | ||
| }); | ||
| const config = { | ||
| mode: 'production', | ||
| target: 'node', | ||
| entry: entryItems, | ||
| devtool: 'source-map', | ||
| node: { | ||
| __dirname: false | ||
| }, | ||
| module: { | ||
| rules: [ | ||
| { | ||
| // JupyterServices imports node-fetch using `eval`. | ||
| test: /@jupyterlab[\\\/]services[\\\/].*js$/, | ||
| use: [ | ||
| { | ||
| loader: path.join(__dirname, 'loaders', 'fixEvalRequire.js') | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| externals: [ | ||
| 'vscode', | ||
| 'commonjs' | ||
| ], | ||
| plugins: [ | ||
| ...common_1.getDefaultPlugins('dependencies'), | ||
| // vsls requires our package.json to be next to node_modules. It's how they | ||
| // 'find' the calling extension. | ||
| new copyWebpackPlugin([ | ||
| { from: './package.json', to: '.' } | ||
| ]) | ||
| ], | ||
| resolve: { | ||
| extensions: ['.js'] | ||
| }, | ||
| output: { | ||
| filename: '[name].js', | ||
| path: path.resolve(constants_1.ExtensionRootDir, 'out', 'client'), | ||
| libraryTarget: 'commonjs2', | ||
| devtoolModuleFilenameTemplate: '../../[resource-path]' | ||
| } | ||
| }; | ||
| // tslint:disable-next-line:no-default-export | ||
| exports.default = config; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add tests for live share support. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fix running liveshare support in a release build. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Code flow is not showing a change in this file. What changed? #ByDesign
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.
Yeah there's a bunch like this. Or there's about to be. I think it's just line endings. Git will skip these on the real commit.
In reply to: 262688394 [](ancestors = 262688394)
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.
Sorry the 'about to be' is me ingesting a new liveshare npm module. They broke our install again with a requirement we don't minify their js.
In reply to: 262689934 [](ancestors = 262689934,262688394)
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.
And that means I have to rework the 'fix' for release mode again.
In reply to: 262690183 [](ancestors = 262690183,262689934,262688394)