Open mohanarpit opened 3 years ago
@macasas I fully agree with that thought process and as I mentioned we do plan to introduce some form of reusability that will enable the community to implement DRY in their apps before they upgrade. We're just starting with releasing it for business first. You can read about this here with our thoughts on it. These thoughts will evolve over time as we learn about the usage of this feature and we extend support to the community. https://community.appsmith.com/content/blog/boosting-productivity-reusability
I just want to leave you all with the final thoughts that
I'd like to share that Appsmith Reusability Beta is already available for the self-hosted business and enterprise users as announced in this blog post.
You should be using v1.17 or later.
We're launching this Beta program so that we can continuously improve the experience of this functionality while still working on it based on your feedback and usage. If you want to share your thoughts, feedback, questions, or what didn't quite work for you, you just need to choose a 30 min slot that suits well in your agenda using the following link:
Book 30min slot to provide feedback about Appsmith Reusability Beta
Thank you.
Problem
Today, all actions (API, DB Query, JS functions) created within Appsmith are page-scoped. This means that they are only accessible from within the page and not across pages within the same application. Often, this confuses users. They expect actions to be global to the entire application. This is because in normal coding practices, that is what they expect.
In order to resolve this, we need to create a way for users to create actions that are accessible across pages and are scoped within the application instead of the page.
Why were Actions page-scoped in the first place?
During dynamic binding, we want to give users a consistent experience. If they are able to bind
Input.text
in the UI canvas they should also be able to bindInput.text
in the API pane. If we treat Actions as pure functions, that would mean the action requires variables to be passed into it. This breaks the users mental model of how Appsmith works.Unfortunately, a side-effect of this is that if the user has bound
Input1.text
in the API, they can't re-use this API with other inputs. This leads to:Goals:
Input1.text
in one place, I should be able to logically bindInput1.text
in another place.Potential Solutions:
Have a section called "Global Actions". The user can then create Actions local to the page while also moving them to a global place. The global actions will have variables of the nature "x, y". These actions can now only be invoked via JS that sets the x & y values before calling
Api1.run()
.Any other thoughts here ... ?
Success criteria
A user should be able to define an Action once in the entire application and then re-use it in multiple places with different input parameters.
RACI
| ------------- | ------------- | | Responsible | @arunvjn @Rishabh-Rathod | | Accountable | @arunvjn | | Consulted | @Nikhil-Nandagopal, @mohanarpit @ajinkyakulkarni | | Informed | @parth-appsmith |
Front conversations