Problem:
When developing with Taipy, there is currently no easy way to know the variables inside the State, along with their types. This makes it difficult to benefit from IDE autocompletion or assistance, causing more manual work, especially when tracking variables in multi-page applications. Without proper typing, developers cannot rely on their IDEs to prevent typos or suggest available methods, such as when working with a Pandas DataFrame or Plotly Figure stored in the state.
Proposed Solutions:
TypedState Class: Creating a TypedState class manually or dynamically could give developers insight into the variables in the State object, allowing autocompletion and type-checking.
Command Line Tool: A taipy generate-pyi command that could generate a .pyi file from the current state of the code could be useful to integrate variable typing with minimal manual effort.
Taipy Studio Integration: Generating typed variables directly in Taipy Studio might smooth the process and reduce manual work. This would allow the IDE to recognize and autocomplete variable types within the state.
Manual Variable Definition: Similar to what has been done with Taipy users, developers could manually define all the variables they use in their state. While effective, this approach might be difficult to maintain for large applications where states change frequently during interactions.
Challenges:
Dynamic updates: The state changes as the application runs, which makes it hard to define a moment to "freeze" the state and generate a .pyi file.
Workflow integration: Command-line generation or dynamic typing could disrupt smooth workflows, especially in a rapidly changing environment.
This issue focuses on improving IDE support for Taipy users, so developers can easily track and manage state variables. Integration of typed classes or better tooling in Taipy Studio could significantly enhance the coding experience.
Acceptance Criteria
[ ] Ensure new code is unit tested, and check code coverage is at least 90%.
[ ] Create related issue in taipy-doc for documentation and Release Notes.
[ ] Check if a new demo could be provided based on this, or if legacy demos could be benefit from it.
Description
Problem: When developing with Taipy, there is currently no easy way to know the variables inside the
State
, along with their types. This makes it difficult to benefit from IDE autocompletion or assistance, causing more manual work, especially when tracking variables in multi-page applications. Without proper typing, developers cannot rely on their IDEs to prevent typos or suggest available methods, such as when working with a Pandas DataFrame or Plotly Figure stored in the state.Proposed Solutions:
TypedState Class: Creating a
TypedState
class manually or dynamically could give developers insight into the variables in theState
object, allowing autocompletion and type-checking.Command Line Tool: A
taipy generate-pyi
command that could generate a.pyi
file from the current state of the code could be useful to integrate variable typing with minimal manual effort.Taipy Studio Integration: Generating typed variables directly in Taipy Studio might smooth the process and reduce manual work. This would allow the IDE to recognize and autocomplete variable types within the state.
Manual Variable Definition: Similar to what has been done with Taipy users, developers could manually define all the variables they use in their state. While effective, this approach might be difficult to maintain for large applications where states change frequently during interactions.
Challenges:
.pyi
file.This issue focuses on improving IDE support for Taipy users, so developers can easily track and manage state variables. Integration of typed classes or better tooling in Taipy Studio could significantly enhance the coding experience.
Acceptance Criteria
Code of Conduct