Skip to content

Releases: tylim88/FirelordJS

2.9.1

09 May 17:02
b69c24b

Choose a tag to compare

return reference equality checks

2.9.0

09 May 06:23
a447ac1

Choose a tag to compare

update peer dependencies firebase to v11

remove equality checks and some tests

2.8.18

25 Apr 02:27

Choose a tag to compare

Firelord React Native

  1. fixed some field values being exported as object instead of function

Firelord Admin

  1. simplify internal field values type

Firelord Web

  1. no changes

2.8.15

15 Apr 21:54

Choose a tag to compare

remove document path trailing slash, it used to be 'a/b/c/d/', now it is 'a/b/c'

2.8.7

24 Mar 17:29

Choose a tag to compare

fix nested object in mapped type is not partial in update

type DU = MetaTypeCreator<Record<string, { k: Record<`${1 | 2 | 3}`, number> }>, 'abc'>
const du = getFirelord<DU>(getFirestore(), 'abc')
const docRef = du.doc('123')

updateDoc(docRef, { x: { k: { '1': 1 } } }) // unexpected error requires all properties to present, now is fixed

2.8.6

23 Mar 18:53

Choose a tag to compare

fix value of where clause top level field from discriminated unions being never

import {
	MetaTypeCreator,
	query,
	where,
} from 'firelordjs'

type DU = MetaTypeCreator<
	{ c: false } | { c: true; v: 0 },
	'abc'
>
const du = getFirelord<DU>(getFirestore(), 'abc')

query(du.collection(), where('v', '==', 0)) //should be ok but error

2.8.5

23 Mar 18:33

Choose a tag to compare

  1. export ArrayUnionOrRemove type

  2. fix discriminated union value is inferred as never in where clause

import {
	MetaTypeCreator,
	query,
	where,
} from 'firelordjs'

type DU = MetaTypeCreator<
	{ a: { b: 1; c: 2 } | { b: 'a'; d: 'b' } },
	'abc'
>
const du = getFirelord<DU>(getFirestore(), 'abc')

query(du.collection(), where('a.b', '==', 2)) // previously no error but is expected to error 

2.8.2

12 Mar 07:57

Choose a tag to compare

solved where clause unable to get all keys of object unions type

2.8.0

09 Mar 13:22

Choose a tag to compare

now require typescript 5.4.2 and above

also please change your vscode TS version to 5.4.2, guide: https://firelordjs.com/change_ts_version

2.7.0

14 Nov 21:04

Choose a tag to compare

no longer support full flattened path if the key is string

given this type:

{
  a: Record<string,{ b: number, c: { d: string } }>
}

previously firelord generates the flattened path that look like:

{
  a: Record<string,{ b: number, c: { d: string } }>
  [x : `a.${string}`]: { b: number, c: { d: string } }
  [x : `a.${string}.b`]: number
  [x : `a.${string}.c`]: { d: string }
  [x : `a.${string}.c.d`]: string
}

the problem is: a.${string}.b, a.${string}.c and a.${string}.c.d will collapsed into a.${string}

to address this issue, firelord now generates:

{
  a: Record<string, { b: number, c: { d: string }, `c.d`: string }>
}

firelord will not attempt to flatten mapped type, but will still continue to flatten any nested object literal type, in this case it is the c.d

affected operation: all update operations

Remove JSON type

JSON type is now available by accessing meta type instead: Example['readJSON']