deck.gl: decide what the umbrella package exports from @deck.gl/react in v10
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 8/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- react, typescript
- Domain
- data-visualization, frontend
Research direction
This is a design decision, not a code change. Start with modules/main/src/index.ts, which re-exports DeckGL and the types from @deck.gl/react/legacy, and with the react peer range in the umbrella's package.json. Read the findings on React 18 import failures and the React Server Components note before proposing an option. Done means the decision is recorded in this issue and the umbrella exports, peer range, upgrade guide and What's new all match it.
Written by the indexing model from the issue text.
Description
Background
The deck.gl umbrella package still exports the previous React API (modules/main/src/index.ts):
export {default, DeckGL} from '@deck.gl/react/legacy';
export type {DeckGLProps, DeckGLRef, DeckGLContextValue} from '@deck.gl/react/legacy';
So in v10, import {DeckGL} from 'deck.gl' gives the previous API, while the docs and examples teach DeckGL from @deck.gl/react. The get-started basic app was a legacy app for this reason until #11320. We need to decide what the umbrella exports before v10.
Options being investigated
- Switch to the new renderer.
DeckGLfromdeck.glis the@deck.gl/reactroot, and the previous API is exported asDeckGLLegacy. - Keep the previous API for v10. Switch in v11, when
/legacyis removed. - Stop exporting React from the umbrella. React apps import
@deck.gl/reactdirectly, and the umbrella drops itsreactpeer.
With option 1 or 2, two more questions:
- The default export.
import DeckGL from 'deck.gl'is common in v9 code. It could be removed (@deck.gl/reacthas only named exports, so old code fails at build with a clear error), point at the new renderer, or stay on the previous API. - The types.
DeckGLPropswould come from@deck.gl/react.DeckGLRefandDeckGLContextValueexist only in the previous API.
Findings so far
Tested with the published 10.0.0-alpha.2 packages and a local stand-in for a switched umbrella:
- Bundled apps are unaffected. The umbrella is
sideEffects: false. A React 18 app built with Vite that imports only layers, or the previous API, from a switched umbrella doesn't bundlereact-reconcilerand renders with no errors. - Unbundled imports on React 16.3 to 18 would break with option 1. Importing the
@deck.gl/reactroot on React 18 throws at load:Cannot read properties of undefined (reading 'S')fromreact-reconciler. An ESM import of the umbrella loads every re-export, so Node SSR or Jest and Vitest tests that importdeck.glwould throw, even for code that only uses layers. The previous API loads on React 18. - The peer ranges already disagree.
@deck.gl/reactpeers onreact ^19.2.0for the whole package,/legacyincluded (#11036), while the umbrella declares an optionalreact >=16.3.0. - React Server Components already fail. Under the
react-servercondition, both the new renderer and the previous API throw at import, so importingdeck.glfrom a server component fails today with option 1 or 2. Only option 3 changes that.
Done when
The decision is recorded here, and modules/main exports, its react peer range, the upgrade guide and What's new match it.
- Dominant language
- TypeScript
- Stars
- 14.8k
- Forks
- 2.3k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 230
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from visgl/deck.gl
-
[Bug] Tile3DLayer selects no tiles until the camera moves when tileset.json loads right after a layer updatePossibly taken @lee3Q claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
[Bug] SplitterWidget calls onDragStart on drag end; Deck._getViews writes into the app's views arrayPossibly taken @04jennet-coder claimed this 20 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
[Bug] WMSLayer positions EPSG:4326 images as CARTESIANPossibly taken @athomct claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
[Bug] MapLibreOverlay under React StrictMode: 'WebGL context already attached to device' because the attach path omits _reuseDevicesPossibly taken @jsve claimed this 84 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
visgl/deck.gl#10681 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
accessibility area:ci ci-test level:low priority:high type:test
Difficulty 2/5 1-3 hours Newbie friendliness 71/100
skytuhua-org/Gen-V1#3132 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
drmrd/vernacular#1238 ·
Maintainers usually reply within 1 day
-
question
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
enhancement migration-prioritized
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Hudson-Pufferfish/local-party-console#136 ·
Maintainers usually reply within 1 day
-
priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day