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
Modularize functions #3051
Modularize functions #3051
Conversation
d2243fa
to
0526724
Compare
Binary Size ReportAffected SDKs
Test Logs
|
{ | ||
'packageDir': [path.resolve(__dirname, '../../'), './'], | ||
devDependencies: true, | ||
peerDependencies: 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.
Shouldn't peerDependencies to be allowed?
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.
This allows peerDependencies (will not show error on peerDependency import). Are you saying it should not be allowed?
Also this whole rule is a mess for monorepos, it looks like someone has submitted a PR to try to fix it but it has not been looked at yet: import-js/eslint-plugin-import#1650
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.
Right. I meant not allowed.
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.
Removed. I thought it would give me errors on imports from @firebase/app-types-exp
but I guess it doesn't? I don't know how this rule works anymore.
c5ea05e
to
8189fe2
Compare
8189fe2
to
ce8fa07
Compare
* A standard error code that will be returned to the client. This also | ||
* determines the HTTP status code of the response, as defined in code.proto. | ||
*/ | ||
readonly code: FunctionsErrorCode, |
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.
It should be a simple input parameter without readonly
annotation because otherwise it would create a property code
on FunctionsError
.
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.
*/ | ||
readonly details?: unknown | ||
) { | ||
super(code, message || ''); |
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 format for code shoud be service/error-code-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.
* The main class for the Firebase Functions SDK. | ||
* @internal | ||
*/ | ||
export class FunctionsService { |
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.
Can you make it extend https://github.com/firebase/firebase-js-sdk/blob/master/packages-exp/app-types-exp/index.d.ts#L110 ?
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.
ce8fa07
to
b6667e9
Compare
packages/util/src/errors.ts
Outdated
@@ -66,7 +66,8 @@ export interface StringLike { | |||
} | |||
|
|||
export interface ErrorData { | |||
[key: string]: StringLike | undefined; | |||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | |||
[key: string]: any; |
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.
Can it be unknown
?
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, but to get around an error in line 151 I had to change .toString()
to String()
, hopefully that's ok.
async function updateField(pkg, fieldName) { | ||
const field = pkg[fieldName]; | ||
for (const depName in field) { | ||
if (!depName.includes('@firebase')) continue; |
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 should update the firebase
package as well as packages may depend on it, e.g.@firebase/testing
and rxFire
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.
Updated.
I'm going to wait for this week's release to be merged to master, rebase, run package.json version update script, and then merge. |
b6667e9
to
ce280e5
Compare
@@ -0,0 +1,25 @@ | |||
{ | |||
"name": "@firebase/functions-types-exp", |
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.
Can you please make it private?
First draft at modularizing firebase/functions.