-
Notifications
You must be signed in to change notification settings - Fork 945
Copy demo code over to auth-compat-layer, fix our build scripts #3563
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
💥 No ChangesetLatest commit: d5efb21 Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂 If these changes should be published to npm, you need to add a changeset. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Click here to learn what changesets are, and how to add one. Click here if you're a maintainer who wants to add a changeset to this PR |
86b66c7
to
0a0f517
Compare
0a0f517
to
82b7bae
Compare
* Copy demo code over to auth-compat-layer, fix our build scripts * Add more functionality to compat layer * PR Feedback * PR Feedback
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.
I'm too slow at reviewing! Left some comments, PTAL
"dependencies": { | ||
"@firebase/logger": "^0.2.2", | ||
"@firebase/util": "^0.2.44", | ||
"lerna": "^3.22.1", |
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.
Use exact version for @firebase packages. Also, I guess lerna is a mistake here?
"bugs": { | ||
"url": "https://github.com/firebase/firebase-js-sdk/issues" | ||
}, | ||
"typings": "dist/index.d.ts", |
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.
Nit: You don't need a typing file for an app, so delete this line.
format: 'umd', | ||
name: 'firebase' | ||
}, | ||
plugins: [...plugins] |
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.
nit: can shorten to just plugins
{
input: '...',
plugins
}
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.
I think the build step for the demo app can be removed (rollup, tsconfig, package.json) once we add firebase-compat
where we build the scripts that you can copy here.
@@ -74,7 +78,7 @@ function registerAuth(instance: _FirebaseNamespace): void { | |||
.setMultipleInstances(false) | |||
); | |||
|
|||
instance.registerVersion(name, version); | |||
instance.registerVersion('auth', version); |
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.
instance.registerVersion('auth', version, 'compat');
to differentiate the modular SDK and the compat SDK in metrics.
@@ -38,11 +37,12 @@ | |||
}, | |||
"license": "Apache-2.0", | |||
"devDependencies": { | |||
"@firebase/app-exp": "0.x", |
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 probably want to move all peerDependencies to dependencies using exact versions except for @firebase/app(-compat)
. We will ask compat users to install firebase-compat
without needing to install firebase
.
I don't think auth uses @firebase/installations
, so it should be removed.
/** | ||
* React Native Builds | ||
*/ | ||
{ |
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.
Do we still need a React native build?
convertCredential | ||
} from './user_credential'; | ||
|
||
export class Auth extends AuthImplCompat<User> implements compat.FirebaseAuth { | ||
export class Auth extends impl.AuthImplCompat<User> |
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.
Is it possible to get an instance of modular Auth from the compat Auth, and similarly for other things, e.g. User? Or is AuthImplCompat
compatible with the modular Auth?
We want to allow people to upgrade to the modular SDK piece meal, meaning they can use the compat SDK and upgrade part of their auth code to use the modular SDK. Something like:
import * as firebase from 'firebase-compat';
import 'firebase-compat/auth' ;
import { signInWithEmailAndPassword } from 'firebase/auth';
const authCompat = firebase.auth();
// raw() returns an instance of modular Auth.
const auth = authCompat.raw();
signInWithEmailAndPasswood(auth, .... );
"author": "Firebase <[email protected]> (https://firebase.google.com/)", | ||
"main": "dist/index.node.cjs.js", | ||
"main-esm2017": "dist/index.node.esm2017.js", | ||
"react-native": "dist/index.rn.esm2017.js", | ||
"browser": "dist/index.cjs.js", |
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.
browser and module should both be esm2017.
"@firebase/logger": "^0.2.6", | ||
"@firebase/util": "^0.3.0", |
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.
use exact version for @firebase dependencies
json() | ||
]; | ||
|
||
const allBuilds = [ |
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 combine the internal build into the main build, otherwise they won't share code. We will need to do the same for other submodules you will add, e.g. auth/cordova. It might be easier that I make the change and create a PR against your branch.
* Copy demo code over to auth-compat-layer, fix our build scripts * Add more functionality to compat layer * PR Feedback * PR Feedback
* Copy demo code over to auth-compat-layer, fix our build scripts * Add more functionality to compat layer * PR Feedback * PR Feedback
No description provided.