-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Improve bootstrap logging for help with iframe debugging #4020
Conversation
@@ -43,6 +43,8 @@ export abstract class BaseStore<T> extends Singleton { | |||
protected storeConfig?: Config<T>; | |||
protected syncDisposers: Disposer[] = []; | |||
|
|||
readonly displayName: string = this.constructor.name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember info for class name would be useless/muggled when app is built with webpack's --production=true
&& optimization.minimized = true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I know, which is why for all of our built-in T extends BaseStore
I override this. I would have wanted to make it abstract
but that would have been a breaking change.
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
5a024ca
to
d4c2afe
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
d4c2afe
to
82f95f0
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
82f95f0
to
a0dcf34
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
384c464
to
f1793a2
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
f1793a2
to
d6fb3fa
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
d6fb3fa
to
3da2dfb
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Signed-off-by: Sebastian Malton <sebastian@malton.name>
3da2dfb
to
24d1295
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
@@ -66,13 +72,13 @@ export abstract class BaseStore<T> extends Singleton { | |||
const res: any = this.fromStore(this.storeConfig.store); | |||
|
|||
if (res instanceof Promise || (typeof res === "object" && res && typeof res.then === "function")) { | |||
console.error(`${this.constructor.name} extends BaseStore<T>'s fromStore method returns a Promise or promise-like object. This is an error and must be fixed.`); | |||
console.error(`${this.displayName} extends BaseStore<T>'s fromStore method returns a Promise or promise-like object. This is an error and must be fixed.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errors must go through console?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean instead of logger
? That will be resolved by #4317
logger.info("[App]: Unload app"); | ||
|
||
window.addEventListener("beforeunload", () => { | ||
logger.info(`${RootFrame.logPrefix} Unload app`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.info(`${RootFrame.logPrefix} Unload app`); | |
logger.info(`${RootFrame.logPrefix} Unload root frame`); |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that is necessary given that logPrefix
is already "[ROOT-FRAME]:"
Signed-off-by: Sebastian Malton sebastian@malton.name
This should help with issues like #4018