Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blazor] Globalization & localization - correct async JS interop #32433

Merged
merged 4 commits into from Apr 29, 2024

Conversation

hakenr
Copy link
Contributor

@hakenr hakenr commented Apr 27, 2024

@hakenr
Copy link
Contributor Author

hakenr commented Apr 27, 2024

@guardrex There is still one more instance of the Culture property in the Dynamically set the server-side culture by user preference section where the logic resides in the property's getter and setter (a practice neither I nor the documentation and code analyzers recommend). However, the setter does not invoke async JS interop.

Please let me know if I should also update this demo to use @bind:after (either in this PR or a separate one).

UPDATE: The documentation and code analysis are explicitly violated when the property used as a [Parameter] is not an auto-property. However, this is not the case here. Nevertheless, I believe that binding to properties that contain logic is inappropriate and should only be used in advanced scenarios.

@guardrex guardrex self-assigned this Apr 28, 2024
@guardrex
Copy link
Collaborator

Please let me know if I should also update this demo to use @bind:after ...

Yes, please feel free to address that on this PR. Fortunately, the version flipping in and out of 8.0 won't affect your update 馃槄.

@hakenr
Copy link
Contributor Author

hakenr commented Apr 28, 2024

Ready for review

Copy link
Collaborator

@guardrex guardrex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super-tiny-馃懚-NIT ... I'm going to place a blank line prior to the if lines. That's just to match our convention for if-blocks following other lines of code. UPDATE: Done! 馃憤

Fantastic set of updates ... again! Is there any such thing as Blazor MVP of the Year? There should be! I'll mention this one to Dan and Artak this Friday.

WRT the culture storage approach (local storage or loc cookie) for BWA apps, Mackinnon will be along in July/August to break the tie. He's going to decide which approach the article will take. Of course, I bet on Hisham because I'm I silly green hack-o-saurus 馃, and Hisham is like you ... a REAL programmer! 馃槅

@guardrex guardrex merged commit fb884a2 into dotnet:main Apr 29, 2024
3 checks passed
@hakenr hakenr deleted the patch-20 branch April 29, 2024 13:50
@hakenr
Copy link
Contributor Author

hakenr commented Apr 29, 2024

Fantastic set of updates ... again! Is there any such thing as Blazor MVP of the Year? There should be! I'll mention this one to Dan and Artak this Friday.

While I appreciate the praise as much as anyone, there's no need to overdo it. I'm just doing what I enjoy. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CultureSelector should call JS interop asynchronously
2 participants