software-mansion / software-mansion/TypeGPU
docs: Figure out what behavior we want for isGPUSupported for SSR
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.2k
- Forks
- 122
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 34
Description
const adapter = await navigator.gpu?.requestAdapter();
adapter?.requestDevice().then((device) => device.destroy());
export const isGPUSupported = !!adapter;
This code returns false if the navigator does not have the gpu field at all (for Node >20) but for Node<=20 it will throw an error since navigator is not a thing there. Maybe we should handle this case better to avoid confusion in the future.
Update:
What does this even do?
adapter?.requestDevice().then((device) => device.destroy());
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the TypeScript definition of isGPUSupported and inspect how SSR and Node environments reach it. Compare the navigator behavior described for Node <=20 and Node >20, and clarify the purpose of the requestAdapter/requestDevice sequence. Done means the supported SSR behavior and the intended handling of missing navigator.gpu are explicitly decided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100