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

JS interop script location (2) #28051

Merged
merged 2 commits into from
Jan 10, 2023

Conversation

guardrex
Copy link
Collaborator

@guardrex guardrex commented Jan 10, 2023

Fixes #28044

cc: @plastovicka ... There's a bit of churn on this one! 😵😄 I think this will solve most of the problems. I might need a little more PU feedback, but this is moving in the right direction.

In this follow-up PR ...

  • I'm refactoring 6.0+ coverage to focus entirely on using JS initializers for controlling the timing of script loading either before or after Blazor starts.
  • I'm going to use script loading as the examples in the JS initializer section of the Startup article.
  • We won't describe the bit that Steve remarked on pertaining to how the Blazor JS engine is blocked based on other scripts loading merely by the order of their presence in the index.html or {_Host|_Layout}.cshtml files. I'll continue to be 👂 for further PU remarks on this. I might need to do a little more work on this aspect, but let's see how it goes. My take on PU remarks thus far is that JS initializers are the way to go 👍 when you want to guarantee before or after JS tasks, including script loading.
  • I'm removing the section of chaining with then on Blazor.start for script loading control in 6.0+ in favor of JS intializers. Until further notice from the PU, we'll keep the Chain to the Promise that results from a manual start section for all doc versions, which is generic and doesn't focus on script loading. Again, I might need to do a hair more work on this because the docs don't clarify exact use cases for the chaining approach with then versus the afterStarted approach. I've created a separate tracking remark in Blazor project tracking 2023 #28001 to remind myself to investigate and possibly cover this further on a future PR.

@guardrex guardrex merged commit f4b6393 into main Jan 10, 2023
@guardrex guardrex deleted the guardrex/blazor-js-interop-script-location branch January 10, 2023 10:09
Donciavas pushed a commit to Donciavas/AspNetCore.Docs that referenced this pull request Feb 7, 2024
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.

Blazor components external JavaScript files
1 participant