Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(common): provide an ability to exclude origins from preconnect c…
…hecks in NgOptimizedImage (#47082) This commit adds an extra logic to add an ability to exclude origins from preconnect checks in NgOptimizedImage by configuring the `PRECONNECT_CHECK_BLOCKLIST` multi-provider. PR Close #47082
- Loading branch information
1 parent
7baf9a4
commit 586274f
Showing
14 changed files
with
260 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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
25 changes: 25 additions & 0 deletions
25
packages/common/src/directives/ng_optimized_image/asserts.ts
This file contains 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,25 @@ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
import {ɵRuntimeError as RuntimeError} from '@angular/core'; | ||
|
||
import {RuntimeErrorCode} from '../../errors'; | ||
|
||
/** | ||
* Asserts whether an ngDevMode is enabled and throws an error if it's not the case. | ||
* This assert can be used to make sure that there is no dev-mode code invoked in | ||
* the prod mode accidentally. | ||
*/ | ||
export function assertDevMode(check: string) { | ||
if (!ngDevMode) { | ||
throw new RuntimeError( | ||
RuntimeErrorCode.UNEXPECTED_DEV_MODE_CHECK_IN_PROD_MODE, | ||
`Unexpected invocation of the ${check} in the prod mode. ` + | ||
`Please make sure that the prod mode is enabled for production builds.`); | ||
} | ||
} |
This file contains 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 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 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 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 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 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
Oops, something went wrong.