Skip to content

Commit 9dff410

Browse files
authored
docs: AT, HeroBanner & SelectDialog update (UI5#8730)
1 parent bd15575 commit 9dff410

4 files changed

Lines changed: 23 additions & 62 deletions

File tree

.storybook/preview.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ const preview: Preview = {
2626
ref: {
2727
table: { disable: true },
2828
},
29-
dataset: {
30-
control: { disable: true },
31-
},
32-
ChartPlaceholder: {
33-
control: { disable: true },
34-
},
3529
},
3630
decorators: [
3731
(Story, { globals, viewMode }) => {
@@ -184,6 +178,14 @@ const preview: Preview = {
184178
argType.type = { name: 'boolean' };
185179
}
186180
});
181+
if (context.tags?.includes('package:@ui5/webcomponents-react-charts')) {
182+
if (argTypes.dataset) {
183+
argTypes.dataset.control = { disable: true };
184+
}
185+
if (argTypes.ChartPlaceholder) {
186+
argTypes.ChartPlaceholder.control = { disable: true };
187+
}
188+
}
187189
return argTypes;
188190
},
189191
],

packages/main/src/components/AnalyticalTable/docs/FAQ.mdx

Lines changed: 12 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -10,70 +10,27 @@ import * as ComponentStories from './AnalyticalTable.stories';
1010

1111
<TableOfContent />
1212

13-
## Why is the AnalyticalTable slow in development mode?
13+
## Why is the AnalyticalTable slower in development mode?
1414

15-
When using the `AnalyticalTable` (or other virtualized components) in development mode, you may experience noticeable performance degradation compared to production builds. This is expected behavior caused by the combination of **React's dev mode overhead** and **browser debugger instrumentation**.
15+
The `AnalyticalTable` (and other virtualized components) run somewhat slower in development mode than in production builds. This gap has been reduced significantly over time and is usually a minor annoyance rather than a blocker, but on slower machines or with very large datasets you may still notice it.
1616

17-
### Why Dev Mode is Slower
17+
If the difference is bothering you, the following tend to help:
1818

19-
#### React Dev Mode Overhead
19+
1. **Test with production builds** when working on performance-sensitive features — this also gives you accurate performance metrics.
20+
2. **Try Firefox or Safari for development** — they have lighter debugger overhead in dev mode than Chromium-based browsers.
21+
3. **Close DevTools when not actively debugging**, and consider disabling the React DevTools browser extension — both add overhead even when DevTools is closed.
2022

21-
React's development build includes significant overhead:
22-
23-
- **Strict Mode double-rendering**: Components, `useEffect`, and callback refs render an additional time to help detect side effects
24-
- **Validation checks**: Hooks order, prop types, deprecated API usage
25-
- **Extended error messages**: Component stack traces for better debugging
26-
- **Extra code paths**: Development-only warnings and diagnostics
27-
28-
For a virtualized table that frequently mounts and unmounts cells during scrolling, this overhead compounds quickly.
29-
30-
#### Browser Debugger Instrumentation
31-
32-
Chromium-based browsers (Chrome, Edge, Brave, etc.) instrument async operations heavily in dev mode via the V8 engine - even when DevTools is closed. Firefox and Safari have significantly lighter debugger overhead in dev mode for example.
33-
34-
### Recommendations
35-
36-
#### High Impact
37-
38-
1. **Use Firefox or Safari for development**: These browsers have significantly lighter debugger overhead in dev mode.
39-
40-
2. **Test with production builds**: When working on performance-sensitive features, test with a production build to get accurate performance metrics.
41-
42-
3. **Disable React Strict Mode** (temporarily): If dev mode performance is severely impacting your workflow, you can temporarily disable Strict Mode in development. Note that Strict Mode helps catch bugs, so re-enable it periodically.
43-
44-
4. **Memoize props that require it**: Props marked with "Must be memoized" (e.g., `columns`) need a stable reference. Define them outside the component or use `useMemo`/`useCallback` to prevent unnecessary recalculations.
45-
46-
#### Medium Impact
47-
48-
5. **Disable React DevTools extension**: The React DevTools browser extension adds performance overhead and has been observed to cause small memory leaks.
49-
50-
6. **Consider memoizing expensive Cell components**: If you have custom `Cell` renderers with expensive computations or deep component trees, wrapping them with `React.memo()` can help by creating render boundaries. However, avoid over-memoization - for simple cells, the overhead of memoization may outweigh the benefits.
51-
52-
7. **Use [direct imports](?path=/docs/knowledge-base-faq--docs#why-use-direct-imports-via-package-export-maps)**: Since tree shaking is not available for most bundlers in dev mode, use direct imports to reduce initial load.
53-
54-
#### Lower Impact
55-
56-
8. **Keep DevTools closed**: When not actively debugging, keep DevTools closed to reduce overhead from source map parsing, DOM mutation observers, and memory tracking.
57-
58-
9. **Deactivate UI5 Web Components animations in dev mode**: Animations cause components to recalculate multiple times. While we debounce frequent state changes, disabling animations can help.
59-
60-
### Summary
61-
62-
Dev mode slowness for virtualized components is expected behavior, not a bug. In production builds, the `AnalyticalTable` performs well. For the best development experience with heavy tables, consider using Firefox or Safari, or testing with production builds when performance is critical.
23+
Beyond dev mode itself, general `AnalyticalTable` performance practices (memoizing `columns`, `data`, custom `Cell` components, etc.) apply equally in dev and prod — see the relevant sections in this FAQ and in the main documentation.
6324

6425
<details>
65-
<summary>Example: Performance Trace Comparison</summary>
66-
67-
The following table shows a performance trace comparison from an investigation into dev mode performance ([GitHub issue #8234](https://github.com/SAP/ui5-webcomponents-react/issues/8234)). Your results may vary depending on your implementation, but the general pattern holds:
26+
<summary>Why dev mode is slower</summary>
6827

69-
| Metric | Chrome DEV | Chrome PROD | Firefox DEV |
70-
| --------------- | ---------- | ----------- | ----------- |
71-
| Trace file size | 561 MB | 3.3 MB | 6.3 MB |
72-
| Event count | ~millions | ~14,600 | ~3,700 |
28+
Two main factors contribute:
7329

74-
Firefox in dev mode has similar overhead to Chrome in prod mode - both are lightweight. Chromium-based browsers in dev mode are the outlier with massive V8 debugger instrumentation.
30+
- **React's development build** adds Strict Mode double-rendering, validation checks (hooks order, prop types, deprecated APIs), extended error messages, and development-only warnings. For a virtualized table that frequently mounts and unmounts cells while scrolling, this overhead adds up.
31+
- **Browser debugger instrumentation** in Chromium-based browsers (Chrome, Edge, Brave, etc.) instruments async operations via the V8 engine even when DevTools is closed. Firefox and Safari tend to be lighter in this regard.
7532

76-
For more context, see the [detailed findings comment](https://github.com/SAP/ui5-webcomponents-react/issues/8234#issuecomment-3971742068) and [production environment performance videos](https://github.com/SAP/ui5-webcomponents-react/issues/8234#issuecomment-3960465202) showing table performance (inside a complex container) on high-end, medium-range, and low-end devices.
33+
For the original investigation and detailed findings, see [GitHub issue #8234](https://github.com/SAP/ui5-webcomponents-react/issues/8234) — note that the numbers in that issue predate the performance improvements and should be read as historical context, not current behavior.
7734

7835
</details>
7936

packages/main/src/components/SelectDialog/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ export interface SelectDialogPropTypes
123123
* Allows overriding the SearchField's default placeholder text. If not set, the word "Search" in the current local language or English will be used as a placeholder.
124124
*
125125
* __Note:__ The placeholder is used as accessible-name of the input for screen reader support.
126+
*
127+
* @since 2.23.0
126128
*/
127129
searchPlaceholder?: string;
128130
/**

packages/main/src/webComponents/HeroBanner/HeroBanner.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import * as ComponentStories from './HeroBanner.stories';
2424

2525
## Background Image
2626

27-
Apply a custom background image via the `style` prop.
27+
A custom background image can be applied via CSS.
2828

2929
<Canvas of={ComponentStories.BackgroundImage} />
3030

0 commit comments

Comments
 (0)