Releases: vtfuture/RequireJSDotNet
1.0.13
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
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
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
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
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
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
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
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