Reusability in Your Appsmith Business Apps with Packages Beta

Dessire Ugarte
Posted by Dessire UgartePublished on Mar 18, 2024
3 min read
Reusability

IT teams need to make the most of limited development resources. To speed up development, they should be able to easily share, discover, and reuse work. They should also build business apps that support advanced functionality for internal reuse with tracking, versioning, and bundling to provide governance, maintainability, and standardization.

That's why we are introducing Packages and Modules in Appsmith designed to address these needs and improve reusability within Appsmith.

Packages and modules for improved reusability in app development

reusabililty

Reusability is a crucial part of application development, offering benefits such as accelerating the development process, centralizing business logic, and introducing standardization into applications. This feature set allows you to reuse queries and JS logic across your applications with Packages and Modules.

package is a collection of JS and query modules that can be versioned and distributed across instances. You can create multiple queries and JS modules inside packages, enabling you to bundle and organize your application logic efficiently.

Modules, integral package components, contain reusable queries and JavaScript objects that can yield results across multiple applications within the same workspace.

Improve code reusability and maintenance, manage updates across apps, and provide an abstraction for complex processes

Packages' primary purpose is to streamline the organization, distribution, and sharing of components across multiple applications. Their modular nature facilitates efficient code management, allowing developers to independently create, update, and distribute specific modules, contributing to enhanced code reusability and maintainability.

Modules enable you to track and manage updates across all subscribing applications. This feature is advantageous for organizations seeking standardization, allowing them to enforce consistency in reusable work.

  • Abstraction:

Packages also provide a layer of abstraction on top of the basic entities, enabling developers to create complex processes and abstract them inside a package. Downstream developers can leverage these packages - leveraging these pre-packaged processes to accelerate development.

  • Upgradable & versioned:

Packages are upgradable and versioned. A single update to a package can be propagated to all instances consuming the package, and you can connect your packages to Git to deploy specific versions that you want to upgrade.

How to create reusable query and JavaScript modules within packages

This new feature enables you to create packages in Appsmith, similarly to how you create applications. Packages can contain modules, which are reusable components that can be used across multiple apps and pages within the same workspace.

There are two types of modules you can create: Query and JavaScript.

Query modules allow you to connect to a data source and create a reusable query. These modules offer dynamic inputs to change query parameters based on user interactions. To access its data in any application, follow these steps:

JavaScript modules can be used for JavaScript functions and objects. They encourage code reusability and a standardized methodology for data manipulation. Follow these steps to create JavaScript modules in your app:

For beta testers, this tutorial provides a step-by-step guide to get started.

What's coming next?

Packages and Modules are a significant step forward in enabling reusability in Appsmith, helping you accelerate your development, and ensuring that standardization and maintenance become very easy.

Soon, we'll be introducing UI Modules, which will enable:

  • Encapsulation of widgets and other UI components, which will enable reusability in the user interface.
  • Packages will also be composable, meaning they can reference other packages. This will allow you to create varying levels of abstraction to amplify your speed continually.

Packages and Modules are currently in beta in the Business and Enterprise EditionUpgrade now to Business Edition if you would like to use packages on your applications, and if you are looking for enterprise-grade support, be sure to contact our team.