-
Notifications
You must be signed in to change notification settings - Fork 948
Syntax fixes in 'app' packages #4409
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
Conversation
|
Binary Size ReportAffected SDKs
Test Logs
|
Size Analysis ReportAffected Products
|
packages-exp/app-exp/src/api.ts
Outdated
@@ -285,7 +285,8 @@ export function onLog( | |||
): void { | |||
if (logCallback !== null && typeof logCallback !== 'function') { | |||
throw ERROR_FACTORY.create(AppError.INVALID_LOG_ARGUMENT, { | |||
appName: name | |||
// appName isn't used in INVALID_LOG_ARGUMENT error but ErrorFactory requires it | |||
appName: '' |
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.
The correct fix should be change type ErrorParams
in errors.ts
to
type ErrorParams = {
[AppError.NO_APP]: { appName: string },
[AppError.BAD_APP_NAME]: { appName: string },
[AppError.DUPLICATE_APP]: { appName: string },
[AppError.APP_DELETED]: { appName: string },
[AppError.INVALID_APP_ARGUMENT]: { appName: string }
};
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.
Done.
Fix some things that will cause errors if upgrading to Typescript 4.1.+ (the upgrade isn't being done in this PR, other packages need to be fixed as well).
I think referencing
name
when it hadn't been passed in didn't show up as an error before because it's also a global variable?