[Feature Request] add 'disableWarnings' option to emulators
See original GitHub issueVersion info
Angular: 11.0.5
Firebase: 8.0
AngularFire: 6.1.4
Other (e.g. Ionic/Cordova, Node, browser, operating system):
Description
When using the emulators tokens (https://github.com/angular/angularfire/blob/master/docs/emulators/emulators.md), it uses the useEmulator(url)
firebase-js-jdk function under the hood.
But it miss the disableWarnings option is stated here : https://github.com/firebase/firebase-js-sdk/blob/master/packages/auth/src/auth.js
/**
* Sets the emulator configuration (go/firebase-emulator-connection-api).
* @param {string} url The url for the Auth emulator.
* @param {?Object=} options Optional options to specify emulator settings.
*/
fireauth.Auth.prototype.useEmulator = function(url, options) {
// Emulator config can only be set once.
if (!this.emulatorConfig_) {
if (!/^https?:\/\//.test(url)) {
throw new fireauth.AuthError(
fireauth.authenum.Error.ARGUMENT_ERROR,
'Emulator URL must start with a valid scheme (http:// or https://).');
}
// Emit a warning so dev knows we are now in test mode.
const disableBanner = options ? !!options['disableWarnings'] : false;
this.emitEmulatorWarning_(disableBanner);
// Persist the config.
this.emulatorConfig_ = { url };
// Disable app verification.
this.settings_().setAppVerificationDisabledForTesting(true);
// Update RPC handler endpoints.
this.rpcHandler_.updateEmulatorConfig(this.emulatorConfig_);
// Notify external event listeners.
this.notifyEmulatorConfigListeners_();
}
}
This option allows to hide the bottom banner :
How to reproduce these conditions
Steps to set up and reproduce
- create an angular project with
ng new myProject
- install firebase tools with
npm install -g firebase-tools
- run
firebase init
to initialize a firebase project with at least one feature - run
firebase init
and choose ‘emulators’ to setup the emulators for the previous chosen features - add the angular-fire tokens to the providers array of the AppModule
- run
ng serve
The banner should be visible.
Expected behavior
The token should be improved by adding the disableWarnings option
Actual behavior
The banner is always visible and can hide content.
Proposal
I can create a PR if you approve this change (it’ll be applied to each token).
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Warning Options (Using the GNU Compiler Collection (GCC))
When an unrecognized warning option is requested (e.g., -Wunknown-warning ), GCC emits a diagnostic stating that the option is not recognized.
Read more >How do you hide the warnings in React Native iOS simulator?
According to React Native Documentation, you can hide warning messages by setting disableYellowBox to true like this: console.disableYellowBox = true; ...
Read more >IBM i Access - ACS Getting Started
Features of IBM i Access Client Solutions include: a full featured 5250 display emulator based on IBM Rational Host-on-Demand. In addition to all...
Read more >Connect your app to the Authentication Emulator - Firebase
The Authentication emulator provides high-fidelity local emulation of Firebase Authentication services, providing much of the functionality found in ...
Read more >Steam Deck Emulation (EmuDeck 2.0) Guide - YouTube
Valve's Steam Deck is the perfect storm of handhelds: it has an exceptional price-to-performance ratio, a large game library thanks to its ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@geromegrignon What kind of validation you’re waiting for ?
The way I see it, to solve this issue one should:
[string, number, { disableWarnings: boolean }]
@lbar i’m waiting for validation before submitting a PR. Meanwhile you can hide the banner with css :