Skip to content

Commit f5bb8e6

Browse files
authored
chore(*): Update project dependencies for v7-beta
2 parents 00fc8cb + 10f52d3 commit f5bb8e6

File tree

321 files changed

+789
-841
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

321 files changed

+789
-841
lines changed

MIGRATION.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ FirebaseUI for Web has been completely rewritten from the ground up. The previou
1313
- Framework-agnostic but with a rigid structure
1414

1515
**New Version (v7):**
16-
- **Framework-agnostic core package** (`@invertase/firebaseui-core`): Contains all authentication logic, state management, behaviors, and utilities without any UI dependencies
17-
- **Framework-specific packages**: Separate packages for React (`@invertase/firebaseui-react`), Angular (`@invertase/firebaseui-angular`), and Shadcn components
18-
- **Supporting packages**: Separate packages for styles (`@invertase/firebaseui-styles`) and translations (`@invertase/firebaseui-translations`)
16+
- **Framework-agnostic core package** (`@firebase-oss/ui-core`): Contains all authentication logic, state management, behaviors, and utilities without any UI dependencies
17+
- **Framework-specific packages**: Separate packages for React (`@firebase-oss/ui-react`), Angular (`@firebase-oss/ui-angular`), and Shadcn components
18+
- **Supporting packages**: Separate packages for styles (`@firebase-oss/ui-styles`) and translations (`@firebase-oss/ui-translations`)
1919
- **Composable architecture**: Components are designed to be composed together, allowing for greater flexibility
2020
- **Modern patterns**: Uses reactive stores (nanostores), TypeScript throughout, and modern framework patterns
2121

@@ -53,10 +53,10 @@ First, remove the old `firebaseui` package and install the appropriate new packa
5353

5454
Install the new React package:
5555
```bash
56-
npm install @invertase/firebaseui-react
56+
npm install @firebase-oss/ui-react
5757
```
5858

59-
The package automatically includes the core package as a dependency, so you don't need to install `@invertase/firebaseui-core` separately.
59+
The package automatically includes the core package as a dependency, so you don't need to install `@firebase-oss/ui-core` separately.
6060
</details>
6161

6262
<details>
@@ -69,7 +69,7 @@ First, remove the old `firebaseui` package and install the appropriate new packa
6969

7070
Install the new Angular package:
7171
```bash
72-
npm install @invertase/firebaseui-angular
72+
npm install @firebase-oss/ui-angular
7373
```
7474

7575
**Note:** The Angular package requires [AngularFire](https://github.com/angular/angularfire) to be installed and configured first.
@@ -123,8 +123,8 @@ ui.start('#firebaseui-auth-container', uiConfig);
123123

124124
```tsx
125125
import { initializeApp } from 'firebase/app';
126-
import { initializeUI } from '@invertase/firebaseui-core';
127-
import { FirebaseUIProvider } from '@invertase/firebaseui-react';
126+
import { initializeUI } from '@firebase-oss/ui-core';
127+
import { FirebaseUIProvider } from '@firebase-oss/ui-react';
128128

129129
const app = initializeApp({ ... });
130130

@@ -148,7 +148,7 @@ ui.start('#firebaseui-auth-container', uiConfig);
148148

149149
```ts
150150
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
151-
import { initializeUI } from '@invertase/firebaseui-core';
151+
import { initializeUI } from '@firebase-oss/ui-core';
152152

153153
export const appConfig: ApplicationConfig = {
154154
providers: [
@@ -168,14 +168,14 @@ The following table maps v6 configuration options to their v7 equivalents:
168168

169169
| v6 Option | Migration Guide |
170170
|----------|------------------|
171-
| `autoUpgradeAnonymousUsers` | **Use the `autoUpgradeAnonymousUsers` behavior.**<br/><br/>Import `autoUpgradeAnonymousUsers` from `@invertase/firebaseui-core` and add it to your behaviors array:<br/>`behaviors: [autoUpgradeAnonymousUsers({ async onUpgrade(ui, oldUserId, credential) { /* handle merge */ } })]`<br/><br/>The `onUpgrade` callback replaces the `signInFailure` callback for handling merge conflicts. |
171+
| `autoUpgradeAnonymousUsers` | **Use the `autoUpgradeAnonymousUsers` behavior.**<br/><br/>Import `autoUpgradeAnonymousUsers` from `@firebase-oss/ui-core` and add it to your behaviors array:<br/>`behaviors: [autoUpgradeAnonymousUsers({ async onUpgrade(ui, oldUserId, credential) { /* handle merge */ } })]`<br/><br/>The `onUpgrade` callback replaces the `signInFailure` callback for handling merge conflicts. |
172172
| `callbacks` | **Use component props/events instead.**<br/><br/>v6 callbacks like `signInSuccessWithAuthResult`, `signInFailure`, etc. are replaced by component event handlers:<br/><br/>**React:** `onSignIn={(user) => { ... }}`, `onSignUp={(user) => { ... }}`, `onForgotPasswordClick={() => { ... }}`<br/><br/>**Angular:** `(signIn)="onSignIn($event)"`, `(signUp)="onSignUp($event)"`, `(forgotPassword)="onForgotPassword()"`<br/><br/>These are passed directly to the components you use, giving you more control over the flow. |
173-
| `credentialHelper` | **Use the `oneTapSignIn` behavior.**<br/><br/>The credential helper (Account Chooser) from v6 is replaced by Google One Tap in v7. Import `oneTapSignIn` from `@invertase/firebaseui-core` and add it to your behaviors array:<br/>`behaviors: [oneTapSignIn({ clientId: '...', autoSelect: false, cancelOnTapOutside: false })]`<br/><br/>**Note:** This requires Google Sign In to be enabled in Firebase Console. Get the `clientId` from "Web SDK configuration" settings. See [Google One Tap documentation](https://developers.google.com/identity/gsi/web/reference/js-reference) for all configuration options. |
173+
| `credentialHelper` | **Use the `oneTapSignIn` behavior.**<br/><br/>The credential helper (Account Chooser) from v6 is replaced by Google One Tap in v7. Import `oneTapSignIn` from `@firebase-oss/ui-core` and add it to your behaviors array:<br/>`behaviors: [oneTapSignIn({ clientId: '...', autoSelect: false, cancelOnTapOutside: false })]`<br/><br/>**Note:** This requires Google Sign In to be enabled in Firebase Console. Get the `clientId` from "Web SDK configuration" settings. See [Google One Tap documentation](https://developers.google.com/identity/gsi/web/reference/js-reference) for all configuration options. |
174174
| `queryParameterForSignInSuccessUrl` | **Handle in your routing logic.**<br/><br/>v7 doesn't have built-in URL parameter handling. Instead, handle redirects in your `onSignIn` callback by reading URL params:<br/><br/>**React/Angular:** `const urlParams = new URLSearchParams(window.location.search);`<br/>`const redirectUrl = urlParams.get('signInSuccessUrl') || '/dashboard';`<br/>`window.location.href = redirectUrl;`<br/><br/>**Angular (with Router):** Use `ActivatedRoute` to read query params and `Router` to navigate. |
175175
| `queryParameterForWidgetMode` | **Not applicable.**<br/><br/>v7 doesn't use widget modes. Instead, you explicitly render the components you need:<br/><br/>**React:** `<SignInAuthScreen />`, `<SignUpAuthScreen />`<br/><br/>**Angular:** `<fui-sign-in-auth-screen>`, `<fui-sign-up-auth-screen>` |
176-
| `signInFlow` | **Use provider strategy behaviors.**<br/><br/>Replace `signInFlow: 'redirect'` with:<br/>`import { providerRedirectStrategy } from '@invertase/firebaseui-core'`<br/>`behaviors: [providerRedirectStrategy()]`<br/><br/>Replace `signInFlow: 'popup'` with:<br/>`import { providerPopupStrategy } from '@invertase/firebaseui-core'`<br/>`behaviors: [providerPopupStrategy()]`<br/><br/>**Note:** `popup` is the default strategy in v7. |
176+
| `signInFlow` | **Use provider strategy behaviors.**<br/><br/>Replace `signInFlow: 'redirect'` with:<br/>`import { providerRedirectStrategy } from '@firebase-oss/ui-core'`<br/>`behaviors: [providerRedirectStrategy()]`<br/><br/>Replace `signInFlow: 'popup'` with:<br/>`import { providerPopupStrategy } from '@firebase-oss/ui-core'`<br/>`behaviors: [providerPopupStrategy()]`<br/><br/>**Note:** `popup` is the default strategy in v7. |
177177
| `immediateFederatedRedirect` | **Control via component rendering.**<br/><br/>v7 doesn't have this option. Instead, you control whether to show OAuth buttons or redirect immediately by conditionally rendering components:<br/><br/>**React:** `{singleProvider ? <Navigate to="/oauth-redirect" /> : <OAuthScreen onSignIn={handleSignIn} />}`<br/><br/>**Angular:** Use `*ngIf` or `@if` to conditionally render `<fui-oauth-screen>` or use `Router` to navigate directly. |
178-
| `signInOptions` | **Use OAuth button components directly.**<br/><br/>v6's `signInOptions` array is replaced by explicitly rendering the OAuth provider buttons you want:<br/><br/>**React:** Import `GoogleSignInButton`, `FacebookSignInButton`, `AppleSignInButton` from `@invertase/firebaseui-react` and render them inside `<OAuthScreen>`.<br/><br/>**Angular:** Import `GoogleSignInButtonComponent`, `FacebookSignInButtonComponent`, `AppleSignInButtonComponent` from `@invertase/firebaseui-angular` and use selectors `<fui-google-sign-in-button>`, `<fui-facebook-sign-in-button>`, `<fui-apple-sign-in-button>` inside `<fui-oauth-screen>`.<br/><br/>The order you place the buttons determines their display order. |
178+
| `signInOptions` | **Use OAuth button components directly.**<br/><br/>v6's `signInOptions` array is replaced by explicitly rendering the OAuth provider buttons you want:<br/><br/>**React:** Import `GoogleSignInButton`, `FacebookSignInButton`, `AppleSignInButton` from `@firebase-oss/ui-react` and render them inside `<OAuthScreen>`.<br/><br/>**Angular:** Import `GoogleSignInButtonComponent`, `FacebookSignInButtonComponent`, `AppleSignInButtonComponent` from `@firebase-oss/ui-angular` and use selectors `<fui-google-sign-in-button>`, `<fui-facebook-sign-in-button>`, `<fui-apple-sign-in-button>` inside `<fui-oauth-screen>`.<br/><br/>The order you place the buttons determines their display order. |
179179
| `signInSuccessUrl` | **Handle in `onSignIn` callback.**<br/><br/>Instead of a configuration option, handle redirects in your component's `onSignIn` callback:<br/><br/>**React:** `<SignInAuthScreen onSignIn={(user) => { window.location.href = '/dashboard'; }} />`<br/><br/>**Angular:** `<fui-sign-in-auth-screen (signIn)="onSignIn($event)" />` with `onSignIn(user: User) { this.router.navigate(['/dashboard']); }`<br/><br/>*Required in v6 when `signInSuccessWithAuthResult` callback is not used or returns `true`. |
180180
| `tosUrl` | **Pass via `policies` prop.**<br/><br/>**React:** Pass `policies={{ termsOfServiceUrl: 'https://example.com/tos', privacyPolicyUrl: 'https://example.com/privacy' }}` to `<FirebaseUIProvider>`.<br/><br/>**Angular:** Use `provideFirebaseUIPolicies(() => ({ termsOfServiceUrl: '...', privacyPolicyUrl: '...' }))`.<br/><br/>The policies are automatically rendered in auth forms and screens. |
181181
| `privacyPolicyUrl` | **Pass via `policies` prop.**<br/><br/>See `tosUrl` above - both URLs are passed together in the `policies` object. |
@@ -202,7 +202,7 @@ signInOptions: [
202202
Use the `countryCodes` behavior to configure allowed countries and default country:
203203

204204
```ts
205-
import { countryCodes } from '@invertase/firebaseui-core';
205+
import { countryCodes } from '@firebase-oss/ui-core';
206206

207207
const ui = initializeUI({
208208
app,
@@ -233,7 +233,7 @@ var uiConfig = {
233233
Use the `providerPopupStrategy` (default) or `providerRedirectStrategy` behaviors:
234234

235235
```ts
236-
import { providerPopupStrategy, providerRedirectStrategy } from '@invertase/firebaseui-core';
236+
import { providerPopupStrategy, providerRedirectStrategy } from '@firebase-oss/ui-core';
237237

238238
// For popup flow (default)
239239
const ui = initializeUI({
@@ -265,7 +265,7 @@ var ui = new firebaseui.auth.AuthUI(tenantAuth);
265265
**React:**
266266
```tsx
267267
import { getAuth } from 'firebase/auth';
268-
import { initializeUI } from '@invertase/firebaseui-core';
268+
import { initializeUI } from '@firebase-oss/ui-core';
269269

270270
const auth = getAuth(app);
271271
auth.tenantId = 'tenant-id';
@@ -279,7 +279,7 @@ const ui = initializeUI({
279279
**Angular:**
280280
```ts
281281
import { getAuth } from 'firebase/auth';
282-
import { initializeUI } from '@invertase/firebaseui-core';
282+
import { initializeUI } from '@firebase-oss/ui-core';
283283

284284
export const appConfig: ApplicationConfig = {
285285
providers: [
@@ -321,7 +321,7 @@ var uiConfig = {
321321
Use the `autoUpgradeAnonymousUsers` behavior:
322322

323323
```ts
324-
import { autoUpgradeAnonymousUsers } from '@invertase/firebaseui-core';
324+
import { autoUpgradeAnonymousUsers } from '@firebase-oss/ui-core';
325325

326326
const ui = initializeUI({
327327
app,

0 commit comments

Comments
 (0)