Skip to content

Commit 2075363

Browse files
committed
get tests running
1 parent 7dd3ace commit 2075363

13 files changed

+7504
-7032
lines changed

package-lock.json

Lines changed: 7453 additions & 6978 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "4.2.3",
2+
"version": "4.3.3",
33
"license": "MIT",
44
"type": "module",
55
"main": "dist/index.umd.cjs",
@@ -15,7 +15,7 @@
1515
"src"
1616
],
1717
"engines": {
18-
"node": ">=14"
18+
"node": ">=18"
1919
},
2020
"scripts": {
2121
"start": "firebase emulators:exec --project=rxfire-525a3 \"vitest --ui\"",
@@ -36,8 +36,8 @@
3636
"docs:fork": "typedoc --options typedoc.json --gitRemote upstream && markdown-toc -i docs/use.md"
3737
},
3838
"peerDependencies": {
39-
"firebase": "^9.0.0 || next",
40-
"react": ">=16 || experimental"
39+
"firebase": "^11.0.0",
40+
"react": "^18 || ^19"
4141
},
4242
"husky": {
4343
"hooks": {
@@ -71,44 +71,44 @@
7171
}
7272
],
7373
"devDependencies": {
74-
"@rollup/plugin-typescript": "^11.1.1",
75-
"@size-limit/preset-small-lib": "^8.2.6",
76-
"@testing-library/jest-dom": "^5.16.5",
77-
"@testing-library/react": "^14.0.0",
78-
"@types/react": "^18.2.0",
79-
"@types/react-dom": "^18.2.0",
80-
"@types/use-sync-external-store": "^0.0.3",
81-
"@typescript-eslint/eslint-plugin": "^5.60.1",
82-
"@typescript-eslint/parser": "^5.60.1",
83-
"@vitejs/plugin-react": "^4.0.1",
74+
"@rollup/plugin-typescript": "^12.1.2",
75+
"@size-limit/preset-small-lib": "^11.2.0",
76+
"@testing-library/jest-dom": "^6.6.3",
77+
"@testing-library/react": "^16.3.0",
78+
"@types/react": "^19.1.3",
79+
"@types/react-dom": "^19.1.3",
80+
"@types/use-sync-external-store": "^1.5.0",
81+
"@typescript-eslint/eslint-plugin": "^8.32.0",
82+
"@typescript-eslint/parser": "^8.32.0",
83+
"@vitejs/plugin-react": "^4.4.1",
8484
"@vitest/ui": "^3.1.3",
85-
"cross-fetch": "^3.1.6",
86-
"eslint": "^8.43.0",
87-
"eslint-plugin-no-only-tests": "^3.1.0",
88-
"eslint-plugin-react": "^7.32.2",
89-
"eslint-plugin-react-hooks": "^4.6.0",
90-
"firebase": "^9.23.0",
91-
"firebase-tools": "^12.4.0",
92-
"globalthis": "^1.0.3",
93-
"husky": "^8.0.3",
94-
"jest-environment-jsdom": "^29.5.0",
85+
"cross-fetch": "^4.1.0",
86+
"eslint": "^9.26.0",
87+
"eslint-plugin-no-only-tests": "^3.3.0",
88+
"eslint-plugin-react": "^7.37.5",
89+
"eslint-plugin-react-hooks": "^5.2.0",
90+
"firebase": "^11.7.1",
91+
"firebase-tools": "^14.3.0",
92+
"globalthis": "^1.0.4",
93+
"husky": "^9.1.7",
94+
"jest-environment-jsdom": "^29.7.0",
9595
"jsdom": "^26.1.0",
9696
"markdown-toc": "^1.2.0",
97-
"prettier": "^2.8.8",
98-
"react": "^18.2.0",
99-
"react-dom": "^18.2.0",
100-
"react-test-renderer": "^18.2.0",
101-
"rollup-plugin-visualizer": "^5.9.2",
102-
"size-limit": "^8.2.6",
103-
"typedoc": "^0.24.8",
104-
"typedoc-plugin-markdown": "^3.15.3",
105-
"typescript": "^5.1.3",
106-
"vite": "^4.3.9",
97+
"prettier": "^3.5.3",
98+
"react": "^19.1.0",
99+
"react-dom": "^19.1.0",
100+
"react-test-renderer": "^19.1.0",
101+
"rollup-plugin-visualizer": "^5.14.0",
102+
"size-limit": "^11.2.0",
103+
"typedoc": "^0.28.4",
104+
"typedoc-plugin-markdown": "^4.6.3",
105+
"typescript": "^5.8.3",
106+
"vite": "^6.3.5",
107107
"vitest": "^3.1.3"
108108
},
109109
"dependencies": {
110-
"rxfire": "^6.0.3",
111-
"rxjs": "^6.6.3 || ^7.0.1",
112-
"use-sync-external-store": "^1.2.0"
110+
"rxfire": "^6.1.0",
111+
"rxjs": "^7.8.2",
112+
"use-sync-external-store": "^1.5.0"
113113
}
114114
}

src/auth.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export function ClaimsCheck({ user, fallback, children, requiredClaims }: Claims
244244
*
245245
* Meant for Concurrent mode only (`<FirebaseAppProvider suspense=true />`). [More detail](https://github.com/FirebaseExtended/reactfire/issues/325#issuecomment-827654376).
246246
*/
247-
export function AuthCheck({ fallback, children, requiredClaims }: AuthCheckProps): JSX.Element {
247+
export function AuthCheck({ fallback, children, requiredClaims }: AuthCheckProps): React.JSX.Element {
248248
const { data: user } = useUser<User>();
249249

250250
const suspenseMode = useSuspenseEnabledFromConfigAndContext();

src/firebaseApp.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { getApps, initializeApp, registerVersion } from 'firebase/app';
33

44
import type { FirebaseApp, FirebaseOptions } from 'firebase/app';
55

6+
import {version as pkgVersion} from '../package.json';
7+
68
// INVESTIGATE I don't like magic strings, can we have export this in js-sdk?
79
const DEFAULT_APP_NAME = '[DEFAULT]';
810

@@ -16,8 +18,7 @@ export interface FirebaseAppProviderProps {
1618
suspense?: boolean;
1719
}
1820

19-
// REACTFIRE_VERSION is automatically pulled in from `package.json` by Vite
20-
export const version = process.env.REACTFIRE_VERSION as string;
21+
export const version = pkgVersion;
2122

2223
const shallowEq = (a: { [key: string]: any }, b: { [key: string]: any }) => a === b || [...Object.keys(a), ...Object.keys(b)].every((key) => a[key] === b[key]);
2324

src/performance.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface SuspensePerfProps {
66
fallback: React.ReactNode;
77
}
88

9-
export function SuspenseWithPerf({ children, traceId, fallback }: SuspensePerfProps): JSX.Element {
9+
export function SuspenseWithPerf({ children, traceId, fallback }: SuspensePerfProps): React.JSX.Element {
1010
// TODO: Should this import firebase/performance?
1111

1212
const entries = performance?.getEntriesByName?.(traceId, 'measure') || [];

src/storage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export type StorageImageProps = {
3737
storagePath: string;
3838
storage?: FirebaseStorage;
3939
suspense?: boolean;
40-
placeHolder?: JSX.Element;
40+
placeHolder?: React.JSX.Element;
4141
};
4242

4343
function StorageFromContext(props: StorageImageProps & React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>) {
@@ -48,7 +48,7 @@ function StorageFromContext(props: StorageImageProps & React.DetailedHTMLProps<R
4848
return <INTERNALStorageImage {...props} />;
4949
}
5050

51-
function INTERNALStorageImage(props: StorageImageProps & React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>): JSX.Element {
51+
function INTERNALStorageImage(props: StorageImageProps & React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>): React.JSX.Element {
5252
const { storage, storagePath, suspense, placeHolder, ...imgProps } = props;
5353

5454
const reactfireOptions: ReactFireOptions<string> = {

test/auth.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { cleanup, render, waitFor, renderHook, act } from '@testing-library/react';
2-
import '@testing-library/jest-dom/extend-expect';
2+
import '@testing-library/jest-dom';
33
import * as React from 'react';
44
import {
55
FirebaseAppProvider,

test/firebaseApp.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { cleanup, render, waitFor, renderHook } from '@testing-library/react';
22
import { initializeApp, deleteApp, getApps } from 'firebase/app';
3-
import '@testing-library/jest-dom/extend-expect';
3+
import '@testing-library/jest-dom';
44
import * as React from 'react';
55
import { useFirebaseApp, FirebaseAppProvider, version } from '../src/index';
66
import pkg from '../package.json';

test/firestore.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { renderHook, act, cleanup, waitFor } from '@testing-library/react';
22

33
import * as React from 'react';
4-
import '@testing-library/jest-dom/extend-expect';
4+
import '@testing-library/jest-dom';
55
import {
66
useFirestoreDoc,
77
useFirestoreCollection,

test/useObservable.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '@testing-library/jest-dom/extend-expect';
1+
import '@testing-library/jest-dom';
22
import { act, cleanup, render, renderHook, waitFor } from '@testing-library/react';
33
import * as React from 'react';
44
import { of, Subject, BehaviorSubject, throwError } from 'rxjs';
@@ -317,7 +317,7 @@ describe('useObservable', () => {
317317
expect(refreshedComp).toBeInTheDocument();
318318

319319
// if useObservable doesn't re-emit, the value here will still be "Jeff"
320-
expect(refreshedComp).toHaveTextContent('James');
320+
await waitFor(() => expect(refreshedComp).toHaveTextContent('James'));
321321
});
322322
});
323323
});

0 commit comments

Comments
 (0)