-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
Additional JS initializer scenarios #28492
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the scenario:
Ensuring that Blazor has been initialized before calling into it from your library.
I don't think we currently cover this in the JS initializers section of the document. Could we have an example where we interact with one of the Blazor
JS APIs in an afterStarted()
callback? e.g., register a custom event, add a root component.
Thanks, @MackinnonBuck ...
WRT the updates for this PR, let me get back to you later in the week. I'm working Blazor security topics today, and I'll be on the road moving to another city on Wednesday 🚚. I'll be back on Thursday/Friday to update this PR. |
@MackinnonBuck ... So much for Thursday/Friday! 😄 ... The move across the state of Florida has been a BEAST 👹. Things are stabilizing here now. WRT the updates thus far, I addressed the feedback points. I'm working the last two items, custom events and root components. When I started with custom events, I noted that our coverage is lacking. I couldn't get the base case described by the doc to work. I've taken Steve's advice at dotnet/aspnetcore#37012 (comment), and that fixed it. I'm moving on to the JS initializer coverage for it now. UPDATE: Custom events done ... moving to root components now. UPDATE: Root components done. Must fix a merge conflict tho. Stand-by ...... |
@MackinnonBuck ... Ok ... there's at least enough there for you to punch me 👦🤛😵 on ... The custom events example for 6.0/7.0 now doesn't use the The root component example keeps it's current While updating the custom event section, I noticed that our current guidance just didn't work OOB following the steps. It really did need Steve's remarks from dotnet/aspnetcore#37012 (comment) rolled into it, so I have that here now. Also ... a NIT ... it needed to have the I'm more concerned about the root components part, but l'll see what you think. It might be quicker/easier to look at the review topics. These link to the relevant sections ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Just a couple remaining questions/suggestions, but I think this should be good to merge after those are addressed 🙂
Thanks, @MackinnonBuck! 🎸 I'll make those edits and merge this. |
Fixes #26363
Since the issue was opened (July, '22), PRs have at least partially addressed the ask. In the first version of JS initializer coverage, our examples merely called
console.log
. These days, we show how to append custom scripts to the head to load them.Today, I'm trying to figure out what's missing. What's on this PR might not address all of the asks. What's on here seems to me to be the obvious scenarios.
Here's the original list from the issue ...
Here are the sections that I thought to add today on top of prior PRs that have improved the coverage ...
.js
/.mjs
)