docs(auth): update examples to use modular API#8327
docs(auth): update examples to use modular API#8327mikehardy merged 5 commits intoinvertase:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
8b0286b to
db17815
Compare
db17815 to
fa7de9b
Compare
fa7de9b to
f2782c2
Compare
7fb2af3 to
293999c
Compare
|
Hello 👋, this PR has been opened for more than 2 months with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 15 days until this gets closed automatically |
|
Hi @mikehardy, IMHO the docs would still benefit from this PR. Thanks in advance for taking a look. |
mikehardy
left a comment
There was a problem hiding this comment.
Hmmm 🤔 These aren't quite right though...
- currentUser is accessed as
auth.currentUseron the return value ofgetAuth() - all methods should be patterned as
methodName(getAuth(), <params>)
so there should never be an auth import, and there shouldn't be any getAuth().methodName()
The modular sections of the e2e test suites are the working examples at the moment
293999c to
bb8d56f
Compare
bb8d56f to
e1ffd61
Compare
|
Thanks for the feedback, @mikehardy ! I just finished rewriting this PR and incorporated newly available imports added with recently merged PRs (i.e. the auth providers are now importable).
Unfortunately, the auth module import is not quite gone yet since Similarly, |
There was a problem hiding this comment.
getting closer - sorry for the delay on review - but still documents a partial transition
I think a lot of the issues are easily fixed with current implementation and need to be fixed
There may be (likely is?) an implementation gap on the multi-factor stuff where we simply don't have the right APIs yet - either not exposing the MFA types for direct import yet or missing a method completely. I think these may be somewhat easy to fix in fact, and if they are missing I'd like to collaborate in fixing while getting this PR in
deprecating [edit: turns out auth.currentUser and removing it is a breaking change so that is out of scope but documenting to access the user off credential or via getAdditionalUserInfo is important I think so people use the correct style going forward<Auth>.currentUser is still valid, I've modified all related comments below - no issue here with using .currentUser
e1ffd61 to
0566373
Compare
mikehardy
left a comment
There was a problem hiding this comment.
Very cool - thanks for doing this. I think documentation is easily as hard as code, and then when it's got code in it, doing it right is that much harder. This will be a big help for people
|
Lemme pull this locally and do the mindless lint / formatting stuff, it's all auto for me and I want to get this in |
For me, the scary part about docs is that tests usually don't catch errors/bugs in the code samples. I'm co-maintaining a quite popular Python project where we face the same issue. Someone recently opened a PR that adds tests to our CI checking whether code samples in the docs are self-contained and can be run as-is. Turns out most of our code samples are not self-contained, and we need a lot of extra work before we could potentially merge that PR.
No way I forgot to lint/format the docs again haha. I'm too spoiled by pre-commit hooks. |
|
just released the underlying code with the PR that makes this possible, so, good to go on the docs merge. Thanks again |
Description
This PR updates the authentication docs to use the modular API.
I just finished migrating an app to the modular API and put my insights into this PR hoping the next person can benefit from it.
Checklist
AndroidiOSe2etests added or updated inpackages/\*\*/e2ejesttests added or updated inpackages/\*\*/__tests__Test Plan
I'll wait for the Vercel preview and then read the docs again. I already cross-checked the edits I made with my own code after the migration.
🔥
Think
react-native-firebaseis great? Please consider supporting the project with any of the below:React Native FirebaseandInvertaseon Twitter