-
Notifications
You must be signed in to change notification settings - Fork 172
Add flutter-app-runtime rule for proactive hot reload #220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| description: Proactively connect to running Dart/Flutter apps and trigger hot reload or hot restart using the flutter-app-runtime skill workflows upon editing .dart files. | ||
| trigger: glob | ||
| globs: "**/*.dart" | ||
| --- | ||
|
|
||
| # Proactive Flutter Hot Reload Rule | ||
|
|
||
| Whenever you edit or modify any `.dart` file in this project, adhere to the runtime management procedures in the `flutter-app-runtime` skill: | ||
|
|
||
| 1. **Refer to Skill**: | ||
| - Activate and follow the `flutter-app-runtime` skill workflows for Dart Tooling Daemon (`dtd`), hot reloading, hot restarting, and runtime error inspection. | ||
|
Comment on lines
+9
to
+12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Skill will be added in #221 |
||
|
|
||
| 2. **Discover & Connect**: | ||
| - Discover active running application instances using the `dtd` tool (or `list_running_apps` / `vm_service`). | ||
|
|
||
| 3. **Trigger Hot Reload / Hot Restart**: | ||
| - Execute `hot_reload` immediately after making changes to UI widgets or simple methods. | ||
| - Execute `hot_restart` if fundamental logic, stateful widgets or logic affecting variables that stateful widgets use, state initialization, or `main()` was modified. | ||
|
|
||
| 4. **Verify Runtime Stability**: | ||
| - Run `get_runtime_errors` via `dart-mcp-server` to confirm that the hot reload/restart did not introduce new exceptions. | ||
|
|
||
| 5. **Fallback Handling**: | ||
| - If no running app instance is connected via DTD, briefly inform the user, but do not let it stop you from completing the code edits. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| --- | ||
| description: Proactively connect to running Dart/Flutter apps and trigger hot reload or hot restart using the flutter-app-runtime skill workflows upon editing .dart files. | ||
| trigger: glob | ||
| globs: "**/*.dart" | ||
| alwaysApply: false | ||
| --- | ||
|
|
||
| # Proactive Flutter Hot Reload Rule | ||
|
|
||
| Whenever you edit or modify any `.dart` file in this project, adhere to the runtime management procedures in the `flutter-app-runtime` skill: | ||
|
|
||
| 1. **Refer to Skill**: | ||
| - Activate and follow the `flutter-app-runtime` skill workflows for Dart Tooling Daemon (`dtd`), hot reloading, hot restarting, and runtime error inspection. | ||
|
Comment on lines
+10
to
+13
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above, will be added |
||
|
|
||
| 2. **Discover & Connect**: | ||
| - Discover active running application instances using the `dtd` tool (or `list_running_apps` / `vm_service`). | ||
|
|
||
| 3. **Trigger Hot Reload / Hot Restart**: | ||
| - Execute `hot_reload` immediately after making changes to UI widgets or simple methods. | ||
| - Execute `hot_restart` if fundamental logic, stateful widgets or logic affecting variables that stateful widgets use, state initialization, or `main()` was modified. | ||
|
|
||
| 4. **Verify Runtime Stability**: | ||
| - Run `get_runtime_errors` via `dart-mcp-server` to confirm that the hot reload/restart did not introduce new exceptions. | ||
|
Comment on lines
+21
to
+22
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should not be part of this rule IMO. This is expensive to run after each hot reload / hot restart and is a bit of scope creep. Debugging runtime errors is a separate user journey. |
||
|
|
||
| 5. **Fallback Handling**: | ||
| - If no running app instance is connected via DTD, briefly inform the user, but do not let it stop you from completing the code edits. | ||
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous rule file
rules/hot_reload.mdincludedtrigger: globin its frontmatter. If the rule parser requires this field to trigger the rule on glob matches, it should be retained in the newrules/flutter-app-runtime.mdfile.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done