Skip to content

Releases: vtfuture/RequireJSDotNet

1.0.13

04 Nov 15:44
Compare
Choose a tag to compare
New in RequireJS.NET v1.0.13

This release ads support for the area/controller/action.js naming and is backwards compatible with area/controller/controller-action.js

1.0.12

31 Oct 11:37
Compare
Choose a tag to compare
New in RequireJS.NET v1.0.12

RenderRequireJsSetup sets the locale value using Thread.CurrentThread.CurrentCulture, when the thread culture changes, the JS modules can access it using the global variable requireConfig.locale, the RequireJS i18n plugin will read from require.locale

RenderRequireJsSetup emits the following code when CurrentCulture is set to ro-RO:

<script type="text/javascript">
    var requireConfig = {
    locale:'ro',
    pageOptions:{ ... },
    websiteOptions:{ ... }
    };

    var require = {
    locale:'ro',
    baseUrl:'/Scripts',
    paths:{ ... },
    shim:{ ... }
    };
</script>

<script data-main="Controllers/Root/Home/Home-Index" src="/Scripts/require.js">
</script>

1.0.8

24 Oct 15:27
Compare
Choose a tag to compare
New in RequireJS.NET v1.0.8

This release ads auto resolve config path feature to RenderRequireJsSetup and fixes a crash when page and global options where null due to missing js code behind file.

Example: Load different configs based on debug/release

@if (HttpContext.Current.IsDebuggingEnabled)
{
    @Html.RenderRequireJsSetup(Url.Content("~/Scripts"),
        Url.Content("~/Scripts/require.js"),
        new [] 
        {
            "~/RequireJS.shared.config", 
            "~/RequireJS.config"
        })
}
else
{
    @Html.RenderRequireJsSetup(Url.Content("~/Scripts"),
        Url.Content("~/Scripts/require.js"),
        Server.MapPath("~/RequireJS.release.config"))
}

1.0.7

16 Oct 16:08
Compare
Choose a tag to compare
New in RequireJS.NET v1.0.7

RenderRequireJsSetup accepts multiple config files, merges all paths and shims, will throw error if duplicates are found.

Using this feature, you can create a shared config, and for each MVC area a different file, inside the layout file for each area you can merge the dedicated config with the shared one.

@Html.RenderRequireJsSetup(Url.Content("~/Scripts"),
    Url.Content("~/Scripts/require.js"),
    new List<string>
    {
        Server.MapPath("~/RequireJS.shared.config"),
        Server.MapPath("~/RequireJS.config")
    })

1.0.6

14 Oct 13:45
Compare
Choose a tag to compare
New in RequireJS.NET v1.0.6

RenderRequireJsSetup has a new optional param configPath, using configPath you can override the default config file.

Example of loading RequireJS.release.config when the website is running in release mode:

@using RequireJS

<!DOCTYPE html>
<html>
    ....
    <body>
    ....

    @if (HttpContext.Current.IsDebuggingEnabled)
    {
        @Html.RenderRequireJsSetup(Url.Content("~/Scripts"),
        Url.Content("~/Scripts/require.js"))
    }
    else
    {
        @Html.RenderRequireJsSetup(Url.Content("~/Scripts"),
        Url.Content("~/Scripts/require.js"),
        Server.MapPath("~/RequireJS.release.config"))
    }

    </body>
</html>

1.0.4

29 Aug 19:42
Compare
Choose a tag to compare
New in RequireJS.NET v1.0.4

Breaking change! _RequireSetup.cshtml partial view has been dropped, it's been replaced by RenderRequireJsSetup HTML helper.

In Layout, instead of using @Html.Partial("_RequireSetup") should be:

@using RequireJS

<!DOCTYPE html>
<html>
    ....
    <body>
        ....
        @Html.RenderRequireJsSetup(Url.Content("~/Scripts"), Url.Content("~/Scripts/require.js"))
    </body>
</html>

1.0.3

29 Aug 15:13
Compare
Choose a tag to compare
New in RequireJS.NET v1.0.3
  • Added suport for RequireJsOptions to be modifed from views
ViewBag.PageOptions.Add("Option", "value");
  • Options serialization moved to _RequireSetup.cshtml
@using RequireJS
@{   
    var entryPointPath = Html.RequireJsEntryPoint();
    var pageOptions = new MvcHtmlString(RequireJsOptions.ConvertToJsObject(ViewBag.PageOptions));
    var websiteOptions = new MvcHtmlString(RequireJsOptions.ConvertToJsObject(ViewBag.GlobalOptions));
}
    var requireConfig = {
        pageOptions: @pageOptions,
        websiteOptions: @websiteOptions
    };

    var require = {
        locale: '@Html.CurrentCulture()',
        baseUrl: '@Url.Content("~/Scripts")',
        paths: @Html.GetRequireJsPaths(),
        shim: @Html.GetRequireJsShim()
    };

1.0.2

26 Aug 14:15
Compare
Choose a tag to compare
NuGet Package

PM> Install-Package RequireJsNet

Changelog
  • added nuspec for RequireJsNet assembly
  • on Build Release GetRequireJsPaths will load RequireJS.Release.config if file exists, otherwise will load RequireJS.config
  • fix for images in css bundle with CssRewriteUrlTransform
  • rename websiteOptions to globalOptions
  • rename namespaces