Repository navigation
feat(website): pass device to example apps - #10480
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41c0443507
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
chrisgervang
left a comment
There was a problem hiding this comment.
Small cleanup suggestions, otherwise looks good
| distance = 0, | ||
| opacity = 0.2, | ||
| globeView = false | ||
| }) { |
| device, | ||
| data = TILESET_URL, | ||
| mapStyle = 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json' | ||
| }) { |
There was a problem hiding this comment.
Added JSDoc prop types for device, data, and mapStyle in e078046.
There was a problem hiding this comment.
Why not typescript types?
There was a problem hiding this comment.
Oh wait.. this is still not ported to typescript for some reason
| ]; | ||
|
|
||
| export default function App() { | ||
| export default function App({device}) { |
| import React, {useMemo} from 'react'; | ||
| import {createRoot} from 'react-dom/client'; | ||
| import {DeckGL} from '@deck.gl/react'; | ||
| import type {Device} from '@luma.gl/core'; |
There was a problem hiding this comment.
Nit: Can we sort this in alphabetically across the examples? Or at least, not put it in the group of deck imports
There was a problem hiding this comment.
Can we fix the import on other examples too, @ibgreen-openai?
Goal
Move common device plumbing out of individual WebGPU layer-port PRs.
Changes
deviceprop to the 26 standalone website demo apps that did not already have one.DeckGLcomponent.After this PR, every standalone website example that owns a
DeckGLinstance can opt intoDeviceTabswithout changing its demo app.Mapbox/MapLibre overlay examples are intentionally excluded: their deck instance must use the host map's rendering context rather than the website's pre-created device.
Impact
No behavior change unless a caller supplies
device. Layer-port PRs can now limit their example changes to enabling the device tabs.Validation
yarn buildyarn test-websiteyarn eslint examples/website/*/app.tsx examples/website/*/app.jsxyarn prettier --check examples/website/*/app.tsx examples/website/*/app.jsx