![]() ![]() It’s not necessary to make changes everywhere logging is implemented. Using a plugin for logging also makes code easier to maintain, since all logging code is maintained in a single location. Logging is typically useful in all parts of an application, and with a logging service plugin, the application can easily implement logging features where needed. This functionality makes decoupling components or features, and even sharing code, easier.Įven encapsulating simple features as plugins can be useful. Fusion.js has a different approach: dependencies are injected where needed, which means only what is needed is included in the browser bundles.ĭependency injection is not only a core feature in Fusion.js, it strengthens the plugin concept by allowing them to expose well-defined APIs as services, which can be injected into other plugins. ![]() Increase test coverage with testable pluginsĪ common way to manage dependencies, even in larger applications, is to add them at the top of the application and include everything in the build.Easily share code across the application.Create a plugin and inject it where needed.Some of the benefits of Fusion.js’ dependency injection functionality include the ability to: This means plugins can be created, and easily injected where needed, across the application. Unlike traditional JavaScript-based plugins, dependency injection is a vital part of Fusion.js plugins, and plugins can expose a well-defined API as a service to other plugins. ![]() Because of that, developers are often hesitant to use dependency injection, even more so if a third party library has to be used to manage the dependencies. Dependency injectionĭependency injection is not a built-in concept for many JavaScript-based back-end frameworks, and if it is, the implementation is not always ideal. This is achieved through dependency injection. Fusion.js plugins share this architecture, making it possible to install a library into an application with a single line of code. Plugin conceptsįusion.js applications are universal, which means they have a single entry point. ![]() In this article, we offer an an example of how to create a custom plugin with Fusion.js. However, the framework also enables developers to build their own plugins. Examples of functions encapsulated in plugins are logging, translations, implementation of libraries and integration with data sources.Ī number of official plugins are provided by Fusion.js, and they allow developers to build complex applications without having to write their own plugins. Plugins can be used to encapsulate functions, which are reused in different parts of the application. Plugins are a core element of Fusion.js, Uber’s open source universal web framework, and its architecture. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |