firebase-kotlin-sdk icon indicating copy to clipboard operation
firebase-kotlin-sdk copied to clipboard

Refactor Firebase JS externals using Web v9 modular SDK

Open shepeliev opened this issue 2 years ago • 5 comments

At the moment, despite the SDK is packaged with Web v9 Firebase libs we are using compat modules. The goal of this PR is to get rid legacy firebase externals in favor of modular SDK.

fixes #236 fixes #241 fixes #315 fixes #316

shepeliev avatar Jun 10 '22 15:06 shepeliev

A lot of these changes look like just formatting? Makes it tricky to review - could you split the formatting / changes into separate commits so we can review this PR?

nbransby avatar Jun 12 '22 14:06 nbransby

I pulled this PR and it does indeed solve my issue https://github.com/GitLiveApp/firebase-kotlin-sdk/issues/315 . So while I haven't thoroughly looked through the code this looks good to me @nbransby

MinmoTech avatar Jun 29 '22 15:06 MinmoTech

@shepeliev I've found one potential issue but i'm not sure if it's caused by your PR or was there before: As soon as I try to use Firebase.auth I get the following error:

> Task :compileDevelopmentExecutableKotlinJs FAILED
e: Module "dev.gitlive:firebase-auth" has a reference to symbol dev.gitlive.firebase.auth/FirebaseUser.displayName.<get-displayName>|-7122534302014937473[1]. Neither the module itself nor its dependencies contain such declaration.

This could happen if the required dependency is missing in the project. Or if there is a dependency of "dev.gitlive:firebase-auth" that has adifferent version in the project than the version that "dev.gitlive:firebase-auth" was initially compiled with. Please check that the projectconfiguration is correct and has consistent versions of all required dependencies.

The list of "dev.gitlive:firebase-auth" dependencies that may lead to conflicts:
1. "kotlin" (a library with unknown version)
2. "dev.gitlive:firebase-app" (a library with unknown version)
3. "dev.gitlive:firebase-common" (a library with unknown version)
4. "org.jetbrains.kotlinx:atomicfu" (a library with unknown version)
5. "org.jetbrains.kotlinx:kotlinx-coroutines-core" (a library with unknown version)
6. "org.jetbrains.kotlinx:kotlinx-serialization-core" (a library with unknown version)

MinmoTech avatar Jul 02 '22 18:07 MinmoTech

@MinmoTech thanks for the comment. The PR is not a cause for this error. The reason is the bug in IR compiler: KT-48836. You can find a workaround here.

shepeliev avatar Jul 03 '22 12:07 shepeliev

Sorry for the ping and thanks for the help!

MinmoTech avatar Jul 03 '22 14:07 MinmoTech

Is this thread dead? It would really help if someone could review and approve this PR.

shubhamsinghshubham777 avatar Jan 02 '23 18:01 shubhamsinghshubham777

can you rebase and then i can have another look at it

Reedyuk avatar Apr 05 '23 18:04 Reedyuk

can you rebase and then i can have another look at it

I'll be back to it soon

shepeliev avatar Apr 06 '23 12:04 shepeliev

@shepeliev Have you tried using signInWithPopup with GoogleAuthProvider with this implementation? For me, it throws the following error: Error (auth/argument-error)

shubhamsinghshubham777 avatar Apr 06 '23 15:04 shubhamsinghshubham777

@shepeliev Have you tried using signInWithPopup with GoogleAuthProvider with this implementation? For me, it throws the following error: Error (auth/argument-error)

Oh, looks like I didn't migrate that API to externals. Thanks for highlighting. I'll try to add it this weekend.

shepeliev avatar Apr 06 '23 16:04 shepeliev

can you resolve the conflicts please

Reedyuk avatar Apr 09 '23 10:04 Reedyuk

can you resolve the conflicts please

@Reedyuk done

shepeliev avatar Apr 10 '23 18:04 shepeliev

@nbransby Could you please have a look at this? It's been a while.

shubhamsinghshubham777 avatar Apr 21 '23 04:04 shubhamsinghshubham777

Although your effort is highly appreciated, the secret to getting timely approval on PRs is to produce small ones, this is huge and makes reviewers lose the will to live!

A quick scan it looks good but also seems there's a fair few changes in there which are unrelated to the subject of the PR, can you highlight these and explain the rational?

nbransby avatar Apr 21 '23 11:04 nbransby

Although your effort is highly appreciated, the secret to getting timely approval on PRs is to produce small ones, this is huge and makes reviewers lose the will to live!

Yeap, you're might right there are some more changes than it would be wanted. However, I don't think it would make sence to migrate from Firbase JS v8 to v9 module by module in separate PRs just for reducing their size.

A quick scan it looks good but also seems there's a fair few changes in there which are unrelated to the subject of the PR, can you highlight these and explain the rational?

All of those changes are related to the PR subject exepting couple of lines that fix tests in JS. I've drop a comment earlier: https://github.com/GitLiveApp/firebase-kotlin-sdk/pull/319/files#r1161516897

It's required as at the moment JS tests are broken in the master branch and test nothing at all despite all of them are green.

shepeliev avatar Apr 21 '23 17:04 shepeliev