Skip to content

Commit 79f0a00

Browse files
Merge branch 'master' into mrschmidt/fixauth
2 parents 701ef07 + ed4f95c commit 79f0a00

File tree

82 files changed

+485
-167
lines changed

Some content is hidden

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

82 files changed

+485
-167
lines changed

.changeset/blue-hairs-scream.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/fuzzy-teachers-guess.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/rotten-wombats-shop.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/twenty-scissors-exist.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
- name: Install Dependencies
2525
run: yarn
2626

27+
- name: Add a changeset for @firebase/app
28+
run: yarn ts-node-script scripts/add_changeset.ts
29+
2730
- name: Create Release Pull Request
2831
uses: changesets/action@master
2932
env:
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
{
2-
"name": "firebase-compat-interop-test",
3-
"private": true,
4-
"version": "0.1.0",
5-
"scripts": {
6-
"test": "karma start --single-run",
7-
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test",
8-
"test:debug": "karma start --browsers Chrome --auto-watch"
9-
},
10-
"dependencies": {
11-
"@firebase/app-exp": "0.0.900",
12-
"@firebase/app-compat": "0.0.900",
13-
"@firebase/analytics-exp": "0.0.900",
14-
"@firebase/analytics-compat": "0.0.900",
15-
"@firebase/auth-exp": "0.0.900",
16-
"@firebase/auth-compat": "0.0.900",
17-
"@firebase/functions-exp": "0.0.900",
18-
"@firebase/functions-compat": "0.0.900",
19-
"@firebase/messaging-exp": "0.0.900",
20-
"@firebase/messaging-compat": "0.0.900",
21-
"@firebase/performance-exp": "0.0.900",
22-
"@firebase/performance-compat": "0.0.900",
23-
"@firebase/remote-config-exp": "0.0.900",
24-
"@firebase/remote-config-compat": "0.0.900"
25-
},
26-
"devDependencies": {
27-
"typescript": "4.2.2"
28-
}
29-
}
2+
"name": "firebase-compat-interop-test",
3+
"private": true,
4+
"version": "0.1.0",
5+
"scripts": {
6+
"test": "karma start --single-run",
7+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test",
8+
"test:debug": "karma start --browsers Chrome --auto-watch"
9+
},
10+
"dependencies": {
11+
"@firebase/app-exp": "0.0.900",
12+
"@firebase/app-compat": "0.0.900",
13+
"@firebase/analytics-exp": "0.0.900",
14+
"@firebase/analytics-compat": "0.0.900",
15+
"@firebase/auth-exp": "0.0.900",
16+
"@firebase/auth-compat": "0.0.900",
17+
"@firebase/functions-exp": "0.0.900",
18+
"@firebase/functions-compat": "0.0.900",
19+
"@firebase/messaging-exp": "0.0.900",
20+
"@firebase/messaging-compat": "0.0.900",
21+
"@firebase/performance-exp": "0.0.900",
22+
"@firebase/performance-compat": "0.0.900",
23+
"@firebase/remote-config-exp": "0.0.900",
24+
"@firebase/remote-config-compat": "0.0.900"
25+
},
26+
"devDependencies": {
27+
"typescript": "4.2.2"
28+
}
29+
}

integration/firebase/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test"
88
},
99
"devDependencies": {
10-
"firebase": "8.6.2",
10+
"firebase": "8.6.5",
1111
"@types/chai": "4.2.14",
1212
"@types/mocha": "7.0.2",
1313
"chai": "4.2.0",

integration/firestore/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome"
1515
},
1616
"devDependencies": {
17-
"@firebase/app": "0.6.22",
18-
"@firebase/firestore": "2.3.1",
17+
"@firebase/app": "0.6.24",
18+
"@firebase/firestore": "2.3.4",
1919
"@types/mocha": "7.0.2",
2020
"gulp": "4.0.2",
2121
"gulp-filter": "6.0.0",

integration/messaging/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"test:manual": "mocha --exit"
1010
},
1111
"devDependencies": {
12-
"firebase": "8.6.2",
12+
"firebase": "8.6.5",
1313
"chai": "4.2.0",
1414
"chromedriver": "89.0.0",
1515
"express": "4.17.1",

packages-exp/analytics-compat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"typings": "dist/src/index.d.ts",
4646
"dependencies": {
47-
"@firebase/component": "0.5.0",
47+
"@firebase/component": "0.5.1",
4848
"@firebase/analytics-exp": "0.0.900",
4949
"@firebase/analytics-types": "0.4.0",
5050
"@firebase/util": "1.1.0",

packages-exp/analytics-exp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@firebase/installations-exp": "0.0.900",
3636
"@firebase/logger": "0.2.6",
3737
"@firebase/util": "1.1.0",
38-
"@firebase/component": "0.5.0",
38+
"@firebase/component": "0.5.1",
3939
"tslib": "^2.1.0"
4040
},
4141
"license": "Apache-2.0",

packages-exp/app-compat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@firebase/app-exp": "0.0.900",
3232
"@firebase/util": "1.1.0",
3333
"@firebase/logger": "0.2.6",
34-
"@firebase/component": "0.5.0",
34+
"@firebase/component": "0.5.1",
3535
"tslib": "^2.1.0",
3636
"dom-storage": "2.1.0",
3737
"xmlhttprequest": "1.8.0"

packages-exp/app-exp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"dependencies": {
3333
"@firebase/util": "1.1.0",
3434
"@firebase/logger": "0.2.6",
35-
"@firebase/component": "0.5.0",
35+
"@firebase/component": "0.5.1",
3636
"tslib": "^2.1.0"
3737
},
3838
"license": "Apache-2.0",

packages-exp/auth-compat-exp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"dependencies": {
3535
"@firebase/auth-exp": "0.0.900",
3636
"@firebase/auth-types": "0.10.3",
37-
"@firebase/component": "0.5.0",
37+
"@firebase/component": "0.5.1",
3838
"@firebase/util": "1.1.0",
3939
"node-fetch": "2.6.1",
4040
"selenium-webdriver": "^4.0.0-beta.2",

packages-exp/auth-exp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@firebase/app-exp": "0.x"
5252
},
5353
"dependencies": {
54-
"@firebase/component": "0.5.0",
54+
"@firebase/component": "0.5.1",
5555
"@firebase/logger": "0.2.6",
5656
"@firebase/util": "1.1.0",
5757
"node-fetch": "2.6.1",

packages-exp/auth-exp/src/api/authentication/mfa.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ describe('api/authentication/finalizeSignInPhoneMfa', () => {
158158

159159
await expect(finalizeSignInPhoneMfa(auth, request)).to.be.rejectedWith(
160160
FirebaseError,
161-
'Firebase: The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user. (auth/invalid-verification-code).'
161+
'Firebase: The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user. (auth/invalid-verification-code).'
162162
);
163163
expect(mock.calls[0].request).to.eql({
164164
tenantId: null,

packages-exp/auth-exp/src/api/authentication/sms.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ describe('api/authentication/signInWithPhoneNumber', () => {
154154

155155
await expect(signInWithPhoneNumber(auth, request)).to.be.rejectedWith(
156156
FirebaseError,
157-
'Firebase: The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user. (auth/invalid-verification-code).'
157+
'Firebase: The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user. (auth/invalid-verification-code).'
158158
);
159159
expect(mock.calls[0].request).to.eql(request);
160160
});
@@ -222,7 +222,7 @@ describe('api/authentication/linkWithPhoneNumber', () => {
222222

223223
await expect(linkWithPhoneNumber(auth, request)).to.be.rejectedWith(
224224
FirebaseError,
225-
'Firebase: The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user. (auth/invalid-verification-code).'
225+
'Firebase: The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user. (auth/invalid-verification-code).'
226226
);
227227
expect(mock.calls[0].request).to.eql(request);
228228
});

packages-exp/auth-exp/src/core/errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ function _debugErrorMap(): ErrorMap<AuthErrorCode> {
186186
[AuthErrorCode.INVALID_AUTH_EVENT]: 'An internal AuthError has occurred.',
187187
[AuthErrorCode.INVALID_CODE]:
188188
'The SMS verification code used to create the phone auth credential is ' +
189-
'invalid. Please resend the verification code sms and be sure use the ' +
189+
'invalid. Please resend the verification code sms and be sure to use the ' +
190190
'verification code provided by the user.',
191191
[AuthErrorCode.INVALID_CONTINUE_URI]:
192192
'The continue URL provided in the request is invalid.',

packages-exp/auth-exp/src/core/strategies/anonymous.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { _castAuth } from '../auth/auth_impl';
3434
*/
3535
export async function signInAnonymously(auth: Auth): Promise<UserCredential> {
3636
const authInternal = _castAuth(auth);
37+
await authInternal._initializationPromise;
3738
if (authInternal.currentUser?.isAnonymous) {
3839
// If an anonymous user is already signed in, no need to sign them in again.
3940
return new UserCredentialImpl({

packages-exp/auth-exp/test/integration/webdriver/anonymous.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,19 @@ browserDescribe('WebDriver anonymous auth test', driver => {
5252
);
5353
expect(after.uid).to.eq(before.uid);
5454
});
55+
56+
it('user persists after refresh and sign in (no init wait)', async () => {
57+
const { user: before }: UserCredential = await driver.call(
58+
AnonFunction.SIGN_IN_ANONYMOUSLY
59+
);
60+
await driver.webDriver.navigate().refresh();
61+
await driver.injectConfigAndInitAuth();
62+
63+
// At this point we aren't waiting for auth to "settle"
64+
// Sign in before the first onAuthStateChanged has occurred
65+
const { user: after }: UserCredential = await driver.call(
66+
AnonFunction.SIGN_IN_ANONYMOUSLY
67+
);
68+
expect(after.uid).to.eq(before.uid);
69+
});
5570
});

packages-exp/firebase-exp/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "firebase-exp",
3-
"version": "9.0.0-beta.2",
3+
"version": "9.0.0-beta.3",
44
"private": true,
55
"description": "Firebase JavaScript library for web and Node.js",
66
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
@@ -129,11 +129,11 @@
129129
"@firebase/app-compat": "0.0.900",
130130
"@firebase/auth-exp": "0.0.900",
131131
"@firebase/auth-compat": "0.0.900",
132-
"@firebase/database": "0.10.1",
132+
"@firebase/database": "0.10.3",
133133
"@firebase/functions-exp": "0.0.900",
134134
"@firebase/functions-compat": "0.0.900",
135-
"@firebase/firestore": "2.3.1",
136-
"@firebase/storage": "0.5.2",
135+
"@firebase/firestore": "2.3.4",
136+
"@firebase/storage": "0.5.3",
137137
"@firebase/performance-exp": "0.0.900",
138138
"@firebase/performance-compat": "0.0.900",
139139
"@firebase/remote-config-exp": "0.0.900",

packages-exp/functions-compat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
"typings": "dist/src/index.d.ts",
4949
"dependencies": {
50-
"@firebase/component": "0.5.0",
50+
"@firebase/component": "0.5.1",
5151
"@firebase/functions-exp": "0.0.900",
5252
"@firebase/functions-types": "0.4.0",
5353
"@firebase/messaging-types": "0.5.0",

packages-exp/functions-exp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
},
5151
"typings": "dist/functions-exp-public.d.ts",
5252
"dependencies": {
53-
"@firebase/component": "0.5.0",
53+
"@firebase/component": "0.5.1",
5454
"@firebase/messaging-types": "0.5.0",
5555
"@firebase/util": "1.1.0",
5656
"node-fetch": "2.6.1",

packages-exp/functions-exp/src/serializer.test.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,18 @@ describe('Serializer', () => {
8282
expect(decode('hello')).to.equal('hello');
8383
});
8484

85+
it('encodes date to ISO string', () => {
86+
expect(encode(new Date(1620666095891))).to.equal(
87+
'2021-05-10T17:01:35.891Z'
88+
);
89+
});
90+
91+
it('decodes date string without modifying it', () => {
92+
expect(decode('2021-05-10T17:01:35.891Z')).to.equal(
93+
'2021-05-10T17:01:35.891Z'
94+
);
95+
});
96+
8597
// TODO(klimt): Make this test more interesting once we have a complex type
8698
// that can be created in JavaScript.
8799
it('encodes array', () => {
@@ -111,12 +123,14 @@ describe('Serializer', () => {
111123
encode({
112124
foo: 1,
113125
bar: 'hello',
114-
baz: [1, 2, 3]
126+
baz: [1, 2, 3],
127+
date: new Date(1620666095891)
115128
})
116129
).to.deep.equal({
117130
foo: 1,
118131
bar: 'hello',
119-
baz: [1, 2, 3]
132+
baz: [1, 2, 3],
133+
date: '2021-05-10T17:01:35.891Z'
120134
});
121135
});
122136

@@ -132,12 +146,14 @@ describe('Serializer', () => {
132146
value: '1099511627776',
133147
'@type': 'type.googleapis.com/google.protobuf.Int64Value'
134148
}
135-
]
149+
],
150+
date: '2021-05-10T17:01:35.891Z'
136151
})
137152
).to.deep.equal({
138153
foo: 1,
139154
bar: 'hello',
140-
baz: [1, 2, 1099511627776]
155+
baz: [1, 2, 1099511627776],
156+
date: '2021-05-10T17:01:35.891Z'
141157
});
142158
});
143159

packages-exp/functions-exp/src/serializer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ export function encode(data: unknown): unknown {
5656
if (Object.prototype.toString.call(data) === '[object String]') {
5757
return data;
5858
}
59+
if (data instanceof Date) {
60+
return data.toISOString();
61+
}
5962
if (Array.isArray(data)) {
6063
return data.map(x => encode(x));
6164
}

packages-exp/installations-compat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"@firebase/installations-exp": "0.0.900",
5353
"@firebase/installations-types": "0.3.4",
5454
"@firebase/util": "1.1.0",
55-
"@firebase/component": "0.5.0",
55+
"@firebase/component": "0.5.1",
5656
"idb": "3.0.2",
5757
"tslib": "^2.1.0"
5858
},

packages-exp/installations-exp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
},
5757
"dependencies": {
5858
"@firebase/util": "1.1.0",
59-
"@firebase/component": "0.5.0",
59+
"@firebase/component": "0.5.1",
6060
"idb": "3.0.2",
6161
"tslib": "^2.1.0"
6262
},

packages-exp/messaging-compat/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
"test:karma": "karma start --single-run",
2626
"test:debug": "karma start --browsers=Chrome --auto-watch",
2727
"type-check": "tsc --noEmit",
28-
"add-compat-overloads": "ts-node-script ../../scripts/exp/create-overloads.ts -i ../messaging-exp/dist/messaging-exp-public.d.ts -o dist/src/index.d.ts -a -r FirebaseMessaging:MessagingCompat -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/messaging"
28+
"add-compat-overloads": "ts-node-script ../../scripts/exp/create-overloads.ts -i ../messaging-exp/dist/index-public.d.ts -o dist/src/index.d.ts -a -r FirebaseMessaging:MessagingCompat -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/messaging"
2929
},
3030
"peerDependencies": {
3131
"@firebase/app-compat": "0.x"
3232
},
3333
"dependencies": {
3434
"@firebase/messaging-exp": "0.0.900",
35-
"@firebase/component": "0.5.0",
35+
"@firebase/component": "0.5.1",
3636
"@firebase/installations-exp": "0.0.900",
3737
"@firebase/util": "1.1.0",
3838
"tslib": "^2.1.0"

packages-exp/messaging-exp/api-extractor.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@
88
}],
99
"dtsRollup": {
1010
/**
11-
* rollup is not supported when multiple entry points are present
11+
* rollup is not supported when multiple entry points are present.
12+
* npm script api-report:rollup is used to generate dts rollup.
1213
*/
1314
"enabled": false
14-
}
15+
},
16+
"apiReport": {
17+
/**
18+
* apiReport is handled by npm script api-report:rollup
19+
*/
20+
"enabled": false
21+
}
1522
}

0 commit comments

Comments
 (0)