| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 09f1a18 commit 0956970
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,24 +20,24 @@ with the native UI through a versioned bridge. | |||
| 20 | 20 | ||
| 21 | 21 | Yes. Two patterns: | |
| 22 | 22 | ||
| 23 | - - **Branch on `IS_ANDROID` / `IS_IOS` / `IS_DESKTOP`** for small | ||
| 23 | + - **Branch on `IS_ANDROID` / `IS_IOS` / `IS_WEB`** for small | ||
| 24 | 24 | differences inside a shared component: | |
| 25 | 25 | ||
| 26 | 26 | ```python | |
| 27 | - from pythonnative.utils import IS_ANDROID, IS_IOS, IS_DESKTOP | ||
| 27 | + from pythonnative.utils import IS_ANDROID, IS_IOS, IS_WEB | ||
| 28 | 28 | ||
| 29 | 29 | if IS_ANDROID: | |
| 30 | 30 | ... | |
| 31 | 31 | elif IS_IOS: | |
| 32 | 32 | ... | |
| 33 | - elif IS_DESKTOP: | ||
| 33 | + elif IS_WEB: | ||
| 34 | 34 | ... | |
| 35 | 35 | ``` | |
| 36 | 36 | ||
| 37 | - `pn preview` runs the app with `IS_DESKTOP` set; see the | ||
| 38 | - [Desktop preview guide](../guides/desktop-preview.md). | ||
| 39 | - For a declarative alternative, use `Platform.select({...})`; see the | ||
| 40 | - [Platform API](../api/platform.md). | ||
| 37 | + `pn preview` runs the app with `IS_WEB` set; see the | ||
| 38 | + [Browser preview guide](../guides/browser-preview.md). | ||
| 39 | + For a declarative alternative, use | ||
| 40 | + [`Platform.select`][pythonnative.platform.Platform.select]. | ||
| 41 | 41 | ||
| 42 | 42 | - **Per-platform native modules** for larger pieces (a custom widget, | |
| 43 | 43 | a device API). Implement once per platform behind a single Python | |
| Back | FazBrowse Home | New Git URL |
0 commit comments