This document aims to describe how support for Blueriq's development tooling can be integrated into any frontend technology.
If you are using Blueriq's Angular framework, then integration with the development tooling is provided through
DevtoolsModule
from@blueriq/angular/devtools
. Please include that module in your Angular application to enable development tooling support; no further usage of this package is needed.
DevtoolsHost
The development toolbar UI is loaded and managed by a DevtoolsHost
that acts as a gateway between the devtools UI and
the theme. Creating a DevtoolsHost
is done using the asynchronous initializeDevtools
function that is exported
from @blueriq/devtools
, which takes a DevtoolsEnvironment
that needs to be implemented according to technoloy that
is used in the theme.
It is recommended that the
DevtoolsHost
is only loaded and activated when thedevtools
query parameter is present, as that is used as an indication that development tooling is requested.
Once the host has been created, you can interact with its various methods. First, the host should be activated and the Blueriq sessions on the page should be registered:
In the above example a session name is provided for the session, which is shown in the session list in the devtools UI. Omitting a session name causes the session id to be shown instead.
When sessions are no longer shown on the page, they need to be removed from the host as well:
Finally, the theme has the ability to notify the devtools UI that the session has been updated, for example after the theme has sent a page event.
Vice versa, editing the session from within the devtools UI can request the theme to recompose in order to show the latest changes. To accomplish this, a listener should be registered with the host:
The devtools UI is deployed inside of the Blueriq Runtime starting from version 13.12 and 14.0 at the /server/devtools
path (potentially below the context-root of the Java web application, typically /runtime
). The DevtoolsEnvironment
that needs to be implemented has to configure a devtoolsUrl
that would load the /server/devtools/index.html
and
related assets. If desired, these resources may be routed through a reverse proxy.
If this resource fails to load, perhaps because development mode is not enabled in the Runtime, then loading
a DevtoolsHost
using initializeDevtools
will reject the promise with an error. As a consequence, the devtools UI is
not loaded.