Skip to content

feat(website): pass device to example apps - #10480

Merged
ibgreen merged 4 commits into
masterfrom
codex/website-example-device-plumbing
Jul 25, 2026
Merged

ibgreen merged 4 commits into
masterfrom
codex/website-example-device-plumbing

Conversation

@ibgreen-openai

Copy link
Copy Markdown
Collaborator

Goal

Move common device plumbing out of individual WebGPU layer-port PRs.

Changes

  • Add an optional device prop to the 26 standalone website demo apps that did not already have one.
  • Pass that device through to each demo's DeckGL component.
  • Keep the existing device-enabled examples unchanged.

After this PR, every standalone website example that owns a DeckGL instance can opt into DeviceTabs without 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 build
  • yarn test-website
  • yarn eslint examples/website/*/app.tsx examples/website/*/app.jsx
  • yarn prettier --check examples/website/*/app.tsx examples/website/*/app.jsx
  • Full pre-commit lint/format and Node test gate

@ibgreen-openai
ibgreen-openai marked this pull request as ready for review July 24, 2026 13:59
@coveralls

coveralls commented Jul 24, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 83.393% (+0.007%) from 83.386% — codex/website-example-device-plumbing into master

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread examples/website/trips/app.tsx Resolved

@chrisgervang chrisgervang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small cleanup suggestions, otherwise looks good

distance = 0,
opacity = 0.2,
globeView = false
}) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prop types?

device,
data = TILESET_URL,
mapStyle = 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json'
}) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prop types?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added JSDoc prop types for device, data, and mapStyle in e078046.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not typescript types?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait.. this is still not ported to typescript for some reason

];

export default function App() {
export default function App({device}) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prop type?

Comment thread examples/website/treemap/app.tsx Outdated
import React, {useMemo} from 'react';
import {createRoot} from 'react-dom/client';
import {DeckGL} from '@deck.gl/react';
import type {Device} from '@luma.gl/core';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can we sort this in alphabetically across the examples? Or at least, not put it in the group of deck imports

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we fix the import on other examples too, @ibgreen-openai?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants