-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add(examples): react widgets get started #8889
base: chr/jsx-widgets
Are you sure you want to change the base?
Conversation
Signed-off-by: Chris Gervang <[email protected]>
new FullscreenWidget({style: widgetTheme}) | ||
]} | ||
> | ||
<GeoJsonLayer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated: should we move get-started to TypeScript? Maybe pure-js can be reserved for JS examples, but react projects are more likely to be using bundlers/plugins/dev frameworks that already support TS.
It's known that JSX layers do not work with TS, though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the fiber renderer works with TSX? visgl/deck.gl-community#35
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a value in using JSX layers when the stars of the show, the Widgets, are not expressed as JSX?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got me thinking, if I'm writing a react app and making a custom widget then I'd probably like to write a widget in react. I think we could show how React Portals offer a pretty seamless interface for this.
import '@deck.gl/widgets/stylesheet.css'; | ||
|
||
/* global window */ | ||
const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I wasn't aware that there was a standardized way to query for dark mode. Seems like something that could be built into the widget theming system as a default? PreferredTheme
or something like that? Though maybe it is better for exposition to show it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the exposition here since apps implement their themes in so many different ways. Maybe they don't want the "Glass" version, maybe they let the user override theme in a setting, etc..
new FullscreenWidget({style: widgetTheme}) | ||
]} | ||
> | ||
<GeoJsonLayer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a value in using JSX layers when the stars of the show, the Widgets, are not expressed as JSX?
Signed-off-by: Chris Gervang <[email protected]>
Signed-off-by: Chris Gervang <[email protected]>
Signed-off-by: Chris Gervang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Pessimistress if this too complex for get-started then maybe I can write a custom widget developer guide. I think it'd be common for a react user to want to implement their own widget, and we could document a basic pattern they could use.
Signed-off-by: Chris Gervang <[email protected]>
Signed-off-by: Chris Gervang <[email protected]>
Supports #8877
Change List