Skip to content

fix(arcgis): import MapView from the public @deck.gl/core entry - #10788

Merged
chrisgervang merged 9 commits into
visgl:masterfrom
rubenmarcus:fix/arcgis-dist-import
Oct 7, 2026
Merged

chrisgervang merged 9 commits into
visgl:masterfrom
rubenmarcus:fix/arcgis-dist-import

Conversation

@rubenmarcus

@rubenmarcus rubenmarcus commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes #10769

Introduced by #10257, which was also backported to 9.3 (first shipped in 9.3.5).

Background

modules/arcgis/src/deck-renderer.ts imports MapView from '../../core/src/views/map-view'. The build keeps the relative path, so the published dist/deck-renderer.js imports ../../core/src/views/map-view.js, which does not exist in the published @deck.gl/core.

Change List

  • DeckRenderer: import MapView from @deck.gl/core
  • dist/index.cjs: 112 kb down to 19 kb, no inlined core sources
  • Unit test: fail on relative imports that leave the package

Prepared with AI assistance (GLM 5.3 via Oh My Pi) and reviewed before submission.


Note

Low Risk
Single import-path fix plus a guardrail test; behavior should match the same MapView from @deck.gl/core with no auth or data-handling impact.

Overview
Fixes broken published @deck.gl/arcgis builds where deck-renderer still referenced core via a relative path (../../core/src/views/map-view) that does not exist in the installed package.

DeckRenderer now imports MapView from @deck.gl/core, so the arcgis bundle depends on the public entry instead of inlining or retaining invalid cross-package paths (notably shrinking the CJS build).

A new Vitest check walks each package’s src tree, uses the TypeScript preprocessor to collect import specifiers, and fails if any relative import resolves outside that package—enforcing cross-package imports through entry points like @deck.gl/core.

Reviewed by Cursor Bugbot for commit 644be69. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Fixes import path for a core visualization component.

The PR appears safe to merge; no outstanding finding or new blocking issue was identified.

Summary

The PR replaces ArcGIS DeckRenderer’s cross-package source import with the public @deck.gl/core MapView export and adds a Node test for relative imports that cross package boundaries.

  • The current core entry point exports MapView as a named value, matching the new import.
  • No new actionable issue was identified in the PR changes.

Reviews (9) · Last reviewed commit: "Merge branch 'master' into fix/arcgis-di..." · Reviewed by Greptile

@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.

Thanks - yes, this is a problematic pitfall. I'll accept the regression test if it doesn't add a lot of CI time, and if the risk of a false positive is low.

@coveralls

coveralls commented Oct 3, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 83.081% (-0.01%) from 83.091% — rubenmarcus:fix/arcgis-dist-import into visgl:master

Copy link
Copy Markdown
Collaborator

Moving the Verification and Tradeoffs sections out of the PR description so the description follows our PR description guidelines, which ask for a short description without separate verification or test-plan sections. The original text is kept below for reference.

Original Verification and Tradeoffs sections

Verification

New regression test test/modules/cross-package-imports.node.spec.ts (node vitest project, alongside imports.node.spec.ts): scans every modules/*/src file and fails if a relative import resolves outside its own package, since such imports survive the build as unresolvable paths in the published dist.

RED on pristine upstream/master:

+   "modules/arcgis/src/deck-renderer.ts: ../../core/src/views/map-view",
 Test Files  1 failed (1)
      Tests  1 failed (1)

GREEN after the fix, and the full node project slice passes:

Test Files  4 passed (4)
     Tests  20 passed (20)

Build (npx ocular-build core,arcgis): pristine output reproduces the published bug byte-for-byte, modules/arcgis/dist/deck-renderer.js:6: import MapView from "../../core/src/views/map-view.js"; (identical to the line in the @deck.gl/[email protected] npm tarball). After the fix, dist/deck-renderer.js:6 reads import { MapView } from '@deck.gl/core';, zero core/src references remain across dist/*.js and dist.dev.js, and dist/index.cjs drops from 112.3 kb to 19.3 kb because it no longer inlines core source files.

Clean-install resolution check: placed each artifact under node_modules/@deck.gl/arcgis in a fresh directory with real npm packages @deck.gl/[email protected], esri-loader and @arcgis/core, then resolved every import specifier in dist/*.js. Published 9.4.0 tarball: 1 unresolvable specifier, dist/deck-renderer.js: ../../core/src/views/map-view.js -> ERR_MODULE_NOT_FOUND (core ships only src/views/map-view.ts). Fixed build: all 21 specifiers resolve to existing files.

tsc --noEmit -p modules/arcgis/tsconfig.json exits 0; biome check is clean on the new test file, and the six biome findings in deck-renderer.ts are identical on pristine upstream (pre-existing).

One pre-existing environment failure, not caused by this change: the production IIFE bundle step (npx ocular-bundle ./bundle.ts producing dist.min.js) fails on pristine upstream/master with Expected value for alias "@deck.gl/aggregation-layers" to be a string, got object instead, an ocular-dev-tools/esbuild alias shape mismatch in this checkout (node 23 with --ignore-engines). The dev IIFE bundle (--env=dev) builds fine and contains zero core/src references.

Tradeoffs

The ESM dist now imports MapView from the @deck.gl/core entry instead of a deep path; since @deck.gl/core is an external peer dependency in every published flavor, this adds no bundle weight and removes the duplicated core internals from the CJS build. No API change.


Generated by Claude Code

@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.

One suggestion on the regression test; the rest looks good.


Generated by Claude Code

@chrisgervang chrisgervang added this to the v9.3 patch releases milestone Oct 3, 2026
@rubenmarcus

Copy link
Copy Markdown
Contributor Author

master is merged (0a24bdb) and the description is back to the three sections from dev-docs/pr-description-guidelines.md.

On the local node run: cross-package-imports.node.spec.ts passes on that head. imports.node.spec.ts cannot collect here, Missing "./mat4" specifier in "@math.gl/core", because this checkout has @math.gl/core 4.1.0 installed while modules/core now asks for ^5.0.0-alpha.9, and npm install will not complete in this environment. The same failure reproduces on a pristine upstream/master tree with none of my changes, so it is the install, not the branch.

npx vitest run test/modules/cross-package-imports.node.spec.ts
  Test Files 1 passed (1) | Tests 1 passed (1)

On Greptile's undeclared typescript P2, the resolution path is declared: root package.json pins @vis.gl/dev-tools at 2.0.0-beta.1, dev-tools declares typescript: ^6.0.3, and the resolved copy is 6.0.3. That matches what you said about dev-tools bringing it in. If you want it declared at the root anyway, that is one line and I will add it.

@rubenmarcus

Copy link
Copy Markdown
Contributor Author

master is merged, the branch was BEHIND. ca1ce38 merges upstream/master (295811d); no conflicts, the diff is still the two files.

npx vitest run test/modules/cross-package-imports.node.spec.ts
  Test Files  1 passed (1) | Tests  1 passed (1)

@chrisgervang the CHANGES_REQUESTED from 03-10 is showing an empty body, so I read the open ask as the one from 22:34, the regression test suggestion, which 714500b answers with ts.preProcessFile(source, true, true).importedFiles. Flagging in case the empty review meant something else.

@chrisgervang

Copy link
Copy Markdown
Collaborator

Please run lint on the test

@rubenmarcus

Copy link
Copy Markdown
Contributor Author

Formatted in 2894c7b (prettier --write on the spec, one line) and re-run: the cross-package test passes on the branch head.

This was referenced Oct 7, 2026
@chrisgervang
chrisgervang merged commit ed041e5 into visgl:master Oct 7, 2026
11 of 12 checks passed
chrisgervang added a commit that referenced this pull request Oct 22, 2026
* fix(arcgis): import MapView from the public @deck.gl/core entry

* test: parse import specifiers instead of matching raw text in cross-package check

* Scan module imports with the TypeScript preprocessor

* Format the cross-package import test

---------

Co-authored-by: Chris Gervang <[email protected]>
(cherry picked from commit ed041e5)
@chrisgervang

Copy link
Copy Markdown
Collaborator

Released in deck.gl 9.4.1. Thanks @rubenmarcus!

chrisgervang added a commit that referenced this pull request Oct 30, 2026
* fix(arcgis): import MapView from the public @deck.gl/core entry

* test: parse import specifiers instead of matching raw text in cross-package check

* Scan module imports with the TypeScript preprocessor

* Format the cross-package import test

---------

Co-authored-by: Chris Gervang <[email protected]>
(cherry picked from commit ed041e5)
@chrisgervang

Copy link
Copy Markdown
Collaborator

Released in deck.gl 9.3.12. Thanks!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] @deck.gl/arcgis dist import resolves to unpublished @deck.gl/core source path (9.3.11, 9.4.0)

3 participants