-
Notifications
You must be signed in to change notification settings - Fork 937
Migrates Listeners Registration from getMessaging
to Messaging's Factory Methods 🏭
#4918
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
|
messaging-compat
getMessaging
to Messaging's Factory Methods 🏭
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.
In @firebase/messaging-compat
, we need to check the environment, and get the correct provider (messaging-exp
or messaging-sw-exp
) depending on the environment.
right. Good catch! |
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.
Sorry! requesting one more change:
let's remove onBackgroundMessage()
from the main entry point https://github.com/firebase/firebase-js-sdk/blob/master/packages-exp/messaging-exp/src/index.ts#L34,
and remove the @internal
annotation here - https://github.com/firebase/firebase-js-sdk/blob/master/packages-exp/messaging-exp/src/api.ts#L176
messaging-compat
is a compatibility layer that bridges the v8 and v9(modular) JS API. It's created through wrapping the v9 SDK to recreate the v8 API surface. The objective is to allow developer to gradually migrate to v9 without having to migrate the entire codebase.Now the v9 SDK registers its listeners (
onPush
,onSubChange
,onMessage
) ingetMessagingInWindow
andgetMessagaingInSw
which is not called in themessaging-compat
. Without these listeners, the compat SDK can onlygetToken
and not get callbacks inonMessage
andonBackgroundMessage
messaging-compat
.messaging-compat
asmessaging-exp
andmessaging-sw-exp
b/188418727 for tracking