IssueRaiser

[Epic] Reusable Queries & JS (Code Packages)

## 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 bind `Input.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: - Lot of repetition of actions. To the user, it feels like they are violating the best practices of DRY. - Increases the cost of maintaining actions as the user now needs to modify the same action in multiple places. ## Goals: 1. Giving the user a consistent discoverable way of binding across the entire product. If I can bind `Input1.text` in one place, I should be able to logically bind

Posted by mohanarpit on Nov 25, 2020, 12:35 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments

pricing (E-commerce)

[Epic] Reusable Queries & JS (Code Packages)

mohanarpitNov 25, 2020, 12:35 PM

## 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 bind `Input.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: - Lot of repetition of actions. To the user, it feels like they are violating the best practices of DRY. - Increases the cost of maintaining actions as the user now needs to modify the same action in multiple places. ## Goals: 1. Giving the user a consistent discoverable way of binding across the entire product. If I can bind `Input1.text` in one place, I should be able to logically bind

Comments (0)

No comments yet. Start the discussion.

Comment on this issue