Repository navigation
docs(deck.gl-raster): explain why TilesetFactory is a new class every render - #734
Merged
Merged
Conversation
… render RasterTileLayer declares TilesetFactory inside `_renderTileLayer`, so the inner TileLayer gets a new `TilesetClass` on every render. deck.gl compares that prop by identity, so each render rebuilds every cached tile's sublayers, and that is what carries prop changes into tiles that are already loaded. Say so at the class, so it isn't hoisted out without declaring those dependencies. Co-Authored-By: Claude Opus 5.5 <[email protected]>
kylebarron
commented
Oct 21, 2026
Comment on lines
+349
to
+359
| // `TilesetFactory` is a new class on every call, and that is load-bearing. | ||
| // deck.gl compares `TilesetClass` by identity, so on every render the inner | ||
| // `TileLayer` sees a changed prop and rebuilds each cached tile's sublayers | ||
| // (it builds the tileset itself once, from the first class). That rebuild | ||
| // carries prop changes into tiles that are already loaded: `maxError`, | ||
| // `debug` and `debugOpacity`; the props that `getSubLayerProps` copies into | ||
| // each tile's `RasterLayer`, such as `opacity` and `extensions`; and | ||
| // subclass props read while rendering tiles, such as MultiCOGLayer's | ||
| // `composite`. Creating the class once would leave loaded tiles stale | ||
| // unless all of those were declared in `updateTriggers.renderSubLayers`. | ||
| // See #710. |
Member
Author
There was a problem hiding this comment.
Ok this is way too verbose. How about just
It's important for
TilesetFactoryto be a new class on every call because deck.gl comparesTilesetClassby identity
Co-Authored-By: Claude Opus 5.5 <[email protected]>
kylebarron
enabled auto-merge (squash)
October 21, 2026 01:32
kylebarron
disabled auto-merge
October 21, 2026 01:33
This was referenced Oct 23, 2026
kylebarron
added a commit
that referenced
this pull request
Nov 5, 2026
…osaicLayer items (#844) > [!NOTE] > This PR was written by Claude (Claude Code), not by @kylebarron. This PR adds a test: when MosaicLayer gets a new `renderSource`, an item that has already loaded is drawn again with it, and its source isn't opened again. That works because MosaicLayer builds a new tileset class on every render. The inner `TileLayer` compares `TilesetClass` by identity, so it redraws every loaded item, and each one calls the current `renderSource`. Nothing tested this, so moving the class out of `renderTileLayer` would have stopped it without any test failing (#816). deck.gl's own `TileLayer` handles this case with `updateTriggers.renderSubLayers` instead. This PR keeps MosaicLayer's current behavior, as #734 did for `RasterTileLayer`. **Mutation check:** reusing the first render's tileset class fails 13 tests, including this one. The other 12 fail because the new class is also how the inner `TileLayer` notices new items, and those tests all change `data`. This test keeps `data` the same, so it's the only one that checks `renderSource` on its own. Ref #816 🤖 Written by [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR was written by Claude (Claude Code), not by @kylebarron.
RasterTileLayerdeclaresTilesetFactoryinside_renderTileLayer, so the innerTileLayergets a newTilesetClasson every render. deck.gl compares that prop by identity, so each render rebuilds the sublayers of every cached tile. That rebuild is what carries prop changes into tiles that are already loaded:maxError,debuganddebugOpacity; the props thatgetSubLayerPropscopies into each tile'sRasterLayer, such asopacityandextensions; and subclass props read while rendering tiles, such asMultiCOGLayer'scomposite.This adds a comment at the class saying so, so it isn't moved out of
_renderTileLayerwithout declaring those dependencies. There are no code changes.Ref #710
🤖 Written by Claude Code