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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix element-ref-across-components example #463

Merged
merged 2 commits into from
Jan 28, 2025
Merged

Conversation

guardrex
Copy link
Collaborator

@guardrex guardrex commented Jan 28, 2025

Fixes #462

cc: @hakenr ... I'm going to paste the issue text here for easy reference. I'll chat with Dan and Larry soon about using the latest SDK to get the collection simplification feature.

The article section at ...

https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/call-javascript-from-dotnet?view=aspnetcore-9.0#reference-elements-across-components

... is OK. However, the sample apps aren't fully functional. In the old days, the samples merely provided code. Lately, we've been fixing up the old samples to run as well. The element-ref-across-components approach requires a couple of changes in the early sample apps:

  • The red CSS class is missing.
  • The default/OOB SurveyPrompt in the homepage breaks the app because it doesn't adopt the strategy.

I also found out that the collection simplification can be placed into these pre-C# 12.0 apps because the latest compiler is smart enough to magically ✨ compile the code. I'll chat with Dan and Larry offline about the wisdom of having devs use the latest SDK for any given earlier version. We will NOT use the new C# feature. We'll just stick with ...

new object[] { value, "red" }

... in <8.0 code. AND ... it wouldn't build here anyway because I use the SDK for each release build in the code validation Action script.

@guardrex
Copy link
Collaborator Author

🎉

❤️ the code validation Action script! Fantastic! 😄

@guardrex guardrex merged commit dbca3f4 into main Jan 28, 2025
2 checks passed
@guardrex guardrex deleted the guardrex/code-updates branch January 28, 2025 14:22
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.

Fix broken element-ref-across-components example
1 participant