Change Watch Keyword to Bind - #27
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR renames the WPF DSL keyword Watch to Bind, updates module exports accordingly, and propagates the new syntax (Bind <Property> -To <StatePath> ...) across docs, examples, and tests to reflect the new public API.
Changes:
- Replaced
WatchwithBindin the exported DSL surface (and added a test ensuringWatchis no longer exported). - Updated examples/docs to the new
Bind ... -To ...usage, including the keyword reference page. - Adjusted related tests/examples to match current behavior (e.g., App content-host margin assertions) and added minor function metadata (
[OutputType([bool])]).
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/modules/WPF/WPF.psd1 | Updates exported function list: removes Watch, exports Bind. |
| src/modules/WPF/Tests/ImageViewer.Example.Tests.ps1 | Updates example-content assertions from Watch to Bind ... -To .... |
| src/modules/WPF/Tests/DSL/App.Tests.ps1 | Updates expected content-host margin values to match current App implementation. |
| src/modules/WPF/Tests/Bind.Tests.ps1 | Renames coverage from Watch→Bind and asserts Watch is not exported. |
| src/modules/WPF/README.md | Updates README example usage to Bind ... -To .... |
| src/modules/WPF/Public/Helpers/Set-WPFWindowFullScreen.ps1 | Updates comment to reference Bind callbacks. |
| src/modules/WPF/Public/Helpers/New-WPFObservableState.ps1 | Updates help text to reference Bind instead of Watch. |
| src/modules/WPF/Public/DSL/Helpers/State.ps1 | Updates help text to reference Bind instead of Watch. |
| src/modules/WPF/Public/DSL/Helpers/BindProperty.ps1 | Clarifies docs about internal Binding creation and $this in scriptblock. |
| src/modules/WPF/Public/DSL/Helpers/Binding.ps1 | Clarifies docs around when to use Binding vs BindProperty. |
| src/modules/WPF/Public/DSL/Helpers/Bind.ps1 | Renames the keyword implementation Watch→Bind and changes the API to use -To. |
| src/modules/WPF/Examples/ReadmeExample/ReadmeExample.ps1 | Updates example script to Bind ... -To .... |
| src/modules/WPF/Examples/ImageViewer/ImageViewer.DSL.ps1 | Updates ImageViewer DSL usage from Watch to Bind ... -To .... |
| src/modules/WPF/Examples/ImageViewer/functions/Test-ImageViewerShouldNavigate.ps1 | Adds comment-based help and [OutputType([bool])]. |
| src/modules/WPF/Docs/KeywordReference.md | Updates keyword reference TOC/content from Watch→Bind and updates examples. |
Comments suppressed due to low confidence (1)
src/modules/WPF/Public/DSL/Helpers/Bind.ps1:15
- In the help text, the description of the -To path still says the last segment is the observable property "to watch", which is inconsistent with the keyword rename to Bind. This makes the docs confusing for users learning the new API.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.