Power Apps Component framework provides the ability to create code components that can be used with Model driven app and canvas apps(experimental preview at the time of this writing) which provides a bunch of advantages compared to the traditional HTML Web Resources. To learn more about it refer to