Skip to content

Commit 26fbba0

Browse files
committed
Merge branch 'main' into docs/lcg
2 parents 7d8c34e + 31abbba commit 26fbba0

294 files changed

Lines changed: 4654 additions & 1173 deletions

File tree

Some content is hidden

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

.github/workflows/treeshake-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111

1212
jobs:
1313
treeshake-test:
14+
if: github.event.pull_request.head.repo.full_name == github.repository
1415
permissions:
1516
contents: read
1617
issues: write

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ yarn-error.log*
3131
.DS_Store
3232
.idea
3333
.husky
34+
35+
# agents
36+
.claude

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ pnpm publish --dry-run # (if alpha, --tag alpha)
4343
```
4444

4545
5. If everything looks okay, then `pnpm publish` (if alpha, `--tag alpha`)
46+
47+
> **Tip:** If you already know all prepublish checks pass (tests, types, publish tag validation), you can skip them to speed up
48+
> publishing:
49+
>
50+
> ```bash
51+
> SKIP_ALL_CHECKS=true pnpm publish # (if alpha, --tag alpha)
52+
> ```
53+
4654
6. Rebase _release_ branch on _main_
4755
7. Generate and edit release notes on GitHub
4856
8. Run `npx automd@latest`

apps/infra-benchmarks/deno.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

apps/treeshake-test/deno.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

apps/treeshake-test/resultsTable.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ export class ResultsTable {
5050
}
5151
output += ' |\n';
5252

53-
for (const [test, row] of this.#results.entries()) {
53+
const sortedResults = [...this.#results.entries()]
54+
.map(([test, row]) => [test, row, this.#maxAbsoluteChange(row)] as const)
55+
.toSorted(([, , scoreA], [, , scoreB]) => scoreB - scoreA)
56+
.map(([test, row]) => [test, row] as const);
57+
58+
for (const [test, row] of sortedResults) {
5459
output += `| ${test.replaceAll('_', ' ')}`;
5560

5661
for (const bundler of this.#bundlers) {
@@ -78,6 +83,16 @@ ${output}
7883
return output;
7984
}
8085

86+
#maxAbsoluteChange(row: Row): number {
87+
let max = 0;
88+
for (const { pr, target } of row.values()) {
89+
if (pr !== undefined && target !== undefined && target !== 0) {
90+
max = Math.max(max, Math.abs((pr - target) / target));
91+
}
92+
}
93+
return max;
94+
}
95+
8196
#isInteresting(row: Row) {
8297
for (const cell of row) {
8398
const pr = cell[1].pr;

apps/typegpu-docs/astro.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ export default defineConfig({
170170
label: 'Slots',
171171
slug: 'fundamentals/slots',
172172
},
173+
{
174+
label: 'Accessors',
175+
slug: 'fundamentals/accessors',
176+
},
173177
{
174178
label: 'Utilities',
175179
slug: 'fundamentals/utils',

apps/typegpu-docs/deno.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

apps/typegpu-docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"magic-string": "^0.30.21",
8484
"tailwindcss": "^4.1.11",
8585
"tailwindcss-motion": "^1.1.1",
86+
"typegpu-testing-utility": "workspace:*",
8687
"vite-imagetools": "catalog:frontend",
8788
"vite-plugin-wasm": "^3.5.0",
8889
"yaml": "^2.8.1"

apps/typegpu-docs/src/components/ControlPanel.tsx

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import cs from 'classnames';
22
import { useAtom, useAtomValue, useSetAtom } from 'jotai';
3+
import DiscordIconSvg from '../assets/discord-icon.svg';
4+
import GithubIconSvg from '../assets/github-icon.svg';
35
import { useId, useState } from 'react';
46
import { runWithCatchAtom } from '../utils/examples/currentSnackbarAtom.ts';
57
import {
@@ -86,7 +88,7 @@ function SliderRow({
8688
);
8789
}
8890

89-
function VectorSliderRow({
91+
function VectorSliderRow<T extends d.v2f | d.v3f | d.v4f>({
9092
label,
9193
initial,
9294
min,
@@ -95,13 +97,13 @@ function VectorSliderRow({
9597
onChange,
9698
}: {
9799
label: string;
98-
initial: number[];
99-
min: number[];
100-
max: number[];
101-
step: number[];
102-
onChange: (value: number[]) => void;
100+
initial: T;
101+
min: T;
102+
max: T;
103+
step: T;
104+
onChange: (value: T) => void;
103105
}) {
104-
const [value, setValue] = useState<number[]>(initial ?? min);
106+
const [value, setValue] = useState<T>(initial);
105107
const runWithCatch = useSetAtom(runWithCatchAtom);
106108

107109
return (
@@ -114,8 +116,8 @@ function VectorSliderRow({
114116
step={step}
115117
value={value}
116118
onChange={(newValue) => {
117-
setValue(newValue);
118-
void runWithCatch(() => onChange(newValue));
119+
setValue(newValue as T);
120+
void runWithCatch(() => onChange(newValue as T));
119121
}}
120122
/>
121123
</>
@@ -246,7 +248,7 @@ function paramToControlRow(param: ExampleControlParam) {
246248
<VectorSliderRow
247249
key={param.label}
248250
label={param.label}
249-
onChange={param.onVectorSliderChange}
251+
onChange={param.onVectorSliderChange as (value: d.v2f | d.v3f | d.v4f) => void}
250252
min={param.min}
251253
max={param.max}
252254
step={param.step}
@@ -328,6 +330,18 @@ export function ControlPanel() {
328330
</div>
329331
</>
330332
)}
333+
334+
<div className="mt-auto hidden items-center justify-between pt-2 text-tameplum-800 text-xs md:flex">
335+
<div>&copy; {new Date().getFullYear()} Software Mansion S.A.</div>
336+
<div className="flex items-center gap-3">
337+
<a href="https://discord.gg/8jpfgDqPcM" target="_blank" rel="noreferrer">
338+
<img src={DiscordIconSvg.src} className="opacity-75" alt="discord logo" />
339+
</a>
340+
<a href="https://github.com/software-mansion/TypeGPU" target="_blank" rel="noreferrer">
341+
<img src={GithubIconSvg.src} className="opacity-75" alt="github logo" />
342+
</a>
343+
</div>
344+
</div>
331345
</div>
332346
);
333347
}

0 commit comments

Comments
 (0)