-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Implement @ObservableDefault macro #189
Open
kevinrpb
wants to merge
11
commits into
sindresorhus:main
Choose a base branch
from
kevinrpb:macros
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Commits on Sep 15, 2024
-
Implement @ObservableDefaults macro
This addresses sindresorhus#142 by creating a new macro that can be used inside `@Observable` classes. The macro is implemented in a new `DefaultsMacros` module. The decision to do so is based on the introduction of a new dependency on `swift-syntax`, and to keep the main module dependency-free.
Configuration menu - View commit details
-
Copy full SHA for 4827461 - Browse repository at this point
Copy the full SHA 4827461View commit details
Commits on Sep 18, 2024
-
Fix test names, add tests for @observable result
Tests for the macro declaration were in the wrong test target and the test method names were not accurate. Added another test target to actually test that the macro works when used in an @observable class.
Configuration menu - View commit details
-
Copy full SHA for 21c4281 - Browse repository at this point
Copy the full SHA 21c4281View commit details -
Configuration menu - View commit details
-
Copy full SHA for 85587a0 - Browse repository at this point
Copy the full SHA 85587a0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 028cdfb - Browse repository at this point
Copy the full SHA 028cdfbView commit details -
Rename
@ObservableDefaults
macro to@Default
This is to be consistent with the `@Default` property wrapper.
Configuration menu - View commit details
-
Copy full SHA for 70f569e - Browse repository at this point
Copy the full SHA 70f569eView commit details -
In the macro tests, I had to move the @observable classes out of the test because linter was asking to mark them as private but doing so was causing the @observable macro to error.
Configuration menu - View commit details
-
Copy full SHA for 6cc37e0 - Browse repository at this point
Copy the full SHA 6cc37e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 147892d - Browse repository at this point
Copy the full SHA 147892dView commit details
Commits on Sep 25, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 8708fd5 - Browse repository at this point
Copy the full SHA 8708fd5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1c9262c - Browse repository at this point
Copy the full SHA 1c9262cView commit details
Commits on Sep 26, 2024
-
Rename @default macro back to @ObservableDefault
We cannot overload @default, otherwise it is impossible to use the property wrapper version in the same source file as the macro as the later takes precedence.
Configuration menu - View commit details
-
Copy full SHA for 017a42d - Browse repository at this point
Copy the full SHA 017a42dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 242aba5 - Browse repository at this point
Copy the full SHA 242aba5View commit details
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.