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

Stop karma gracefully, test watch mode, and check syntactic diagnostics on rebuilds #12824

Merged
merged 5 commits into from Nov 1, 2018

Conversation

filipesilva
Copy link
Contributor

@filipesilva filipesilva commented Oct 31, 2018

@filipesilva filipesilva added the target: major This PR is targeted for the next major release label Oct 31, 2018
// calls `disconnectBrowsers(code);`
// karmaServer.close();
// Karma only has the `stop` method start with 3.1.1, so we must defensively check.
if (karmaServer.stop && typeof karmaServer.stop === 'function') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

But isn’t karma 3.1.1 are direct dependency of build-angular? So what case should karmaServer.stop doesn’t exist? Apart from if someone has yarn resolutions.

Small note this feature was added in Karma 3.1.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Karma is actually not a direct dependency of build-angular. It's a dependency of the project instead, like typescript, protractor and tslint.

@@ -9,6 +9,11 @@ import { Diagnostic, Diagnostics, Program } from '@angular/compiler-cli';
import * as ts from 'typescript';
import { time, timeEnd } from './benchmark';

export const enum DiagnosticMode {
All,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is const needed? Also, you could use flags so it's possible to make combinations. Unless this is meant to be used as an internal only API, which it doens't look like.

Something like:

export enum DiagnosticMode {
  Syntactic = 1 << 0,
  Semantic = 1 << 1,

  All = Syntactic | Semantic,
  Default = All,
}

What do you think?

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 think that's much better really. Updated, thank you!

@@ -52,34 +58,44 @@ export function gatherDiagnostics(
}
}

const gatherSyntacticDiagnostics = mode == DiagnosticMode.All || mode == DiagnosticMode.Syntactic;
Copy link
Contributor

Choose a reason for hiding this comment

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

With the above you can just use mode & DiagnosticMode.Syntactic != 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to (mode & DiagnosticMode.Syntactic) != 0 because != seems to have precedence over &.

Copy link
Contributor

Choose a reason for hiding this comment

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

JavaScript!

@ngbot
Copy link

ngbot bot commented Nov 1, 2018

Hi @filipesilva! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

@filipesilva filipesilva force-pushed the karma-stop branch 2 times, most recently from 770aa23 to e35fd39 Compare November 1, 2018 09:59
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants