fix(widgets): restore Preact as JSX renderer, align with @deck.gl/widgets design - #543
Merged
Merged
Conversation
charlieforward9
force-pushed
the
fix/restore-preact-renderer
branch
from
March 5, 2026 05:29
2711381 to
918b5c5
Compare
charlieforward9
force-pushed
the
fix/restore-preact-renderer
branch
from
March 5, 2026 05:45
fe44699 to
ad955c7
Compare
This reverts commit a622dbc.
…ompat Align with @deck.gl/widgets design intent: Preact internally, VanillaJS public API. Fixes TypeScript errors when vendor source is aliased into a React project. - Add /** @jsxImportSource preact */ pragma to all .tsx widget files so TypeScript uses Preact's JSX factory instead of React's when compiling under the main project tsconfig - Remove redundant `deck?: Deck | null` redeclaration from HtmlOverlayWidget, PanWidget, ZoomRangeWidget — base Widget class already declares it; the null type conflicted with Widget<ViewsT>.deck which is Deck | undefined - Change this.deck = null → this.deck = undefined in onRemove() to match base class type (Deck | undefined, not Deck | null) - Widen hasViewManager() parameter to Deck | null | undefined to match callers using this.deck which is now Deck | undefined Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
charlieforward9
force-pushed
the
fix/restore-preact-renderer
branch
from
March 5, 2026 05:51
ad955c7 to
5c2fa00
Compare
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.
Summary
Reverts the preact removal from #532 and restores Preact as the internal JSX renderer for
@deck.gl-community/widgets, aligning with the design intent established by@deck.gl/widgets(all official widgets userender()from Preact internally).The original motivation for removing Preact was a Vite source-alias build failure when consuming widget source directly. The correct fix is per-file
/** @jsxImportSource preact */pragmas — not removing Preact.Changes
.tsxfiles with Preact JSX,jsxImportSource: "preact"tsconfig,VNodereturn types onrenderObject()/renderCluster()/** @jsxImportSource preact */pragma to all.tsxwidget files — overrides jsxImportSource per-file so TypeScript uses Preact's JSX factory even when compiled under a React project's tsconfig (the common case for Vite source aliases)deck?: Deck | nullredeclarations fromHtmlOverlayWidget,PanWidget,ZoomRangeWidget— baseWidgetclass already declaresdeck?: Deck<ViewsT>, and the| nullconflicted with the base type (Deck | undefined)this.deck = null→undefinedinonRemove()to match base class typehasViewManager()parameter toDeck | null | undefinedto match callersWhy Preact, not vanilla DOM
@deck.gl/widgetsuses Preact internally for all built-in widgets (ZoomWidget, FullscreenWidget, CompassWidget, GimbalWidget). The UI Module RFC explicitly chose Preact for its component model at minimal bundle size (~3kb). Community widgets should follow the same pattern — VanillaJS public interface, Preact internally.🤖 Generated with Claude Code