Skip to content
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

webpack #996

Merged
merged 7 commits into from
Jan 17, 2019
Merged

webpack #996

merged 7 commits into from
Jan 17, 2019

Conversation

StephenWeatherford
Copy link
Contributor

@StephenWeatherford StephenWeatherford commented Jan 15, 2019

NOTES:

  1. Might be more speed-up to be obtained here by reducing contents of externalNodeModules (update: cold start: 3.5s, warm start: 300ms, installation time somewhat longer than Docker, but all good enough)
  2. Might change the way we're dealing with resources in vscode-azureextensionui, but this does work and I thought it might be similar to what we'd do for third party code. That remains to be seen.
  3. Intend to move some of the webpack.config.js code to our shared dev package

@StephenWeatherford StephenWeatherford requested a review from a team as a code owner January 15, 2019 01:30
return await extension.activateInternal(ctx, perfStats);
}

exports.activate = activate;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see this being imported anywhere. Are these used by AzureTools?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Added comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mean, used by vscode

// Export for use by vscode
exports.activate = activate;
exports.deactivate = deactivate;

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, sounds good.

Copy link
Contributor

@ejizba ejizba left a comment

Choose a reason for hiding this comment

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

Was having problems hitting a breakpoint - but will discuss offline.

I did some spot testing and couldn't seem to attach an account... but I couldn't debug so idk why :) I figure we could handle that in a separate PR so still approving.

*.vsix
.vscode-test
test-results.xml
dist
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: all but these last two are already in the gitignore

@@ -12,3 +12,17 @@ tslint.json
.github/**
test-results.xml
.azure-pipelines/**
node_modules/**
out/**
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah a lot of these are duplicates. Here's the alphabetized, de-duped list for the entire file:

.azure-pipelines/**
.github/**
.gitignore
.travis.yml
.vscode-test/**
.vscode/**
*.tgz
**/*.map
build
dist/test/**
grammar
gulp*
node_modules/**
out/**
package-lock.json
src/**
stats.json
test-results.xml
test/**
testOutput/**
tsconfig.json
tslint.json
webpack.config*

(I tried out this extension to help: https://marketplace.visualstudio.com/items?itemName=Tyriar.sort-lines)

extension.ts Outdated
export { getAllCommandsFromText, getCommandFromTextAtLocation } from './src/mongo/MongoScrapbook';
export { rejectOnTimeout, valueOnTimeout } from './src/utils/timeout';

// These use instanceof and therefore we need to make sure we're using the same version of the bson module in the tests as in the bundle,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this only apply to test code? If not, it makes me kinda nervous. What exactly is the problem with instanceof? I guess I'd rather find a fix for instanceof than single out every single use of it we run in to.

Is this at all related to the thing you did here? microsoft/vscode-docker#745 Either way don't forget to do that here :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, tests only (updated comment). The issue is that the test code is completely separate from the extension bundle, so if we do a blind import from the tests, you get two different instances of the module and hence two difference classes with different identity. That's also why we're importing everything from extension.ts instead of importing individual files directly from the tests like we used to, because you'd end up with two different instances of the code (and hence extensionVariables isn't a singleton, etc.).

extension.js is separate from the test code and uses an internal webpack version of import, so it doesn't know about anything imported by code outside of it (something I wish we could change - I tried).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this at all related to the thing you did here? microsoft/vscode-docker#745 Either way don't forget to do that here :)

No. The other fix will be in the shared version.

@@ -126,9 +126,9 @@
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you run another update on this file? I still see some changes when I run npm install on my machine. (typescript changed from 2.9.2 to 3.2.2)

@@ -17,6 +18,7 @@ export namespace ext {
export let context: ExtensionContext;
export let outputChannel: OutputChannel;
export let reporter: ITelemetryReporter;
export let resourcesPath = path.join(__dirname, 'resources');
Copy link
Contributor

Choose a reason for hiding this comment

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

You have resourcesPath in both constants and extensionVariables. Do we need both? Seems kinda confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed from extvars

@StephenWeatherford StephenWeatherford merged commit 0797fa0 into master Jan 17, 2019
@StephenWeatherford StephenWeatherford deleted the saw/webpack2 branch January 17, 2019 01:06
@github-actions github-actions bot locked and limited conversation to collaborators Apr 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants