Skip to content

chore: Upgrade kepler deckgl v9 - #519

Merged
ilyabo merged 10 commits into
mainfrom
upgrade-kepler-deckgl-v9
Apr 11, 2026
Merged

ilyabo merged 10 commits into
mainfrom
upgrade-kepler-deckgl-v9

Conversation

@ilyabo

@ilyabo ilyabo commented Apr 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Chores

    • Bumped Deck.gl dependencies to v9.2.11 across examples
    • Updated Kepler.gl packages to v3.3.0-alpha.0
    • Configured Vite in examples to target modern JavaScript (esnext)
  • Refactor

    • Removed monorepo-specific aliasing and simplified build configs
    • Improved type safety and internal APIs for more reliable editor/interaction behavior
  • User-facing

    • Example maps now add layers with explicit settings and center the map on load

ilyabo added 2 commits April 5, 2026 10:32
Signed-off-by: Ilya Boyandin <[email protected]>
Signed-off-by: Ilya Boyandin <[email protected]>
@ilyabo ilyabo changed the title Upgrade kepler deckgl v9 chore: Upgrade kepler deckgl v9 Apr 7, 2026
@coderabbitai

coderabbitai Bot commented Apr 7, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR updates several example configs and dependencies, removes monorepo-specific Deck.gl v8 aliasing, and applies type and API adjustments in kepler packages including KeplerSlice, hooks, and store initialization changes.

Changes

Cohort / File(s) Summary
Vite Build Targets
examples/canvas-sync/vite.config.ts, examples/sync/vite.config.ts
Added build: { target: 'esnext' } to Vite configs.
Kepler Vite Config Cleanup
examples/kepler/vite.config.ts
Reordered Tailwind import and removed monorepo-only Deck.gl v8 aliasing helper (createDeckGLv8Aliases).
Deck.gl Example Dependency Bumps
examples/deckgl-discuss/package.json, examples/deckgl/package.json, examples/deckgl-mosaic/package.json
Bumped @deck.gl/* / deck.gl dependency versions to ^9.2.11.
Kepler Package Version Update
packages/kepler/package.json
Updated @kepler.gl/* package versions from 3.2.6 → 3.3.0-alpha.0.
Kepler Store Initialization
examples/kepler/src/store.ts
Refactored init to use explicit mapId, datasetId, layerId; replaced auto layer creation with explicit addTableToMap(..., { autoCreateLayers: false, centerMap: true }, layerDefinition) and detailed point layer config.
Kepler Slice API & Types
packages/kepler/src/KeplerSlice.ts
Changed addLayer param type to `ParsedLayer
Kepler Action Types
packages/kepler/src/hooks/useKeplerStateActions.ts
Replaced any action fields with concrete imported action types (UIStateActions, VisStateActions, MapStateActions, MapStyleActions, ProviderActions).
Custom Filter & Interaction Adjustments
packages/kepler/src/components/CustomFilterManager.tsx, packages/kepler/src/components/CustomInteractionManager.tsx
Wrapped optional filter callbacks in safe inline callers and adapted tooltip/display-format callback signature with a new handler to shape updates.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped in code with twitchy delight,
Cleaned aliases under calm moonlight,
Bumped versions, types made neat,
Layers arranged, the store complete.
A carrot for build — esnext tonight! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the pull request: upgrading kepler.gl and deck.gl to version 9, which aligns with the primary changes across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch upgrade-kepler-deckgl-v9

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@igorDykhta
igorDykhta self-requested a review April 9, 2026 12:40
Signed-off-by: Ihor Dykhta <[email protected]>
@igorDykhta

Copy link
Copy Markdown
Collaborator

@ilyabo I don’t think the failing CI is related to the kepler.gl upgrade.

@ilyabo
ilyabo marked this pull request as ready for review April 10, 2026 10:44

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/kepler/package.json (1)

7-8: ⚠️ Potential issue | 🟠 Major

Add required Node engine constraint to this package manifest.

This package manifest is missing the required Node.js floor for development tooling consistency. Project requirements specify Node.js >=22.

Suggested patch
   "module": "dist/index.js",
   "type": "module",
+  "engines": {
+    "node": ">=22"
+  },
   "sideEffects": false,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/kepler/package.json` around lines 7 - 8, Add a Node engine
constraint to the package manifest by inserting an "engines" field with "node":
">=22" into the JSON object (near existing keys like "type" and "sideEffects");
update the package.json so it contains "engines": { "node": ">=22" } to enforce
the required Node.js floor for this package.
examples/deckgl/package.json (1)

5-6: ⚠️ Potential issue | 🟠 Major

Add required Node engine constraint to this manifest.

This package.json currently lacks the required Node.js version declaration for development.

Suggested patch
   "version": "0.0.0",
   "type": "module",
+  "engines": {
+    "node": ">=22"
+  },
   "scripts": {

As per coding guidelines package.json: Require Node.js version >=22 for development.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/deckgl/package.json` around lines 5 - 6, Add a Node.js engine
constraint to the package.json manifest by inserting an "engines" field (e.g.,
"engines": { "node": ">=22" }) at the top-level of the JSON so the package
declares the required Node version for development; update the file that
currently contains the "type": "module" and "scripts" keys to include this new
"engines" entry.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@examples/deckgl/package.json`:
- Around line 5-6: Add a Node.js engine constraint to the package.json manifest
by inserting an "engines" field (e.g., "engines": { "node": ">=22" }) at the
top-level of the JSON so the package declares the required Node version for
development; update the file that currently contains the "type": "module" and
"scripts" keys to include this new "engines" entry.

In `@packages/kepler/package.json`:
- Around line 7-8: Add a Node engine constraint to the package manifest by
inserting an "engines" field with "node": ">=22" into the JSON object (near
existing keys like "type" and "sideEffects"); update the package.json so it
contains "engines": { "node": ">=22" } to enforce the required Node.js floor for
this package.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c1cd8fa4-1a43-4617-bcbb-cfbc0762aa49

📥 Commits

Reviewing files that changed from the base of the PR and between 8e5a15a and 2017900.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • examples/canvas-sync/vite.config.ts
  • examples/deckgl-discuss/package.json
  • examples/deckgl/package.json
  • examples/kepler/vite.config.ts
  • examples/sync/vite.config.ts
  • package.json
  • packages/kepler/package.json

Signed-off-by: Ilya Boyandin <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/kepler/src/KeplerSlice.ts (1)

531-562: ⚠️ Potential issue | 🟠 Major

addTableToMap should register the map before dispatching.

This is now part of the first-load path, but unlike the other public mutation helpers it never calls registerKeplerMapIfNotExists(mapId). If it runs before forwardDispatch[mapId] is ready, dispatchAction becomes a no-op and the initial dataset/layer config never lands.

💡 Suggested fix
         addTableToMap: async (mapId, tableName, options = {}, config = {}) => {
+          get().kepler.registerKeplerMapIfNotExists(mapId);
           const connector = await get().db.getConnector();
           const duckDbColumns = await getDuckDBColumnTypes(
             {
               query: (query: string) => connector.query(query).result,
             } as DatabaseConnection,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/kepler/src/KeplerSlice.ts` around lines 531 - 562, The addTableToMap
flow can dispatch before the map is registered, causing dispatchAction to be a
no-op; update addTableToMap to call and await
registerKeplerMapIfNotExists(mapId) (or otherwise ensure the map is registered)
immediately before calling get().kepler.dispatchAction so forwardDispatch[mapId]
is ready; place the call right before the existing
get().kepler.dispatchAction(mapId, addDataToMap(...)) invocation and keep using
the same mapId variable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/kepler/src/hooks/useKeplerStateActions.ts`:
- Around line 14-20: KeplerActions currently types
uiStateActions/visStateActions/etc. as the raw action creator namespaces
(UIStateActions, VisStateActions) while keplerActionSelector(forwardToDispatch,
{}) actually returns dispatch-bound functions; update the code so the types
reflect the bound return type or make dispatchAction return the forwarded
action. Concretely: either change KeplerActions to derive types from the bound
selector return (use ReturnType<typeof keplerActionSelector> or the specific
bound action types) so uiStateActions/visStateActions reflect dispatch-bound
signatures, or modify dispatchAction in KeplerSlice to return the result of
forwardToDispatch/dispatch so the current namespace types remain correct; locate
KeplerActions, keplerActionSelector, and dispatchAction to implement one of
these fixes consistently.

---

Outside diff comments:
In `@packages/kepler/src/KeplerSlice.ts`:
- Around line 531-562: The addTableToMap flow can dispatch before the map is
registered, causing dispatchAction to be a no-op; update addTableToMap to call
and await registerKeplerMapIfNotExists(mapId) (or otherwise ensure the map is
registered) immediately before calling get().kepler.dispatchAction so
forwardDispatch[mapId] is ready; place the call right before the existing
get().kepler.dispatchAction(mapId, addDataToMap(...)) invocation and keep using
the same mapId variable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e1e5a316-012d-4339-8801-3182b9be75e7

📥 Commits

Reviewing files that changed from the base of the PR and between 2017900 and 48f5fd1.

📒 Files selected for processing (3)
  • examples/kepler/src/store.ts
  • packages/kepler/src/KeplerSlice.ts
  • packages/kepler/src/hooks/useKeplerStateActions.ts

Comment on lines 14 to 20
export type KeplerActions = {
visStateActions: any;
mapStateActions: any;
mapStyleActions: any;
uiStateActions: any;
providerActions: any;
uiStateActions: typeof UIStateActions;
visStateActions: typeof VisStateActions;
mapStateActions: typeof MapStateActions;
mapStyleActions: typeof MapStyleActions;
providerActions: typeof ProviderActions;
dispatch: (action: KeplerAction) => void;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Bound Kepler actions are still typed like raw action creators.

keplerActionSelector(forwardToDispatch, {}) produces dispatch-bound functions, but this alias now advertises the raw UIStateActions / VisStateActions return contract. In packages/kepler/src/KeplerSlice.ts, dispatchAction currently drops the forwarded dispatch result, so these functions do not actually behave like the imported creators at runtime. Either return the forwarded action from dispatchAction, or derive KeplerActions from the selector’s bound return type instead of the namespace types.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/kepler/src/hooks/useKeplerStateActions.ts` around lines 14 - 20,
KeplerActions currently types uiStateActions/visStateActions/etc. as the raw
action creator namespaces (UIStateActions, VisStateActions) while
keplerActionSelector(forwardToDispatch, {}) actually returns dispatch-bound
functions; update the code so the types reflect the bound return type or make
dispatchAction return the forwarded action. Concretely: either change
KeplerActions to derive types from the bound selector return (use
ReturnType<typeof keplerActionSelector> or the specific bound action types) so
uiStateActions/visStateActions reflect dispatch-bound signatures, or modify
dispatchAction in KeplerSlice to return the result of forwardToDispatch/dispatch
so the current namespace types remain correct; locate KeplerActions,
keplerActionSelector, and dispatchAction to implement one of these fixes
consistently.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/kepler/src/components/CustomFilterManager.tsx (1)

124-140: Avoid per-render wrapper callbacks in FilterPanel props

removeFilter={() => ...} / toggleAnimation={() => ...} / etc. create new function instances every render. Since filterPanelProps is already memoized, pass stable callbacks directly (with a stable fallback object) to reduce avoidable child re-renders.

♻️ Proposed refactor
+const EMPTY_FILTER_CALLBACKS = {
+  removeFilter: () => {},
+  setFilterView: (_view: string) => {},
+  toggleAnimation: () => {},
+  toggleFilterFeature: () => {},
+};

       {[...filtersByIndex].reverse().map(({filter, idx}) => {
-        const callbacks = filterPanelProps[filter.id];
+        const callbacks = filterPanelProps[filter.id] ?? EMPTY_FILTER_CALLBACKS;
         return (
           <FilterPanel
             key={`${filter.id}-${idx}`}
             idx={idx}
             filters={filters}
             filter={filter}
             datasets={datasets}
             layers={layers}
             isAnyFilterAnimating={isAnyFilterAnimating}
             {...keplerActions.visStateActions}
-            removeFilter={() => callbacks?.removeFilter?.()}
-            enlargeFilter={() => callbacks?.setFilterView?.('')}
-            toggleAnimation={() => callbacks?.toggleAnimation?.()}
-            toggleFilterFeature={() => callbacks?.toggleFilterFeature?.()}
+            removeFilter={callbacks.removeFilter}
+            enlargeFilter={() => callbacks.setFilterView('')}
+            toggleAnimation={callbacks.toggleAnimation}
+            toggleFilterFeature={callbacks.toggleFilterFeature}
           />
         );
       })}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/kepler/src/components/CustomFilterManager.tsx` around lines 124 -
140, The map is creating new wrapper functions each render for FilterPanel props
(removeFilter, enlargeFilter, toggleAnimation, toggleFilterFeature), causing
unnecessary re-renders; instead, pass the memoized callbacks directly from
filterPanelProps (use filtersByIndex.map(({filter, idx}) => { const callbacks =
filterPanelProps[filter.id] || stableFallback; ...
removeFilter={callbacks.removeFilter} enlargeFilter={() =>
callbacks.setFilterView? // actually use callbacks.setFilterView directly }
etc.). Create a stableFallback object (useMemo with a noop useCallback)
containing no-op functions for removeFilter, setFilterView, toggleAnimation,
toggleFilterFeature and use it when callbacks is undefined, and stop using
inline arrow wrappers so FilterPanel receives stable function references
alongside keplerActions.visStateActions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/kepler/src/components/CustomFilterManager.tsx`:
- Around line 124-140: The map is creating new wrapper functions each render for
FilterPanel props (removeFilter, enlargeFilter, toggleAnimation,
toggleFilterFeature), causing unnecessary re-renders; instead, pass the memoized
callbacks directly from filterPanelProps (use filtersByIndex.map(({filter, idx})
=> { const callbacks = filterPanelProps[filter.id] || stableFallback; ...
removeFilter={callbacks.removeFilter} enlargeFilter={() =>
callbacks.setFilterView? // actually use callbacks.setFilterView directly }
etc.). Create a stableFallback object (useMemo with a noop useCallback)
containing no-op functions for removeFilter, setFilterView, toggleAnimation,
toggleFilterFeature and use it when callbacks is undefined, and stop using
inline arrow wrappers so FilterPanel receives stable function references
alongside keplerActions.visStateActions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e4af930d-8861-450b-8c4a-25c046388e5f

📥 Commits

Reviewing files that changed from the base of the PR and between 7c3e742 and 55dd09c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • packages/kepler/src/components/CustomFilterManager.tsx
  • packages/kepler/src/components/CustomInteractionManager.tsx

@ilyabo
ilyabo merged commit b316f11 into main Apr 11, 2026
4 checks passed
@ilyabo
ilyabo deleted the upgrade-kepler-deckgl-v9 branch April 11, 2026 15:07
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.

2 participants