-
Notifications
You must be signed in to change notification settings - Fork 948
Adds a demo app to help test and facilitate Firebase Auth API development #279
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
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.
So this review ultimately has two parts:
- The actual app
- The infrastructure around the app
So the actual app itself looks solid. I love the idea of having a quick and easy way to experiment w/ the different sections of the API. So 👍 from me on that.
The infra around the app I had some larger questions than would make sense for inline comments so I'm putting them here:
Can we leverage the app configured at the top level for testing? We require a production app to do testing, it might make a lot of sense to fold your database.rules.json
and firebase.json
in with the top level config. That way a user can simply do a yarn test:setup
and are configured for the whole app (dev and testing). We would, ideally, also make it so a user doesn't have to manually inject their config (i.e. config.js)
How do we do incremental builds? This works great for a one time through kind of thing, however it'd be nice to reconfigure this for SDK-wide incremental builds (use webpack or something). Is this something we can do here?
packages/auth/buildtools/run_demo.sh
Outdated
cd "$(dirname $(dirname "$0"))" | ||
# Go back to repo root and build all binaries needed for the demo app. | ||
cd ../.. | ||
yarn |
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 is going to do a complete rebuild of the dependencies (if needed) which could be quite slow, maybe consider instead just doing yarn prepare
?
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.
packages/auth/buildtools/run_demo.sh
Outdated
cp ../firebase/firebase-database.js demo/public/dist/firebase-database.js | ||
# Serve demo app. | ||
cd demo | ||
firebase serve |
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.
If you are going to do this as part of your demo, maybe consider adding firebase-tools as a devDependency
? Then you can just reference it directly as part of your npm bin
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.
…naries for demo app. Adds `firebase-tools` as `devDependency`.
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
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 we leverage the app configured at the top level for testing?
I am open to that. I wanted to contain and isolate Auth changes so I don't affect other Firebase services. We can follow up with enhancements on this after running this by the other owners.
How do we do incremental builds?
I am not sure what you mean by incremental builds. Do you mean building and deploying locally multiple versions of the test app?
packages/auth/buildtools/run_demo.sh
Outdated
cd "$(dirname $(dirname "$0"))" | ||
# Go back to repo root and build all binaries needed for the demo app. | ||
cd ../.. | ||
yarn |
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.
packages/auth/buildtools/run_demo.sh
Outdated
cp ../firebase/firebase-database.js demo/public/dist/firebase-database.js | ||
# Serve demo app. | ||
cd demo | ||
firebase serve |
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.
Your proposed config will not break anything in the other tests (all of the other tests don't touch the
In your demo script, you rebuild the entire SDK before you run the demo. It's just quite costly and you could implement something like webpack-dev-server (see https://github.com/firebase/firebase-js-sdk/blob/master/packages/firebase/package.json#L23) to simplify this and close the feedback loop. |
Ok, incremental builds sound like a good feature to have. Let's log an issue to track that and implement it separately. Also I think we can move the hosting config to the root package and leverage |
…ment (#279) * Adds a demo app to help test and facilitate Firebase Auth API development.
Adds a new directory in auth package demo.
3 main steps are needed:
demo/public
.demo/
:firebase use --add
cd ..
andyarn run demo