Skip to content
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

Support Auth emulator options #195

Closed
wants to merge 2 commits into from
Closed

Support Auth emulator options #195

wants to merge 2 commits into from

Conversation

charlesfries
Copy link
Collaborator

@charlesfries charlesfries commented Oct 3, 2021

This PR updates the Auth emulator initializer to the modular format, and also allows Auth emulator options to be passed in via the config. Currently, the only option available is disableWarnings.

Copy link
Owner

@mikkopaderes mikkopaderes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. I will check it out manually first if there's any compatibility issues with modular SDK and compat SDK for this API particularly in FastBoot env.

addon/instance-initializers/firebase-settings.ts Outdated Show resolved Hide resolved
@mikkopaderes
Copy link
Owner

mikkopaderes commented Oct 4, 2021

Just as what my hunch expected, this change wouldn't work in FastBoot environment. Detailed explanation on it in embroider-build/ember-auto-import#446.

I haven't decided yet on what would be the best way to approach this. But if we move now, one option I think is to update the firebase-service to use the modular SDK.

Another approach is to emulate how angularfire does their importing. If you read through their examples, it seems that they import Firestore APIs from under a custom module @anguar/fire/firestore. We could probably do the same and that the export of those module would return the appropriate browser or node based modules depending on the environment. I'm not yet sure how flexible it is though because we'll always have to add a new export for new APIs that they have which can be a maintenance burden.

Regardless of the approach, this will probably lead to a chain reaction of needing to update multiple parts of the code with modular SDK as well. In short, I think this PR is too early for now to make as there's some dependencies that needs to be resolved first.

@charlesfries
Copy link
Collaborator Author

@mikkopaderes Any new thoughts here? It seems auth.useEmulator() still doesn't accept a config object, but I'm curious if anything has changed elsewhere in this addon that would now facilitate an easy migration to the modular API.

@mikkopaderes
Copy link
Owner

@charlesfries not really. My plan was to remove non-modular API as soon as Firebase release v10. I think they do yearly major version bump so v10 I assume should be nearby. But something I could take a step ahead and look through over the weekend in prep for the release, I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants