In this blog, we’ll explore how using dependent libraries can significantly improve maintainability, reusability, and performance in Power Apps PCF controls. Through practical scenarios, we’ll uncover how this architectural choice reduces bundle size and streamlines development.
To illustrate this, let’s dive into a recent scenario our team encountered and how dependent libraries transformed our development process.
Recently at work, our team was assigned to build two different PCF controls – one for showing a sales summary and another for displaying a forecast chart. Even though these were two separate controls, both of them needed the same kinds of utility functions and also used the same third-party libraries, such as input validators and rich text editors.
Initially, we bundled these libraries separately within each control. But that approach caused several issues:
- Duplicate code across controls
- Increased control bundle sizes
- Inconsistent logic and updates
- Slower load times
As the application suite started to grow, these problems began to affect performance and maintainability.
That’s when we explored the concept of dependent libraries, a feature supported by Power Apps that completely changed the way we architect our controls.
We will walk through the use cases where dependent libraries made a significant difference in the project:
- Sharing a utility library across multiple PCF controls
- On-demand loading of third-party libraries like TinyMCE
The blog also discusses why the shared UMD-based external library approach was chosen over bundling directly within each control, and how UMD vs. bundled libraries differ in the PCF context.
Why UMD and Not Bundled?
UMD (Universal Module Definition) libraries allow shared code to be loaded once and made globally available across controls...Read More>>