Skip to content

Commit 4948c2a

Browse files
committed
initial
0 parents  commit 4948c2a

File tree

69 files changed

+6102
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+6102
-0
lines changed

.eslintrc.cjs

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* eslint-env node */
2+
3+
module.exports = {
4+
root: true,
5+
env: { browser: true, es2020: true },
6+
extends: [
7+
'eslint:recommended',
8+
'plugin:@typescript-eslint/recommended',
9+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
10+
'plugin:react-hooks/recommended',
11+
],
12+
parser: '@typescript-eslint/parser',
13+
parserOptions: {
14+
ecmaVersion: 'latest',
15+
sourceType: 'module',
16+
project: true,
17+
tsconfigRootDir: __dirname,
18+
},
19+
plugins: ['react-refresh'],
20+
rules: {
21+
'react-refresh/only-export-components': [
22+
'warn',
23+
{ allowConstantExport: true },
24+
],
25+
'@typescript-eslint/no-non-null-assertion': 'off',
26+
},
27+
}

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# CSS selector performance bench
2+
3+
This app contains a demo usages of different types of CSS selectors to show the performance impact of them. Each example has:
4+
5+
* Bad example - selector that can incur cost
6+
* Good example - applying style rules directly on elemnts using CSS classes
7+
8+
## Start
9+
10+
* npm install
11+
* npm run dev
12+
* visit http://localhost:5713
13+
14+
15+
## Usage
16+
17+
The examples follow a consistent pattern to help with profiling. Each example has a single `toggle` button that performs some kind of CSS/DOM mutation that should be profiled to check the affected elements and selector matching in a performance profile.
18+
19+
Each scenario has a README that describes the intention behind the example and what the impacts are.
20+
21+
Each example is located under the `src/scenarios` folder.

index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React + TS</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)