-
Notifications
You must be signed in to change notification settings - Fork 928
Add bundle definitions and its measurement script. #5706
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
|
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 good, pending addition of ReCaptchaEnterpriseProvider
to app-check.
Changeset File Check ✅
|
0069054
to
a9c4167
Compare
99af8dd
to
1a12d6e
Compare
{ | ||
"path": "app-check", | ||
"imports": [ | ||
"initializeAppCheck", |
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.
Did these used to include getToken
? I thought I remembered seeing them. It makes sense because if app check is being used, getToken() will eventually be called, if not by the user then by another library (storage, functions, etc).
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, it was there before. I got confused this morning when reading the code sample for App Check Enterprise, which doesn't reference getToken
, and I wondered why it was there. I forgot that it was actually Feiyang who added getToken
for me in the bundle doc last week. I was actually about to ask you, but got stuck in some changeset warnings in this pull request.
Anyway, I have added it back both in the bundle definition doc and the json files in this pull request. Please take a look. Thanks!
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.
iiuc this PR doesn't have any direct doc impact. If that's wrong, LMK and I'll take a closer look.
Thanks!
const analyses = JSON.parse(fs.readFileSync(output, { encoding: 'utf-8' })); | ||
const results: Report[] = []; | ||
for (const analysis of analyses) { | ||
const sdk = 'bundle'; |
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.
What does bundle mean?
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 name we put here will be appear as the name of a new section under "affected sdks" in a PR report. For example, there is another section named "bundle" in the report above in this PR [1]. We can put whatever name we want here.
[1] #5706 (comment)
I suppose it is a limitation of the metric backend at the moment. When the API for receiving size measurements was first designed, the backend only recognizes http requests with a json body strictly in this format:
[
{
sdk: <some-string>,
type: <some-string>,
value: <some-integer>
},
......
]
Writing a new API in the backend and deploying a new version of the service to GCP can be some work, therefore I'm reusing the API for bundle measurements here, although the semantic of the API doesn't make any sense in the context of "bundle-analysis". What do you think?
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 think it's fine. It would be great if you can copy your comment here to the code.
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.
Added some comment in the code to explain the rationale here.
@@ -0,0 +1,202 @@ | |||
[ |
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.
@sam-gc Can you please take a look at the Auth use cases to see if you want to add anything, or if anything is inaccurate?
For context, each object in the array is a bundle definition for a specific use case. It's basically a list of imports that customers need to import to use a certain feature from our products.
We are setting up a dashboard to continuously track the bundle size for them across versions.
@@ -0,0 +1,256 @@ | |||
[ | |||
{ | |||
"name": "Read data once", |
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.
@schmidt-sebastian Can you please take a look at the Database/Firestore/Storage use cases to see if you want to add anything, or if anything is inaccurate?
For context, each object in the array is a bundle definition for a specific use case. It's basically a list of imports that customers need to import to use a certain feature from our products.
We are setting up a dashboard to continuously track the bundle size for them across versions.
Thanks for setting up the bundle size tracking! It looks good. It would be great if you can add some comments in |
I have added some jsdoc on the method. Please take a look. |
* @param {string} [version] - If present, the SDK version to run measurement against | ||
* @returns {Promise<Report[]>} A list of bundle size measurements |
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.
We use tsdoc instead of jsdoc. Please update. You can take a look at any of our packages for reference.
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.
Is that just a standard of doc format or something I should use to generate the doc?
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. Changed to tsdoc format.
No description provided.