Skip to content

chore: remove react-palm, replace with built-in task runtime in @kepler.gl/tasks - #3592

Open
igorDykhta wants to merge 9 commits into
masterfrom
igr/remove-react-palm
Open

chore: remove react-palm, replace with built-in task runtime in @kepler.gl/tasks#3592
igorDykhta wants to merge 9 commits into
masterfrom
igr/remove-react-palm

Conversation

@igorDykhta

@igorDykhta igorDykhta commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Removes the react-palm dependency and replaces it with a lightweight built-in task runtime.

What changed

  • Added @kepler.gl/tasks-core — new zero-dependency package containing the full task runtime: Task.fromPromise, Task.fromCallback, withTask, withTasks, taskMiddleware, getGlobalTaskQueue, disableStackCapturing, and all test helpers (drainTasksForTesting, succeedTaskInTest, errorTaskInTest, succeedTaskWithValues, simulateTask)
  • @kepler.gl/tasks-core is a separate package to break a circular dependency that would otherwise occur: @kepler.gl/tasks@kepler.gl/processors@kepler.gl/table@kepler.gl/tasks
  • @kepler.gl/tasks re-exports everything from @kepler.gl/tasks-coreno API change for any existing consumer
  • @kepler.gl/table imports Task.fromPromise directly from @kepler.gl/tasks-core to define CREATE_TABLE_TASK / UPDATE_TABLE_TASK
  • All internal packages (@kepler.gl/tasks, @kepler.gl/reducers, @kepler.gl/table, @kepler.gl/actions, examples, website) no longer depend on react-palm
  • Fixed createNewDataEntry return type: was incorrectly typed as Datasets | null; it always returns TaskDescriptor | null — this type bug was previously hidden by react-palm's loose any typing
  • Updated docs, upgrade guide (UPGRADE-GUIDE.md, docs/upgrade-guide-v3.3.md), and API reference examples
  • Regenerated website/yarn.lock and examples/demo-app/yarn.lock to remove stale react-palm lockfile entries

Migration

Apps using enhanceReduxMiddleware from @kepler.gl/reducersno changes needed.

Apps importing taskMiddleware directly:

- import {taskMiddleware} from 'react-palm/tasks';
+ import {taskMiddleware} from '@kepler.gl/tasks';

Apps using Task, withTask, or test helpers:

- import Task, {withTask, drainTasksForTesting} from 'react-palm/tasks';
+ import Task, {withTask, drainTasksForTesting} from '@kepler.gl/tasks';

Test plan

Manual / smoke tests against the demo-app (or Netlify preview). Each scenario below exercises a specific task path.

Store / middleware bootstrap

  • App boots without console errors related to tasks / middleware
  • Redux store is created successfully via enhanceReduxMiddleware (demo-app) and via direct taskMiddleware (website)
  • Dispatching a normal action (e.g. toggle side panel) still works — middleware does not block sync actions

File upload (LOAD_FILE_TASK, PROCESS_FILE_DATA, UNWRAP_TASK, DELAY_TASK, CREATE_TABLE_TASK)

  • Drag-and-drop a single CSV → dataset appears in the side panel, layer is created
  • Upload a GeoJSON file → features render on the map
  • Upload a large CSV / file that streams in batches → progress indicator advances, final dataset loads
  • Upload multiple files in one drop → files process sequentially (DELAY_TASK between them), all datasets appear
  • Upload an invalid / corrupt file → error notification is shown, app remains usable
  • Re-upload data for an existing dataset id (incremental / batch update) → UPDATE_TABLE_TASK path updates the table without duplicating the dataset

Add data to map (Task.allSettled + CREATE_TABLE_TASK + ACTION_TASK)

  • Load a sample dataset from the demo-app samples list → map zooms / fits bounds, layers appear
  • Add multiple datasets at once → all succeed and appear in the datasets panel
  • Force a mixed success/failure (e.g. one valid + one invalid payload if possible) → successful datasets load; failed ones show an error notification without blocking the rest (allSettled)

Map styles (LOAD_MAP_STYLE_TASK, Task.all, ACTION_TASK)

  • Switch base map style (e.g. Dark → Light → Satellite) → style loads and applies
  • Load a custom Mapbox / MapLibre style URL → style fetches and applies
  • Load an invalid style URL → error is handled; previous style remains / error notification shown
  • On first load with multiple styles configured → all styles fetch in parallel (Task.all) without hanging

Cloud save / load (EXPORT_FILE_TO_CLOUD_TASK, LOAD_CLOUD_MAP_TASK, ACTION_TASK, DELAY_TASK)

  • Save map to a cloud provider (Dropbox / Foursquare / etc. if credentials available) → upload succeeds, success notification appears, modal closes
  • Save when overwrite is required → overwrite confirmation modal opens via ACTION_TASK
  • Cancel / fail a cloud save → error notification, provider loading state resets
  • Load a previously saved cloud map → datasets are added to the map, success notification shows, modal closes
  • Fail a cloud load (bad credentials / missing file) → error notification, loading flags clear
  • Success notification auto-dismisses after ~3s (DELAY_TASK)

Notifications & deferred actions (ACTION_TASK, DELAY_TASK)

  • Any success/error path that shows a notification actually displays it
  • Delayed notification removal still fires after the delay
  • Fit-bounds after adding data still runs (map camera updates)

Config / state merge (getGlobalTaskQueue)

  • Load a saved kepler.gl config JSON (with datasets + layers) → merger runs, any tasks scheduled during merge complete, final state matches expected layers/filters
  • Replace current map with a new config (replace / merge options) → no leftover pending tasks, UI settles cleanly

Demo-app remote resource load (custom Task.fromPromise + withTask)

  • Click a sample that loads a remote URL → remote resource task succeeds, data is added to the map
  • Break the remote URL (if easy to simulate) → error path fires without freezing the UI

Regression / edge cases

  • Rapid successive actions that each schedule tasks (e.g. quick style switches + file drops) → no task queue corruption, no “withTask called outside reducer” errors
  • Refresh the page mid-load → clean restart, no leftover global queue issues
  • Unit tests: yarn cover (or at least reducer + mock-state tests) pass — these exercise drainTasksForTesting / succeedTaskWithValues / Task.allSettled sync paths

Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Copilot AI review requested due to automatic review settings July 29, 2026 17:44
@igorDykhta igorDykhta changed the title WIP chore: react-palm to kepler.gl/tasks chore: remove react-palm, replace with built-in task runtime in @kepler.gl/tasks Jul 29, 2026

Copilot AI 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.

Pull request overview

This PR removes the external react-palm dependency and migrates kepler.gl’s async side-effect “task” system to a built-in runtime under @kepler.gl/tasks, updating imports, docs, and package dependencies across the repo.

Changes:

  • Introduces a new internal task runtime (src/tasks/src/task-runtime.ts) and re-exports task APIs from @kepler.gl/tasks.
  • Migrates reducers, tests, examples, and table utilities from react-palm/tasks to @kepler.gl/tasks.
  • Updates docs/upgrade guides and removes react-palm from package dependencies.

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
website/src/reducers/index.js Updates website store setup to stop using react-palm task middleware.
website/package.json Removes react-palm dependency from the website app.
UPGRADE-GUIDE.md Documents react-palm removal and the new task middleware import path.
test/node/reducers/vis-state-test.js Switches test utilities import to @kepler.gl/tasks.
test/node/reducers/vis-state-merger-test.js Switches Task/withTask/test helpers import to @kepler.gl/tasks.
test/node/reducers/provider-state-test.js Switches test utilities import to @kepler.gl/tasks.
test/node/reducers/map-style-test.js Switches test utilities import to @kepler.gl/tasks.
test/node/reducers/composer-state-test.js Switches test utilities import to @kepler.gl/tasks.
test/helpers/mock-state-utils.js Switches test utilities import to @kepler.gl/tasks.
test/browser/components/kepler-gl-test.js Switches test utilities import to @kepler.gl/tasks.
src/tasks/src/task-runtime.ts Adds the new framework-neutral task runtime + middleware + test utilities.
src/tasks/src/index.ts Re-exports task runtime APIs from @kepler.gl/tasks and defines built-in tasks.
src/tasks/package.json Removes react-palm dependency from @kepler.gl/tasks.
src/table/src/dataset-utils.ts Switches Task import to @kepler.gl/tasks.
src/table/package.json Adds @kepler.gl/tasks dependency and removes react-palm.
src/reducers/src/vis-state-updaters.ts Switches Task helpers import to @kepler.gl/tasks and updates comment.
src/reducers/src/root.ts Updates public JSDoc examples away from react-palm/tasks.
src/reducers/src/provider-state-updaters.ts Switches Task helpers import to @kepler.gl/tasks.
src/reducers/src/middleware.ts Updates enhanceReduxMiddleware to use @kepler.gl/tasks middleware.
src/reducers/src/merger-handler.ts Switches global task queue import to @kepler.gl/tasks.
src/reducers/src/map-style-updaters.ts Switches Task helpers import to @kepler.gl/tasks.
src/reducers/package.json Removes react-palm dependency from reducers package.
src/actions/src/action-types.ts Updates public JSDoc examples away from react-palm/tasks.
src/actions/package.json Removes react-palm dependency from actions package.
README.md Updates store setup documentation to built-in task middleware and new helper import.
examples/replace-component/package.json Removes react-palm from example dependencies.
examples/open-modal/package.json Removes react-palm from example dependencies.
examples/node-app/package.json Removes react-palm from example dependencies.
examples/demo-app/src/reducers/index.js Switches Task helpers import to @kepler.gl/tasks.
examples/custom-theme/package.json Removes react-palm from example dependencies.
examples/custom-reducer/package.json Removes react-palm from example dependencies.
examples/custom-map-style/package.json Removes react-palm from example dependencies.
docs/upgrade-guide-v3.3.md Adds explicit migration guidance for the new built-in task runtime.
docs/api-reference/reducers/reducers.md Updates reducer setup docs to import middleware from @kepler.gl/tasks.
docs/api-reference/get-started.md Updates “get started” docs to use enhanceReduxMiddleware.
docs/api-reference/actions/actions.md Updates action docs to import middleware from @kepler.gl/tasks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/tasks/src/index.ts Outdated
Comment thread website/src/reducers/index.js Outdated
Comment thread src/reducers/src/root.ts
Comment thread src/actions/src/action-types.ts
Comment thread UPGRADE-GUIDE.md Outdated
Comment thread src/tasks-core/src/index.ts
Comment thread src/tasks-core/src/index.ts
Ihor Dykhta and others added 8 commits July 29, 2026 21:05
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
taskMiddleware is exported from @kepler.gl/tasks, not @kepler.gl/reducers.
@kepler.gl/reducers only exports enhanceReduxMiddleware.

Update JSDoc examples in root.ts and action-types.ts,
website store setup, and UPGRADE-GUIDE.md highlight bullet.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
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