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

depends-on in script/style tag helpers don't cause the dependency to be included if it wasn't already #16540

Open
Piedone opened this issue Aug 7, 2024 · 1 comment

Comments

@Piedone
Copy link
Member

Piedone commented Aug 7, 2024

Describe the bug

Following up from #16531 (comment).

The depends-on attribute available in script/tag helpers looks like it should work the same as declaring a dependency in a resource manifest, and cause the dependency to be included. This doesn't happen though, and the dependency is not included. The dependency order is only enforced when it was already included before.

In the manifest one uses ResourceDefinition.SetDependencies, and the tag helpers use RequireSettings.SetDependencies. Both are expanded in the same way in ResourceManager.ExpandDependenciesImplementation though, but still.

Orchard Core version

Latest main: 5c45566

To Reproduce

  1. Set up new site with Blog.
  2. Add this to AdminDashboard.cshtml:
<script at="Foot" depends-on="jquery-resizable">
    console.log("hello");
</script>
  1. Visit /Admin. Notice that while the script is included, jquery-resizable is not.
  2. Also add <script asp-name="jquery-resizable"></script> a line above.
  3. Notice that jquery-resizable is now included, correctly above the inline script.

With 1.8.3 BTW the behavior is the same, so this is not a regression.

Expected behavior

jquery-resizable is included also under step 2.

Logs and screenshots

Copy link
Contributor

github-actions bot commented Aug 8, 2024

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

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

No branches or pull requests

2 participants