Viewer
Deprecated (5.x only)
This page applies to the 5.x line only (npm 5.1.x, branch 5.x). @ahoo-wang/fetcher-viewer is deprecated on npm (every version) and frozen there: existing functionality is maintained, with no new features. It is replaced by @ahoo-wang/wow-view-engine in the Wow repository (typescript/, wow.ahoo.me), on npm from Wow 9.2.0 (9.2.1 or later accepts fetcher 6). The two use different models and APIs, so migration requires adaptation.
Viewer supplies Ant Design filter, table and saved-view UI. Begin with the component matching who owns the rows and saved views. A local table does not require a Wow backend; FetcherViewer requires the defined remote protocol.
Choose an entry
| Entry | Component owns | Application owns |
|---|---|---|
| View | One view's filter/table/page interaction | dataSource: {list,total}, data loading and persistence |
| Viewer | View collection, switching and editable active-view state | definition, initial views, onLoadData, create/update/delete persistence and success callbacks |
| FetcherViewer | Definition/view lookup, Wow commands and paged data requests | Compatible backend, default Fetcher/authentication, tenant/owner identity and authorization |
View and Viewer do not filter or paginate an input array for you. Their callbacks request new data; the application supplies the resulting rows and total. A save callback acknowledges application persistence. FetcherViewer adds version confirmation for create/update; deletion and ordinary row queries have different boundaries.
Installation prerequisites
pnpm add @ahoo-wang/fetcher @ahoo-wang/fetcher-cosec @ahoo-wang/fetcher-decorator @ahoo-wang/fetcher-eventbus @ahoo-wang/fetcher-eventstream @ahoo-wang/fetcher-openapi @ahoo-wang/fetcher-react @ahoo-wang/fetcher-storage @ahoo-wang/fetcher-viewer @ahoo-wang/fetcher-wow @ant-design/icons antd dayjs react react-domThis reference targets 5.0.0. The library package declares Node >=18.20.8; repository development requires Node >=22.12.0 and pnpm 10.34.5. The command includes all transitive internal peers, including packages reached through Wow/React/CoSec. Direct runtime dependencies are installed automatically. External peer ranges are React/ReactDOM ^19.2.8, antd ^6.6.3, @ant-design/icons ^6.3.4 and dayjs ^1.11.23. They are installation requirements even when a particular feature is unused. Consumers do not need to duplicate the repository React Compiler toolchain.
Runnable core example
For setup, fixtures and expected results follow the guide.
The file lives on the 5.x branch, where @ahoo-wang/fetcher-viewer is maintained: stories/docs/LocalViewer.tsx.
Topics
- View and Viewer composition
- Models and state ownership
- Filters and editable panels
- Tables, columns and cells
- Saved-view panels and persistence callbacks
- FetcherViewer remote integration
- Registries, inputs and fullscreen button
- Toolbar, refresh and locale
- Complete symbol index
State and resource ownership · Failure and cancellation boundaries
