-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal: Test TypeScript 4.0, 4.1, 4.3 (#2505)
- Loading branch information
Showing
10 changed files
with
100 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "./tsconfig", | ||
"compilerOptions": { | ||
"skipDefaultLibCheck": true, | ||
}, | ||
"include": ["typetest.ts"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { useCache, useController, useSuspense } from '@rest-hooks/react'; | ||
|
||
import { queryRemaining, TodoResource } from './src/resources/TodoResource'; | ||
import { UserResource } from './src/resources/UserResource'; | ||
|
||
function useTest() { | ||
const ctrl = useController(); | ||
const payload = { id: 1, title: '', userId: 1 }; | ||
ctrl.fetch(TodoResource.create, payload); | ||
|
||
const todos = useSuspense(TodoResource.getList, { userId: 1 }); | ||
useSuspense(TodoResource.getList); | ||
todos.map((todo) => { | ||
todo.pk(); | ||
todo.title; | ||
ctrl.fetch( | ||
TodoResource.partialUpdate, | ||
{ id: todo.id }, | ||
{ completed: true }, | ||
); | ||
}); | ||
|
||
const remaining = useCache(queryRemaining, { userId: 1 }); | ||
|
||
const users = useSuspense(UserResource.getList); | ||
users.map((user) => { | ||
user.name; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d865ad5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
normalizeLong
241
ops/sec (±0.65%
)293
ops/sec (±0.19%
)1.22
infer All
4665
ops/sec (±0.32%
)5595
ops/sec (±0.24%
)1.20
denormalizeLong
106
ops/sec (±1.52%
)136
ops/sec (±1.07%
)1.28
denormalizeLong with mixin Entity
109
ops/sec (±0.81%
)142
ops/sec (±0.82%
)1.30
denormalizeLong withCache
3396
ops/sec (±2.46%
)4845
ops/sec (±0.87%
)1.43
denormalizeLong All withCache
4020
ops/sec (±0.20%
)4786
ops/sec (±0.11%
)1.19
denormalizeLong Query-sorted withCache
4010
ops/sec (±0.36%
)4816
ops/sec (±0.50%
)1.20
getResponse
3715
ops/sec (±2.96%
)4343
ops/sec (±3.43%
)1.17
getSmallResponse
1560
ops/sec (±3.18%
)1876
ops/sec (±3.15%
)1.20
getSmallInferredResponse
1389
ops/sec (±0.15%
)1570
ops/sec (±0.09%
)1.13
getResponse Query-sorted
365
ops/sec (±1.81%
)461
ops/sec (±1.16%
)1.26
setLong
243
ops/sec (±0.25%
)295
ops/sec (±0.24%
)1.21
setLongWithMerge
95.86
ops/sec (±1.05%
)123
ops/sec (±0.38%
)1.28
setLongWithSimpleMerge
102
ops/sec (±0.82%
)133
ops/sec (±0.21%
)1.30
This comment was automatically generated by workflow using github-action-benchmark.