This repository has been archived by the owner on Aug 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Examples can have sub examples, nested ui layout
- Loading branch information
1 parent
6a7bdf5
commit 48d985c
Showing
11 changed files
with
688 additions
and
148 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,43 @@ | ||
import React from 'react' | ||
|
||
import '@etherealengine/client-core/src/world/LocationModule' | ||
import AvatarBenchmarkEntry from './benchmarks/avatarBenchmark' | ||
import AvatarIKBenchmarkEntry from './benchmarks/avatarIKBenchmark' | ||
import HeapBenchmarkEntry from './benchmarks/heapBenchmark' | ||
import ParticlesBenchmarkEntry from './benchmarks/particlesBenchmark' | ||
import PhysicsBenchmarkEntry from './benchmarks/physicsBenchmark' | ||
import Routes, { RouteData } from './sceneRoute' | ||
|
||
const prefix = './benchmarks/' | ||
|
||
//@ts-ignore | ||
const importedMetadata = import.meta.glob<any>('./benchmarks/*.tsx', { | ||
import: 'metadata', | ||
eager: true | ||
}) | ||
|
||
//@ts-ignore | ||
const imports = import.meta.glob<any>('./benchmarks/*.tsx') | ||
const routes = Object.entries(imports).reduce( | ||
(prev, [route, lazy]) => ({ | ||
...prev, | ||
[route]: { page: React.lazy(lazy), metadata: importedMetadata[route] } as RouteData | ||
}), | ||
{} | ||
) as Record<string, RouteData> | ||
export const benchmarks: RouteData[] = [ | ||
{ | ||
name: 'Avatar Benchmark', | ||
description: '', | ||
entry: AvatarBenchmarkEntry | ||
}, | ||
{ | ||
name: 'Avatar IK Benchmark', | ||
description: '', | ||
entry: AvatarIKBenchmarkEntry | ||
}, | ||
{ | ||
name: 'Particles Benchmark', | ||
description: '', | ||
entry: ParticlesBenchmarkEntry | ||
}, | ||
{ | ||
name: 'Physics Benchmark', | ||
description: '', | ||
entry: PhysicsBenchmarkEntry | ||
}, | ||
{ | ||
name: 'Heap Benchmark', | ||
description: '', | ||
entry: HeapBenchmarkEntry | ||
} | ||
] | ||
|
||
const BenchmarkRoutes = () => { | ||
return <Routes routes={routes} prefix={prefix} header="Benchmarks" /> | ||
return <Routes routes={benchmarks} header="Benchmarks" /> | ||
} | ||
|
||
export default BenchmarkRoutes |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.