Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(angular): Added missing types for angular #175

Merged
merged 74 commits into from
Mar 18, 2025
Merged
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
7ec6f9d
Fixed autocomplete
maneesht Jan 7, 2025
65e7b8f
Merge branch 'invertase:main' into main
maneesht Jan 15, 2025
488f41b
Added tsup configuration
maneesht Jan 16, 2025
b0b6667
Added tsconfig.json
maneesht Jan 16, 2025
677f024
WIP
maneesht Jan 17, 2025
5909920
First pass at angular query
maneesht Jan 17, 2025
e184206
Fixed auto-reload queries
maneesht Jan 17, 2025
f91922d
second run-through of tanstack query
maneesht Jan 22, 2025
7805595
Added comments
maneesht Jan 22, 2025
76f4a48
Added tracking to fdc
maneesht Jan 31, 2025
d8abab8
Removed angular changes
maneesht Jan 31, 2025
3ac4aaf
Upped the required version of firebase
maneesht Feb 6, 2025
5b1dcaf
updated to use 11.3.0
maneesht Feb 6, 2025
05f0e26
Used correct enums
maneesht Feb 6, 2025
f61a973
reverted prelude changes
maneesht Feb 6, 2025
4560e26
Removed only
maneesht Feb 6, 2025
9849005
completed first pass
maneesht Feb 15, 2025
88d6c76
First pass at angular framework
maneesht Feb 19, 2025
154727e
Fixed typings
maneesht Feb 20, 2025
83d9df2
Merge branch 'main' into mtewani/tanstack-query-angular
maneesht Feb 20, 2025
eaf7b23
Merge pull request #1 from maneesht/mtewani/tanstack-query-angular
maneesht Feb 20, 2025
bbc39c4
Added tracking
maneesht Feb 20, 2025
141c013
Merge branch 'main' of https://github.com/maneesht/tanstack-query-fir…
maneesht Feb 20, 2025
485de2b
Merge remote-tracking branch 'upstream/main'
maneesht Feb 20, 2025
7f7d047
Fixed testing workflow
maneesht Feb 20, 2025
0864b63
Fixed more tests
maneesht Feb 20, 2025
a3c76bc
Addressed comments
maneesht Feb 21, 2025
f7128b0
Fixed react tests
maneesht Feb 21, 2025
34a6e23
Added firebase files
maneesht Feb 21, 2025
0fe85cb
Added custom injector
maneesht Feb 24, 2025
093bcca
Moved firebase files outside of individual folders
maneesht Feb 24, 2025
e6ff147
Wrote script to copy package.json
maneesht Feb 24, 2025
56ae653
Added missing file
maneesht Feb 24, 2025
714f3b2
Brought back dataconnect-sdk in workspace
maneesht Feb 24, 2025
f246a1e
removed unnecessary js files
maneesht Feb 24, 2025
8c59966
Updated to use workspaces
maneesht Feb 25, 2025
f1c59a0
Fix wrong reporting
maneesht Feb 26, 2025
b33ff67
Fix runner
maneesht Feb 26, 2025
a0a4e55
Fix reading of logs
maneesht Feb 26, 2025
4744954
Fix angular test
maneesht Feb 26, 2025
85b8380
Miscellaneous cleanup
maneesht Feb 26, 2025
9636283
Fixed lockfile
maneesht Feb 26, 2025
73dba77
chore: Linting fixes
Ehesp Mar 3, 2025
fd72f5c
chore: Update release flow
Ehesp Mar 3, 2025
0fee12b
chore: Build flow
Ehesp Mar 3, 2025
7672e33
Moved dataconnect to dev deps
maneesht Mar 3, 2025
1a40a71
Updated lock file
maneesht Mar 3, 2025
157efcc
Updated package.json to include build scripts
maneesht Mar 3, 2025
276989d
Update packages/angular/package.json
Ehesp Mar 4, 2025
c348aa4
chore: Simplify build flow
Ehesp Mar 4, 2025
c6fd554
Merge branch 'main' of https://github.com/maneesht/tanstack-query-fir…
Ehesp Mar 4, 2025
dc23557
Revert "chore: Simplify build flow"
maneesht Mar 4, 2025
9c064a3
Fixed generation and updated README
maneesht Mar 4, 2025
07b8813
Removed peer dependency on firebase
maneesht Mar 4, 2025
45b7980
Updated lockfile
maneesht Mar 4, 2025
c13a820
Removed copyToBuild file
maneesht Mar 4, 2025
e776c66
Added error log
maneesht Mar 4, 2025
091c9a7
Addressed comments
maneesht Mar 7, 2025
dccd474
Updated biome formatting
maneesht Mar 7, 2025
e1a1764
Moved tanstack to peer dependency
maneesht Mar 8, 2025
f543220
First pass at including resultmeta
maneesht Mar 12, 2025
3c9576c
Fixed all tests etc.
maneesht Mar 13, 2025
441dc1f
Wrote tests for resultMeta
maneesht Mar 13, 2025
cab1d1b
Cleaned up types
maneesht Mar 13, 2025
95a7eae
Removed TODO
maneesht Mar 13, 2025
bbde853
Added types
maneesht Mar 13, 2025
4e3ef04
Merge remote-tracking branch 'upstream/main'
maneesht Mar 13, 2025
5a267e4
WIP
maneesht Mar 14, 2025
e217340
WIP
maneesht Mar 14, 2025
457d063
Updated signatures to allow for dataConnectResult
maneesht Mar 14, 2025
cfecfeb
Rename types
maneesht Mar 14, 2025
af1e36b
Addressed concerns
maneesht Mar 17, 2025
b913f0a
Merge remote-tracking branch 'upstream/main'
maneesht Mar 18, 2025
18954b7
Updated types
maneesht Mar 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added types
  • Loading branch information
maneesht committed Mar 13, 2025
commit bbde85381144dbfb2acde99de7ced6f064d91b6d
66 changes: 66 additions & 0 deletions packages/angular/src/data-connect/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import type { MutationResult, OpResult, QueryResult } from "firebase/data-connect";

// Reserved keys such as ref, source, fetchtime
export type ReservedQueryKeys = keyof FlattenedQueryData<undefined, QueryResult<undefined, undefined>> & string;

// If there are no reserved fields used, the Meta type should be undefined.
export type QueryResultMeta<Data> = keyof Data &
ReservedQueryKeys extends never
? undefined
: QueryResultMetaObject<Data>;

// Result Meta Object storing all reserved fields.
export type QueryResultMetaObject<Data> = {
[key in keyof Data & ReservedQueryKeys]: Data[key];
};

export type FlattenedQueryData<Data, Variables> = FlattenData<Data, QueryResult<Data, Variables>>;

export type FlattenData<Data, OperationResult extends OpResult<Data>> = Omit<OperationResult, 'data' | 'toJSON'> & Data;

// Flattens a QueryResult data down into a single object.
// This is to prevent query.data.data, and also expose additional properties.
export type FlattenedQueryResult<Data, Variables> = FlattenedQueryData<
Data,
Variables
> & {
resultMeta: QueryResultMeta<Data>
}

// Reserved keys such as ref, source, fetchtime
export type ReservedMutationKeys = keyof FlattenedMutationData<undefined, MutationResult<undefined, undefined>> & string;

// If there are no reserved fields used, the Meta type should be undefined.
export type MutationResultMeta<Data> = keyof Data &
ReservedMutationKeys extends never
? undefined
: MutationResultMetaObject<Data>;

// Result Meta Object storing all reserved fields.
export type MutationResultMetaObject<Data> = {
[key in keyof Data & ReservedMutationKeys]: Data[key];
};

export type FlattenedMutationData<Data, Variables> = FlattenData<Data, MutationResult<Data, Variables>>;

// Flattens a MutationResult data down into a single object.
// This is to prevent mutation.data.data, and also expose additional properties.
export type FlattenedMutationResult<Data, Variables> = FlattenedMutationData<
Data,
Variables
> & {
resultMeta: MutationResultMeta<Data>
}

export const RESERVED_QUERY_FIELDS: ReservedQueryKeys[] = [
"ref",
"fetchTime",
"source",
'asdf'
];

export const RESERVED_MUTATION_FIELDS: ReservedMutationKeys[] = [
"ref",
"fetchTime",
"source",
];