-
Notifications
You must be signed in to change notification settings - Fork 930
Create experiment modularized FM SDK #3822
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 |
This comment has been minimized.
This comment has been minimized.
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 API layer looks good, but we didn't really modularize the SDK as we still implements the methods on the controller.
We need to move these methods to free floating functions in order to make them tree shakeable. I also think we should have a separate entry point for service worker, so we don't force people to include the service worker code in their client code.
Changeset File Check
|
FYI to avoid that changeset error you will want to add |
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.
Overall it looks great! Left a few comments and I'd like to do a size analysis on the new APIs to see how treeshaking works once PR is merged.
"dependencies": { | ||
"@firebase/component": "0.1.19", | ||
"@firebase/installations-exp": "0.x", | ||
"@firebase/messaging-types-exp": "0.0.800", |
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.
"@firebase/messaging-types-exp": "0.0.800", | |
"@firebase/messaging-types-exp": "0.0.900", |
packages-exp/messaging-exp/src/interfaces/internal-dependencies.ts
Outdated
Show resolved
Hide resolved
@zwu52 ping |
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 see a couple of unaddressed comments by Fei (or maybe I am looking at Github UI wrong). In addition to that I added one or two comments.
Also, you don't have to create a changeset for exp, but in order to stop the changeset tool from erroring when we run releases, you have to add the package to the ignore field in the changeset config: see comment #3822 (comment) and the error above it.
import { Observer } from '@firebase/util'; | ||
import { Unsubscribe } from '@firebase/util'; | ||
|
||
// @public (undocumented) |
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.
Maybe you are planning to do this in another PR but to get documentation, the JSdoc comments need to be added in src/api.ts
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.
Looks great. I think we are almost ready. We need to create a release build for publishing to npm. You can take a look at https://github.com/firebase/firebase-js-sdk/blob/master/packages-exp/functions-exp/rollup.config.release.js. What it does is remove -exp
s in the code, so the package is published as @firebase/messaging
instead of @firebase/messaging-exp
(it will be published under a special tag, so it won't interfere with the normal release).
We also need to add messaging to firebase-exp
, so people can import from firebase/messaging
.
In addition to that, we need to build 2 CDN scripts for messaging in firebase-exp
, one for the client script, one for the service worker script. We can do it in a separate PR though. Let me know if you need help.
FYI, @hsubox76 - we need to make sure the service worker script is included in our distribution, otherwise people won't be able to use messaging.
Thanks Fei & Christina for reviewing. in regards to "We also need to add messaging to firebase-exp, so people can import from firebase/messaging." Looks like FM is already being imported in the constants.ts or is there another place to import? |
I meant that we need to make messaging-exp available in the umbrella package |
previously working. start showing errror after the register.ts refactor. reverting back to see
Tried a bunch of fix for
I am guessing I messed up something but not sure how. has this been seen previously? |
Make sure that the version of dependency |
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.
LGTM. One todo which we can do in a separate PR - we need to build the CDN script the service worker in firebase-exp
, currently we only build a client CDN script for messaging.
will do |
@hsubox76 @Feiyang1
for index.cdn.ts however |
FM Modularization. Part of go/firebase-next
Dependency updated:
app -> app-exp
,app-type -> app-types-exp
,messaging-types -> messaging-types-exp
Dependency to-be-updates: firebase-installations (there is some issue with stubbing
getToken(installations)
call. Update dependency to firebase-installtions-exp in proceeding PR