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

ScriptTagHelper support for file globbing patterns in src #1577

Closed
DamianEdwards opened this Issue Nov 18, 2014 · 5 comments

Comments

Projects
None yet
3 participants
@DamianEdwards
Member

DamianEdwards commented Nov 18, 2014

The ScriptTagHelper should support file globbing patterns via the asp-src attribute as a way to indicate that multiple script tags should be rendered. This simplifies the management of script references during development when used in conjunction with the proposed EnvironmentTagHelper and a task runner such as Gulp for doing script bundling & minification.

e.g.

<environment name="Development">
    <script asp-src-include="js/**/*.js" asp-src-exclude="*.min.js"></script>
</environment>
<environment names="Staging,Production">
    <script src="~/js/site.min.js"></script>
</environment>

@DamianEdwards DamianEdwards added this to the 6.0.0-rc1 milestone Nov 18, 2014

@dougbu

This comment has been minimized.

Show comment
Hide comment
@dougbu

dougbu Nov 18, 2014

Member

@DamianEdwards could you add a few details on how this enhancement would interact w/ Gulp and the #1576 enhancement? For example would Gulp generate "~/js/site.min.js"?

And should the generated scripts for #1576 also support globbing? If yes, does the primary source contain the globs while the fallback specifies only a different root URI?

Member

dougbu commented Nov 18, 2014

@DamianEdwards could you add a few details on how this enhancement would interact w/ Gulp and the #1576 enhancement? For example would Gulp generate "~/js/site.min.js"?

And should the generated scripts for #1576 also support globbing? If yes, does the primary source contain the globs while the fallback specifies only a different root URI?

@DamianEdwards

This comment has been minimized.

Show comment
Hide comment
@DamianEdwards

DamianEdwards Nov 18, 2014

Member

@dougbu Yes, it's expected Grunt/Gulp would be used to generate ~/js/site.min.js during build/publish time.

Here's a full example using both features:

<environment name="Development">
    <script src="~/lib/jquery/jquery.js"></script>
    <script src="~/lib/jquery-validation/jquery.validate.js"></script>
    <script asp-src-include="js/**/*.js" asp-src-exclude="*.min.js"></script>
</environment>
<environment names="Staging,Production">
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.1.min.js"
            asp-fallback-src="~/lib/jquery/jquery.min.js"
            asp-fallback-test="window.jquery"></script>
    <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.min.js"
            asp-fallback-src="~/lib/jquery-validation/jquery.validate.min.js"
            asp-fallback-test="window.jquery && window.jquery.validate"></script>
    <script asp-src="~/js/site.min.js"></script>
</environment>
Member

DamianEdwards commented Nov 18, 2014

@dougbu Yes, it's expected Grunt/Gulp would be used to generate ~/js/site.min.js during build/publish time.

Here's a full example using both features:

<environment name="Development">
    <script src="~/lib/jquery/jquery.js"></script>
    <script src="~/lib/jquery-validation/jquery.validate.js"></script>
    <script asp-src-include="js/**/*.js" asp-src-exclude="*.min.js"></script>
</environment>
<environment names="Staging,Production">
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.1.min.js"
            asp-fallback-src="~/lib/jquery/jquery.min.js"
            asp-fallback-test="window.jquery"></script>
    <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.min.js"
            asp-fallback-src="~/lib/jquery-validation/jquery.validate.min.js"
            asp-fallback-test="window.jquery && window.jquery.validate"></script>
    <script asp-src="~/js/site.min.js"></script>
</environment>
@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Nov 18, 2014

Contributor

Should this be just part of the script tag feature design (which we didn't quite do yet)?

I like the pattern, I just want to keep the issue count under check.

Contributor

yishaigalatzer commented Nov 18, 2014

Should this be just part of the script tag feature design (which we didn't quite do yet)?

I like the pattern, I just want to keep the issue count under check.

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Nov 18, 2014

Contributor

Never mind, just noticed you made it go to RC rather than Beta2

Contributor

yishaigalatzer commented Nov 18, 2014

Never mind, just noticed you made it go to RC rather than Beta2

@yishaigalatzer yishaigalatzer modified the milestones: Backlog, 6.0.0-rc1 Nov 26, 2014

@DamianEdwards DamianEdwards modified the milestones: 6.0.0-rc1, Backlog Dec 11, 2014

@yishaigalatzer yishaigalatzer modified the milestones: 6.0.0-beta3, 6.0.0-rc1 Jan 11, 2015

@yishaigalatzer yishaigalatzer self-assigned this Jan 23, 2015

@NTaylorMullen NTaylorMullen changed the title from Tag Helpers: ScriptTagHelper support for file globbing patterns in src to ScriptTagHelper support for file globbing patterns in src Jan 23, 2015

DamianEdwards added a commit that referenced this issue Feb 25, 2015

DamianEdwards added a commit that referenced this issue Feb 25, 2015

DamianEdwards added a commit that referenced this issue Feb 26, 2015

DamianEdwards added a commit that referenced this issue Feb 26, 2015

DamianEdwards added a commit that referenced this issue Feb 26, 2015

DamianEdwards added a commit that referenced this issue Feb 26, 2015

DamianEdwards added a commit that referenced this issue Feb 26, 2015

DamianEdwards added a commit that referenced this issue Feb 26, 2015

DamianEdwards added a commit that referenced this issue Feb 26, 2015

DamianEdwards added a commit that referenced this issue Feb 26, 2015

DamianEdwards added a commit that referenced this issue Feb 26, 2015

DamianEdwards added a commit that referenced this issue Feb 26, 2015

DamianEdwards added a commit that referenced this issue Feb 26, 2015

DamianEdwards added a commit that referenced this issue Feb 26, 2015

DamianEdwards added a commit that referenced this issue Feb 27, 2015

@DamianEdwards DamianEdwards added 3 - Done and removed 2 - Working labels Feb 27, 2015

@DamianEdwards

This comment has been minimized.

Show comment
Hide comment
@DamianEdwards
Member

DamianEdwards commented Feb 27, 2015

Fixed in 8b64e3c

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