Skip to content

components 0.8.0: the web map wrapper loads the map on demand; MapPicker web twin; lint config - #213

Merged
joelmsanto merged 3 commits into
mainfrom
web/mapbox-diferido-2026-11-16
Nov 16, 2026
Merged

joelmsanto merged 3 commits into
mainfrom
web/mapbox-diferido-2026-11-16

Conversation

@joelmsanto

Copy link
Copy Markdown
Contributor

What

  • MapboxGLWrapper/index.web.js is the native surface on react-map-gl v8 (moved from CustomerApp's web-stubs/mapbox-gl-wrapper.js). The map itself, MapboxGLWrapperMap.web.js with mapbox-gl and its stylesheet, loads through import(). Each part is lazy() in its own Suspense, and the map's empty box (MapboxGLWrapperContainer.web.js) shows while the code arrives.
  • Geoposition/MapPicker/index.web.js: MapPicker's web twin on that wrapper. @rnmapbox/maps' web build imports mapbox-gl and its CSS, and the barrel exports MapPicker, so the engine reached every web page.
  • .eslintrc.js extends @react-native, the config the repo installs (@react-native/eslint-config 0.85.0). It was extending @react-native-community.
  • 0.8.0 (minor): the web default export of MapboxGLWrapper changes shape, from GeoPositionTracker to the native surface. Its only consumer, CustomerApp, already renders that surface through its override. Peer mapbox-gl ^3.5.0, the app's. PROJECT.md updated.

Why

On daxir.com the first JS bundle carried mapbox-gl (1.85 MB minified) on every page (owner, 2026-11-16: web performance).

Native

No native file changes. index.js files are untouched, and native Metro never resolves .web.js.

Checked

  • The repo's own eslint: 0 problems in the four new or changed web files.
  • npm run build, then npm pack installed in CustomerApp (--no-save), expo export -p web: AppEntry went from 8,573,966 to 6,673,582 bytes (1,496,637 gzip). It holds no WebGL or @rnmapbox code. mapbox-gl is its own chunk (1,892,315 bytes), requested only by the map wrapper's chunk. The mapbox-gl CSS stays linked from index.html, because Expo hoists async CSS.
  • CustomerApp web jest (statusChipTones, which loads the barrel): 2 passed.
  • Not seen in a browser.

Order

Merge, then publish 0.8.0. CustomerApp then installs it with its override removal (CustomerApp branch web/mapbox-fork-0.8.0). CI still fails at install: no dxr-artifacts access, as on #212.

🤖 Generated with Claude Code

Joely and others added 3 commits November 16, 2026 17:52
… (owner 2026-11-16)

.eslintrc.js extended '@react-native-community', a config no longer in the
dependencies: package.json declares @react-native/eslint-config 0.85.0, the
package React Native publishes under that name now, so `npm run lint` stopped
at "couldn't find the config". It now extends '@react-native'.

Checked: after `npm ci`, eslint loads and lints src/MapboxGLWrapper/ with 0
errors and 10 warnings, all in files that predate this change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…face and loads the map on demand (owner 2026-11-16)

MapboxGLWrapper/index.web.js exported a monolithic GeoPositionTracker written
against props nobody passes; CustomerApp replaced it with its own
web-stubs/mapbox-gl-wrapper.js and a Metro rule. That implementation moves here,
where PROJECT.md puts the web twins:

- MapboxGLWrapperMap.web.js: the native surface on react-map-gl v8 (the map,
  Camera, BoundingBoxCamera, user location, markers, tooltip, route
  monitoring), comments in English, the token read from Config at render (the
  host configures it, as before through react-native-config's web stub).
- index.web.js: the default export with the same statics as index.js. The map
  module is loaded with import(); each part is lazy() inside its own Suspense,
  the map's empty box (MapboxGLWrapperContainer.web.js) shown while the code
  arrives. The barrel exports this wrapper, so a static import put mapbox-gl
  (about 1.8 MB minified in daxir.com's bundle) and its stylesheet in every
  host page.

Minor, not patch: the web default export changes shape (GeoPositionTracker ->
the native surface). Its only consumer, CustomerApp, already renders this
surface through its override. peerDependencies: mapbox-gl ^3.5.0, the app's.
package-lock.json: only its two version lines (npm version), as in ce97553.
PROJECT.md: the map wrapper is no longer a host web stub.

Checked: the repo's own eslint, 0 problems in the three web files;
`npm run build` copies them to lib/. Not yet bundled in a host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ap wrapper (owner 2026-11-16)

Measured in CustomerApp's `expo export -p web` with the previous commit:
the map wrapper was its own chunk, but mapbox-gl (1.85 MB minified) and its
stylesheet stayed in the first load. The barrel exports Geoposition/MapPicker,
which imports @rnmapbox/maps, and @rnmapbox's web build
(lib/module/web/index.js) imports mapbox-gl and 'mapbox-gl/dist/mapbox-gl.css'.

Geoposition/MapPicker/index.web.js is MapPicker's web twin, as PROJECT.md
places web differences: the same props and layout on MapboxGLWrapper (Camera,
FolowUserLocation) instead of @rnmapbox. The native picker, index.js, is
unchanged; native Metro never resolves .web.js. The back button's fixed style
is in the StyleSheet (only its top inset is computed), so the new file is
lint-clean.

Measured with 0.8.0 from `npm pack` in CustomerApp (--no-save), `expo export
-p web`: AppEntry 8,573,966 -> 6,673,582 bytes (1,496,637 gzip -9), with no
WebGL or @rnmapbox code in it; mapbox-gl is its own chunk
(mapbox-gl-*.js, 1,892,315 bytes), requested only by MapboxGLWrapperMap-*.js.
The stylesheet (48,902 bytes) is still linked from index.html: Expo hoists
the CSS of async chunks into the page.

Lint (the repo's own config): 0 problems in the new file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joelmsanto
joelmsanto merged commit fd1b5e3 into main Nov 16, 2026
1 check failed
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.

1 participant