Repository navigation
chore: Upgrade kepler deckgl v9 - #519
Conversation
Signed-off-by: Ilya Boyandin <[email protected]>
Signed-off-by: Ilya Boyandin <[email protected]>
📝 WalkthroughWalkthroughThis 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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Signed-off-by: Ihor Dykhta <[email protected]>
Signed-off-by: Ihor Dykhta <[email protected]>
|
@ilyabo I don’t think the failing CI is related to the kepler.gl upgrade. |
Signed-off-by: Ilya Boyandin <[email protected]>
There was a problem hiding this comment.
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 | 🟠 MajorAdd 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 | 🟠 MajorAdd required Node engine constraint to this manifest.
This
package.jsoncurrently 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>=22for 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
examples/canvas-sync/vite.config.tsexamples/deckgl-discuss/package.jsonexamples/deckgl/package.jsonexamples/kepler/vite.config.tsexamples/sync/vite.config.tspackage.jsonpackages/kepler/package.json
Signed-off-by: Ilya Boyandin <[email protected]>
There was a problem hiding this comment.
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
addTableToMapshould 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 beforeforwardDispatch[mapId]is ready,dispatchActionbecomes 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
📒 Files selected for processing (3)
examples/kepler/src/store.tspackages/kepler/src/KeplerSlice.tspackages/kepler/src/hooks/useKeplerStateActions.ts
| 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; |
There was a problem hiding this comment.
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.
Signed-off-by: Ilya Boyandin <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/kepler/src/components/CustomFilterManager.tsx (1)
124-140: Avoid per-render wrapper callbacks inFilterPanelprops
removeFilter={() => ...}/toggleAnimation={() => ...}/ etc. create new function instances every render. SincefilterPanelPropsis 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
packages/kepler/src/components/CustomFilterManager.tsxpackages/kepler/src/components/CustomInteractionManager.tsx
Summary by CodeRabbit
Chores
Refactor
User-facing