Skip to content

Conversation

@guardrex
Copy link
Collaborator

@guardrex guardrex commented Sep 16, 2021

Fixes #23299

I think the best way to go is via an INCLUDES file that can be placed in a few strategic spots ... as long as such a file covers all of the scenarios (app model and script locations).

Notes on the INCLUDES file:

  • I'm only going to work this into the Blazor topics on this PR. The RP/MVC topics need a little work ... e.g., they're like 2.0-era (literally 2.0, not 2.1) and don't use whole-topic versioning ... and I'm not sure exactly where the best spots for coverage are, but I imagine they will be similar ... e.g., in the RP and MVC Overview (index.md) files and the RP/MVC RCL topic (ui-class.md).
  • I prefer not to include the heading for a few reasons: I want to change that text on a per-topic basis. Also, I can't know 100% that the heading level will always be 2nd level, either in Blazor topics or elsewhere in the overall ToC.
  • I prefer not to version the content because you know how we can run into moniker ranges within moniker ranges errors doing that sometimes. That's certainly the case for Blazor ... the files where this is used are on whole-topic versioning, so this file will break that if it includes versioned content.
  • I considered a few different approaches with and without significant use of placeholders, but the use placeholders (as seen on the current PR) seems to be the best (quicker anyway 🏃) way to cover these scenarios. The approaches are called out cleanly I think. I doubt devs will have a problem with this.

I recommend opening a separate issue to address this feature for RP/MVC. This PR will be merged, so the INCLUDES file will be present for the doc author and can then be touched up for RP/MVC scenarios as needed. If the doc author decides that a different INCLUDES file makes more sense, ping me 👂 on the PR because I'd like to move the INCLUDES file of this PR into the Blazor ToC's includes folder and update the content for Blazor-only scenarios.

@guardrex guardrex marked this pull request as ready for review September 16, 2021 13:57
@guardrex
Copy link
Collaborator Author

Thanks @Rick-Anderson ... I'm going to look this over one more time after lunch 🥪 before merging.

@guardrex guardrex changed the title JS file collocation with pages/views/components JS file collocation with Razor components Sep 16, 2021
@guardrex guardrex merged commit e5c7036 into main Sep 16, 2021
@guardrex guardrex deleted the guardrex-patch-2 branch September 16, 2021 15:48
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.

Collocate JavaScript files with pages, views, and components

3 participants