This blog post will touch on the technology enhancements of the most recent release of ArcGIS for Power BI.
From Dojo to React
Prior to this release, the ArcGIS for Power BI visual was built with Dojo. Dojo is a full-fledged framework for building web apps that includes reusable widgets, routing and state management features out of the box.
For the latest release, our development team decided to migrate to React. React is a library for user interfaces developed by Facebook.
Why did our development team decide to migrate to React?
React – Library for creating UI’s
Angular – development platform that includes a component-based framework for building scalable web applications, collection of libraries that cover features such as routing, form management and client-server communication
Vue – framework of libraries for building web applications from scratch or can be applied incrementally to an existing app (progressive framework).
Of the three, React has the advantage of being the most lightweight of the three options i.e it does not have many of the features Angular or Vue has built in. Its sole purpose is to build UI. React is a good option if you do not need those features that Angular and Vue have. The team determined that we can build our application with React and take advantage of a lightweight library.
Contrasting code structure
Below is a code sample of a counter widget written in Dojo and React.
In Dojo, code is written according to Asynchronous Module Definition(AMD) format and Dojo’s built in modules are specified as dependencies to enable functionality. An example of this is the template mixin that allows for including HTML markup for the widget.
In React, code is written using JSX. The required imports is the React library and any hooks needed to manage property changes in the widget. In contrast to Dojo, React components require less code and is easier to read.
- Reduced debugging time thanks to TypeScript’s type checking.
- A visual that is noticeably faster. This can be attributed to the visual file size being reduced by 80%.
- Asynchronous Module Definition (AMD) and lazy loading helped with performance of the application.
- Smaller code base. Smaller code base equates to less maintenance.
The future and beyond
The technology upgrades mentioned above allow us to plan for new features such as 3D visualization and improved mobile support to further enhance ArcGIS for PowerBI. Stay tuned.