How instawork/hyperview works
Main Components
• Hyperview React Native Client Library:
• Core functionalities (in “src/core”) that handle navigation, UI rendering, and service integration.
• Collection of reusable UI components (in “src/components”) that map Hyperview XML constructs to React Native elements.
• Supporting behaviors (in “src/behaviors”) that define actions like hide, show, toggle, set value, etc.
• Context providers and service modules (in “src/contexts” and “src/services”) that support state management, error handling, logging, and XML parsing.
• Demo App & XML Server:
• The “demo” directory contains an Expo project that runs on iOS, Android, or a physical device.
• The “demo/backend” folder contains server-side XML resources and templates (written in nunjucks, using filters, macros, and case studies) and simulates the backend delivering Hyperview XML.
• Supporting Artifacts:
• Documentation (“docs”), build and configuration files (CircleCI, eslint, prettier, etc.), tests, and storybook examples used to demonstrate usage and assist in development.
Interactions and Relationships
• The mobile client (Hyperview React Native app) fetches Hyperview XML from the backend XML server.
• The demo app’s backend is responsible for generating various XML-based UI definitions that the client parses.
• The client’s core components (navigation, UI components, and behaviors) interact with auxiliary services (XML parsing, event handling, logging) to render the UI dynamically.
• The “sync” script (from the “demo” folder) helps keep changes in the core library synchronized with the demo app for development purposes.
Architectural Patterns and Principles
• Separation of Concerns: Clear division between UI presentation, interaction behaviors, and the XML service logic.
• Modular Design: The “src” folder is organized into components, behaviors, contexts, and services to allow independent development and testing.
• Server-Driven UI: Rather than hardcoding layout, the client fetches XML content from the backend, allowing the UI to be updated over-the-air.
• Integration with External Libraries: Notice dependencies on React Native components and other peer dependencies (like navigation, gesture-handling, and webview) that are critical to the mobile app.
Relevant Technologies, Frameworks, or Libraries
• React Native & Expo (for the demo app, along with support for iOS and Android)
• XML Parsing and Hyperview XML processing (via @instawork/xmldom and other lightweight libraries)
• Navigation libraries (react-navigation)
• Various UI libraries and behaviors that map to mobile UI patterns.