Skip to content

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

Merged
merged 4 commits into from
Aug 6, 2020

Conversation

avolkovi
Copy link
Contributor

@avolkovi avolkovi commented Aug 4, 2020

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Aug 4, 2020

💥 No Changeset

Latest 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 changesets

When 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

Base automatically changed from avolkovi/polyfill to auth-next August 5, 2020 15:49
@avolkovi avolkovi force-pushed the avolkovi/polyfill-demo branch 3 times, most recently from 86b66c7 to 0a0f517 Compare August 5, 2020 19:09
@avolkovi avolkovi force-pushed the avolkovi/polyfill-demo branch from 0a0f517 to 82b7bae Compare August 5, 2020 19:10
@avolkovi avolkovi merged commit de2b43b into auth-next Aug 6, 2020
@avolkovi avolkovi deleted the avolkovi/polyfill-demo branch August 6, 2020 17:27
avolkovi added a commit that referenced this pull request Aug 6, 2020
* Copy demo code over to auth-compat-layer, fix our build scripts

* Add more functionality to compat layer

* PR Feedback

* PR Feedback
Copy link
Member

@Feiyang1 Feiyang1 left a 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",
Copy link
Member

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",
Copy link
Member

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]
Copy link
Member

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
}

Copy link
Member

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);
Copy link
Member

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",
Copy link
Member

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
*/
{
Copy link
Member

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>
Copy link
Member

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",
Copy link
Member

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.

Comment on lines +44 to +45
"@firebase/logger": "^0.2.6",
"@firebase/util": "^0.3.0",
Copy link
Member

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 = [
Copy link
Member

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.

avolkovi added a commit that referenced this pull request Aug 10, 2020
* Copy demo code over to auth-compat-layer, fix our build scripts

* Add more functionality to compat layer

* PR Feedback

* PR Feedback
sam-gc pushed a commit that referenced this pull request Sep 1, 2020
* Copy demo code over to auth-compat-layer, fix our build scripts

* Add more functionality to compat layer

* PR Feedback

* PR Feedback
@firebase firebase locked and limited conversation to collaborators Sep 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants