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

fix: allow users to disable the sanity checks #4178

Merged
merged 1 commit into from
Apr 27, 2017

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Apr 20, 2017

Allows users to disable the Material sanity checks, by providing a value for the MATERIAL_SANITY_CHECKS token:

@NgModule({
  providers: [
    {provide: MATERIAL_SANITY_CHECKS, useValue: false}
  ]

  // other config
});

Fixes #4125.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Apr 20, 2017
this._checkDoctype();
this._checkTheme();
hasDoneGlobalChecks = true;
ngZone.runOutsideAngular(() => {
Copy link
Member

Choose a reason for hiding this comment

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

Can we gate on being on the browser platform here rather than in the individual checks as well?
(no reason the timeout has to run on platform-server)

@crisbeto
Copy link
Member Author

Addressed the feedback @jelbourn.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Apr 21, 2017
@kara kara added the presubmit failures This PR has failures in Google's internal presubmit process and cannot be immediately merged label Apr 21, 2017
jelbourn added a commit to jelbourn/components that referenced this pull request Apr 22, 2017
I will move the run-time sanity checks from CompatibilityModule to here
once angular#4178 is merged.
jelbourn added a commit to jelbourn/components that referenced this pull request Apr 22, 2017
I will move the run-time sanity checks from CompatibilityModule to here
once angular#4178 is merged.
jelbourn added a commit to jelbourn/components that referenced this pull request Apr 24, 2017
I will move the run-time sanity checks from CompatibilityModule to here
once angular#4178 is merged.
@jelbourn
Copy link
Member

@kara or @mmalerba what's the source of the presubmit failure?

@jelbourn
Copy link
Member

jelbourn commented Apr 25, 2017

Follow-up: this PR makes ~60 different projects' unit tests start timing out. Strange, since the call is done with runOutsideAngular; not sure why it would affect the tests.

@crisbeto
Copy link
Member Author

crisbeto commented Apr 25, 2017

It might be because a lot of timeouts are still being spawned in the background. We could go down the safer route and allow users to disable the checks, instead of delaying them?

@jelbourn
Copy link
Member

jelbourn commented Apr 25, 2017

@crisbeto yeah, I think so now

Probably via a provided token

@crisbeto crisbeto added pr: needs cleanup / tests and removed pr: lgtm action: merge The PR is ready for merge by the caretaker presubmit failures This PR has failures in Google's internal presubmit process and cannot be immediately merged labels Apr 25, 2017
Allows users to disable the Material sanity checks, by providing a value for the `MATERIAL_SANITY_CHECKS` token:

```ts
@NgModule({
  providers: [
    {provide: MATERIAL_SANITY_CHECKS, useValue: false}
  ]

  // other config
});

```

Fixes angular#4125.
@crisbeto crisbeto changed the title fix: delay on-load sanity checks fix: allow users to disable the sanity checks Apr 26, 2017
@crisbeto
Copy link
Member Author

Re-did this as discussed @jelbourn.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Apr 26, 2017
@mmalerba mmalerba merged commit 16bba72 into angular:master Apr 27, 2017
mmalerba pushed a commit that referenced this pull request Apr 27, 2017
I will move the run-time sanity checks from CompatibilityModule to here
once #4178 is merged.
@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 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
5 participants