-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
refactor(attr): treat empty string as no binding #1930
Merged
Merged
Conversation
This file contains 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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1930 +/- ##
==========================================
+ Coverage 88.58% 88.62% +0.04%
==========================================
Files 262 262
Lines 22870 22891 +21
Branches 5282 5288 +6
==========================================
+ Hits 20260 20288 +28
+ Misses 2610 2603 -7 ☔ View full report in Codecov by Sentry. |
AureliaEffect
pushed a commit
that referenced
this pull request
Apr 3, 2024
2.0.0-beta.14 (2024-04-03) **Features:** * **custom-attribute:** ability to find closest attr by name or ctor (#1928) ([ab28585](ab28585)) * **i18n:** support multiple versions of i18next (#1927) ([0789ee5](0789ee5)) **Bug Fixes:** * **enhance:** dont call app tasks from parent container (#1933) ([e7119ec](e7119ec)) * **form:** prevent actionless submission (#1931) ([1fc74d4](1fc74d4)) **Refactorings:** * **attr:** treat empty string as no binding (#1930) ([8fc5275](8fc5275))
AureliaEffect
pushed a commit
that referenced
this pull request
Apr 3, 2024
2.0.0-beta.14 (2024-04-03) **Features:** * **custom-attribute:** ability to find closest attr by name or ctor (#1928) ([ab28585](ab28585)) * **i18n:** support multiple versions of i18next (#1927) ([0789ee5](0789ee5)) **Bug Fixes:** * **enhance:** dont call app tasks from parent container (#1933) ([e7119ec](e7119ec)) * **form:** prevent actionless submission (#1931) ([1fc74d4](1fc74d4)) **Refactorings:** * **attr:** treat empty string as no binding (#1930) ([8fc5275](8fc5275))
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.
📖 Description
Currently, custom attributes with single value binding have a weirdness in their usage related to empty string, or no value usage. Consider the following template:
There is ambiguity between no-value and empty string as value for the primary bindable.
Current behavior is we are assuming attribute wants to have an empty string but this is not ideal.
BREAKING CHANGE:
This PR changes the default behavior when there's no value (
<div attr>
), or an empty string value (<div attr="">
) for a custom attribute usage, so that now there will be no binding created for the primary bindable. Applications that truely want to bind to an empty string can always use empty string expression like the following example:🎫 Issues
resolves #1911
cc @Sayan751 @fkleuver