Skip to content

Commit

Permalink
Disable checkJS survey (microsoft#29830)
Browse files Browse the repository at this point in the history
* Disable checkJS survey

* Completely remove survey infrastructure

* Re-instate the protocol part of SurveyReady
  • Loading branch information
sandersn authored Feb 11, 2019
1 parent 2dfb620 commit 17d16d1
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 163 deletions.
32 changes: 0 additions & 32 deletions src/server/editorServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace ts.server {
export const ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground";
export const ProjectLoadingStartEvent = "projectLoadingStart";
export const ProjectLoadingFinishEvent = "projectLoadingFinish";
export const SurveyReady = "surveyReady";
export const LargeFileReferencedEvent = "largeFileReferenced";
export const ConfigFileDiagEvent = "configFileDiag";
export const ProjectLanguageServiceStateEvent = "projectLanguageServiceState";
Expand All @@ -30,11 +29,6 @@ namespace ts.server {
data: { project: Project; };
}

export interface SurveyReady {
eventName: typeof SurveyReady;
data: { surveyId: string; };
}

export interface LargeFileReferencedEvent {
eventName: typeof LargeFileReferencedEvent;
data: { file: string; fileSize: number; maxFileSize: number; };
Expand Down Expand Up @@ -146,7 +140,6 @@ namespace ts.server {
}

export type ProjectServiceEvent = LargeFileReferencedEvent |
SurveyReady |
ProjectsUpdatedInBackgroundEvent |
ProjectLoadingStartEvent |
ProjectLoadingFinishEvent |
Expand Down Expand Up @@ -518,9 +511,6 @@ namespace ts.server {
/** Tracks projects that we have already sent telemetry for. */
private readonly seenProjects = createMap<true>();

/** Tracks projects that we have already sent survey events for. */
private readonly seenSurveyProjects = createMap<true>();

/*@internal*/
readonly watchFactory: WatchFactory<WatchType, Project>;

Expand Down Expand Up @@ -722,14 +712,6 @@ namespace ts.server {
this.eventHandler(event);
}

/* @internal */
sendSurveyReadyEvent(surveyId: string) {
if (!this.eventHandler) {
return;
}
this.eventHandler({ eventName: SurveyReady, data: { surveyId } });
}

/* @internal */
sendLargeFileReferencedEvent(file: string, fileSize: number) {
if (!this.eventHandler) {
Expand Down Expand Up @@ -1611,20 +1593,6 @@ namespace ts.server {
return project;
}

/*@internal*/
sendSurveyReady(project: ExternalProject | ConfiguredProject): void {
if (this.seenSurveyProjects.has(project.projectName)) {
return;
}

if (project.getCompilerOptions().checkJs !== undefined) {
const name = "checkJs";
this.logger.info(`Survey ${name} is ready`);
this.sendSurveyReadyEvent(name);
this.seenSurveyProjects.set(project.projectName, true);
}
}

/*@internal*/
sendProjectTelemetry(project: ExternalProject | ConfiguredProject): void {
if (this.seenProjects.has(project.projectName)) {
Expand Down
2 changes: 0 additions & 2 deletions src/server/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,6 @@ namespace ts.server {
}
this.projectService.sendProjectLoadingFinishEvent(this);
this.projectService.sendProjectTelemetry(this);
this.projectService.sendSurveyReady(this);
return result;
}

Expand Down Expand Up @@ -1627,7 +1626,6 @@ namespace ts.server {
updateGraph() {
const result = super.updateGraph();
this.projectService.sendProjectTelemetry(this);
this.projectService.sendSurveyReady(this);
return result;
}

Expand Down
4 changes: 0 additions & 4 deletions src/server/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,10 +610,6 @@ namespace ts.server {
diagnostics: bakedDiags
}, ConfigFileDiagEvent);
break;
case SurveyReady:
const { surveyId } = event.data;
this.event<protocol.SurveyReadyEventBody>({ surveyId }, SurveyReady);
break;
case ProjectLanguageServiceStateEvent: {
const eventName: protocol.ProjectLanguageServiceStateEventName = ProjectLanguageServiceStateEvent;
this.event<protocol.ProjectLanguageServiceStateEventBody>({
Expand Down
1 change: 0 additions & 1 deletion src/testRunner/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
"unittests/tsserver/events/projectLanguageServiceState.ts",
"unittests/tsserver/events/projectLoading.ts",
"unittests/tsserver/events/projectUpdatedInBackground.ts",
"unittests/tsserver/events/surveyReady.ts",
"unittests/tsserver/externalProjects.ts",
"unittests/tsserver/forceConsistentCasingInFileNames.ts",
"unittests/tsserver/formatSettings.ts",
Expand Down
111 changes: 0 additions & 111 deletions src/testRunner/unittests/tsserver/events/surveyReady.ts

This file was deleted.

11 changes: 1 addition & 10 deletions tests/baselines/reference/api/tsserverlibrary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8357,7 +8357,6 @@ declare namespace ts.server {
const ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground";
const ProjectLoadingStartEvent = "projectLoadingStart";
const ProjectLoadingFinishEvent = "projectLoadingFinish";
const SurveyReady = "surveyReady";
const LargeFileReferencedEvent = "largeFileReferenced";
const ConfigFileDiagEvent = "configFileDiag";
const ProjectLanguageServiceStateEvent = "projectLanguageServiceState";
Expand All @@ -8382,12 +8381,6 @@ declare namespace ts.server {
project: Project;
};
}
interface SurveyReady {
eventName: typeof SurveyReady;
data: {
surveyId: string;
};
}
interface LargeFileReferencedEvent {
eventName: typeof LargeFileReferencedEvent;
data: {
Expand Down Expand Up @@ -8472,7 +8465,7 @@ declare namespace ts.server {
interface OpenFileInfo {
readonly checkJs: boolean;
}
type ProjectServiceEvent = LargeFileReferencedEvent | SurveyReady | ProjectsUpdatedInBackgroundEvent | ProjectLoadingStartEvent | ProjectLoadingFinishEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent | ProjectInfoTelemetryEvent | OpenFileInfoTelemetryEvent;
type ProjectServiceEvent = LargeFileReferencedEvent | ProjectsUpdatedInBackgroundEvent | ProjectLoadingStartEvent | ProjectLoadingFinishEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent | ProjectInfoTelemetryEvent | OpenFileInfoTelemetryEvent;
type ProjectServiceEventHandler = (event: ProjectServiceEvent) => void;
interface SafeList {
[name: string]: {
Expand Down Expand Up @@ -8589,8 +8582,6 @@ declare namespace ts.server {
readonly syntaxOnly?: boolean;
/** Tracks projects that we have already sent telemetry for. */
private readonly seenProjects;
/** Tracks projects that we have already sent survey events for. */
private readonly seenSurveyProjects;
constructor(opts: ProjectServiceOptions);
toPath(fileName: string): Path;
private loadTypesMap;
Expand Down
Submodule TypeScript-Node-Starter updated 49 files
+11 −2 .env.example
+7 −1 .gitignore
+1 −0 .vscode/extensions.json
+3 −15 .vscode/launch.json
+8 −2 .vscode/settings.json
+190 −75 README.md
+0 −5 copyStaticAssets.js
+5 −0 copyStaticAssets.ts
+18 −0 jest.config.js
+1,722 −1,346 package-lock.json
+51 −59 package.json
+22 −19 src/app.ts
+5 −5 src/config/passport.ts
+3 −3 src/controllers/api.ts
+1 −1 src/controllers/contact.ts
+6 −6 src/controllers/user.ts
+9 −6 src/models/User.ts
+1 −1 src/public/css/lib/bootstrap/_button-groups.scss
+1 −1 src/public/css/lib/bootstrap/_forms.scss
+1 −1 src/public/css/lib/bootstrap/_input-groups.scss
+1 −1 src/public/css/lib/bootstrap/_panels.scss
+1 −1 src/public/css/lib/bootstrap/_scaffolding.scss
+2 −2 src/public/css/lib/bootstrap/_theme.scss
+1 −1 src/public/css/lib/bootstrap/_variables.scss
+2 −2 src/public/css/lib/bootstrap/bootstrap.scss
+3 −3 src/public/css/lib/bootstrap/mixins/_tab-focus.scss
+ src/public/fonts/glyphicons-halflings-regular.eot
+288 −0 src/public/fonts/glyphicons-halflings-regular.svg
+ src/public/fonts/glyphicons-halflings-regular.ttf
+ src/public/fonts/glyphicons-halflings-regular.woff
+ src/public/fonts/glyphicons-halflings-regular.woff2
+4 −4 src/public/js/lib/jquery-3.1.1.min.js
+8 −4 src/server.ts
+0 −2 src/types/lusca.d.ts
+0 −48 src/types/passport-local.d.ts
+17 −0 src/util/logger.ts
+26 −0 src/util/secrets.ts
+2 −2 test/api.test.ts
+2 −2 test/app.test.ts
+20 −2 test/contact.test.ts
+2 −2 test/home.test.ts
+20 −2 test/user.test.ts
+1 −0 tsconfig.json
+1 −1 views/account/profile.pug
+1 −1 views/api/facebook.pug
+1 −1 views/api/index.pug
+8 −9 views/layout.pug
+2 −3 views/partials/footer.pug
+2 −2 views/partials/header.pug
2 changes: 1 addition & 1 deletion tests/cases/user/prettier/prettier
Submodule prettier updated 1906 files
2 changes: 1 addition & 1 deletion tests/cases/user/webpack/webpack
Submodule webpack updated 1279 files

0 comments on commit 17d16d1

Please sign in to comment.