The D2Bridge Framework is a comprehensive platform targeted at Delphi and Lazarus developers for converting existing desktop applications—written with Delphi VCL, FMX, or Lazarus LCL components—into modern web applications. Its core value lies in enabling the reuse of existing Pascal code and UI components to produce rich web UIs without writing any JavaScript, HTML, or CSS manually. D2Bridge serves as a bridge connecting the traditional Pascal form and control model to responsive HTML interfaces via a server-side rendering and communication pipeline.
Sources: Beta/D2Bridge Framework/D2Bridge.BaseClass.pas33-35 Beta/D2Bridge Framework/D2Bridge.Interfaces.pas33-35
TButton, TEdit, TDBGrid, and equivalents are supported natively with wrappers and rendering logic.| Track | Description |
|---|---|
| Stable | Production-ready releases with verified feature stability and maturity. |
| Beta | Active development branch with new features like the Prism Engine enhancements and containerized deployment support via D2Docker. |
Sources: Beta/D2Bridge Framework/D2Bridge.BaseClass.pas9-21
| IDE | Supported Versions |
|---|---|
| Delphi | 10 Seattle through 13 Athens |
| Lazarus | 3.4 through 4.4 |
Projects can be created and managed via dedicated IDE Wizards and templates that simplify setup for both Delphi and Lazarus workflows.
D2Bridge bridges the gap between Delphi/Lazarus desktop UI components and web browsers by rendering form and control state into HTML and managing live interactions via WebSocket and HTTP protocols.
Key entities include:
TD2BridgeClass The foundational class for all web-enabled forms and data modules. Manages the rendering lifecycle, user session association, and communication. Beta/D2Bridge Framework/D2Bridge.BaseClass.pas57
TPrismSession Represents an individual user session, handling WebSocket/HTTP communication, session state, and lifecycle events. Beta/D2Bridge Framework/D2Bridge.BaseClass.pas71
TD2BridgeHTML Responsible for assembling the full HTML page output, including templates, styles, and scripts. Beta/D2Bridge Framework/D2Bridge.BaseClass.pas75
ID2BridgeAddItems Interface for generating and adding UI components during the rendering process. Beta/D2Bridge Framework/D2Bridge.BaseClass.pas87
TD2BridgeServerControllerBase Manages incoming user connections and maps them to sessions and rendering operations. Beta/D2Bridge Framework/D2Bridge.Interfaces.pas144
Sources: Beta/D2Bridge Framework/D2Bridge.BaseClass.pas57 Beta/D2Bridge Framework/D2Bridge.BaseClass.pas71 Beta/D2Bridge Framework/D2Bridge.BaseClass.pas75 Beta/D2Bridge Framework/D2Bridge.BaseClass.pas87 Beta/D2Bridge Framework/D2Bridge.Interfaces.pas144
D2Bridge projects are initiated using an IDE wizard that scaffolds project and form units tailored for web deployment. Configuration includes setting compiler directives (D2Bridge.inc) to choose frameworks (VCL vs FMX) and third-party library availability. The core configuration file Config.ini governs server parameters such as ServerPort and ServerName. The project leverages a wwwroot directory to house static web assets like templates, CSS, and JavaScript files.
For complete setup procedures, see: Getting Started & Project Setup
Sources: Beta/D2Bridge Framework/D2Bridge.BaseClass.pas31 Beta/D2Bridge Framework/D2Bridge.Interfaces.pas31 .gitignore32-33
Resources like language strings and HTML templates are compiled into .res (Delphi) or .lrs (Lazarus) files using batch scripts and command-line tools (BRCC32 for Delphi, lazres for Lazarus). Environment variables such as DELPHIBIN and LAZTOOLSBIN configure the tool paths. The compilation pipeline seamlessly integrates these resources into the executable, enabling efficient multilingual support and UI template loading.
More details are provided at: Build System & Resource Compilation
The framework implements a layered conversion pipeline:
This process maps native Delphi components to HTML components, preserving logical relationships and event handling, while offering rich interactive web interfaces, all without requiring client-side code authoring.
Each user's connection is encapsulated within a TPrismSession Beta/D2Bridge Framework/D2Bridge.BaseClass.pas71 which manages communication channels (WebSocket or HTTP), handles lifecycle hooks (connect, disconnect, timeout), and ensures consistent session state.
Security features include:
Sources: Beta/D2Bridge Framework/D2Bridge.BaseClass.pas71
D2Bridge includes an extensive internationalization subsystem supporting 18 languages, loaded from compiled resource bundles. Developers can override or extend translations at the application level to suit localization requirements.
Sources: Beta/D2Bridge Framework/D2Bridge.BaseClass.pas108-115
| Child Page | Focus |
|---|---|
| Getting Started & Project Setup | Step-by-step project creation, IDE setup, and configuration. |
| Build System & Resource Compilation | Resource bundling and compilation flows for Delphi/Lazarus. |
Sources: Beta/D2Bridge Framework/D2Bridge.BaseClass.pas9-115 Beta/D2Bridge Framework/D2Bridge.Interfaces.pas31-144 .gitignore32-33
Refresh this wiki