Changelog History
Page 2
-
v2.0.0-beta2 Changes
December 19, 2019What's new
- #123 Template now shares model with layout.
- #107 Embedded project can now accept Assembly + root namespace as a string, instead of Type of root object
- #152 Allow FileSystemProject to set Extension ( @KorsG )
- ๐ #180 Add ability to exclude assemblies from metadata references ( @mscrivo )
- ๐ #278 Add netcore 3.0 support ( @gjunge )
๐ Bug fixes:
- ๐ #103 - Fixed race condition compilation bug
- ๐ #134 - Fixed rendering issues with included templates
- ๐ #135 - Fixed ViewBag doesn't work in nested templates (@deckertron9000)
- ๐ #141, #147, #133 - Resolve MetadataReferences without using DependencyContext on Full .NET Framework (@colinbull )
- ๐ #153 - Fixed MemoryCachingProvider file naming (@KorsG )
- @Raw() will not throw NullReferenceException on null or empty value (@ReinisV1 )
๐ฅ Breaking changes
- ๐ EngineFactory will trigger build error. Marked completely Obsolette. Use RazorLightEngineBuilder instead
- When template you want to render does not exist, TemplateNotFoundException will be throws instead of InvalidOperationException
-
v2.0.0-beta1 Changes
December 22, 2017What's new?
๐ฅ Breaking changes
- Added new type: RazorLightEngineBuilder that comes to replace EngineFactory, as too many overloads are annoying
- EngineFactory masked as Obsolete.
- ๐ EngineFactory.RazorEngine is moved to DefaultRazorEngine.Instance
- ICompilationService.CompileAndEmit renamed to CompileAsync and returns Task
- 0๏ธโฃ DefaultCachingProvider renamed to MemoryCachingProvider
๐จ Note: there was a major refactoring, you may find some classes are moved to another namespaces
๐ New features
Templates that are resolved from FileSystem are now invalidated from MemoryCache when you change it.
You can now create an engine without a project, if you want to only create templates from strings - #110
It is possible now to create engine without caching provider
โ Add ability to set operating assembly (uses EntryAssembly if not specified)
Disable encoding for the entire document with template property "DisableEncoding" - #106
๐ Bug fixes
-
v2.0-alpha3 Changes
September 23, 2017What is new?
String rendering is back!
๐ We added rendering of the strings back! And now they are cached, so you will not be affected by bad performance.
Note: if you store your templates in database - it is recommended approach to define custom RazorLightProject that fetches templates from database and create RazorLightEngine passing your implementation to it. This way, engine will your RazorLightProject to resolve layouts. String rendering is just another option for some exclusive use cases when you have microservice structure and pass templates between nodes, so you might not need it at all.
Here is an example of RazorLightProject that uses EntityFramework to get templates from database- https://github.com/toddams/RazorLight/blob/dev-2.0/samples/RazorLight.Samples/Program.cs
string templateKey = "key";string result = await engine.CompileRenderAsync(templateKey , "Hello @Model.Name", new { Name = "Johny" });//Returns true, so next time you render template with this key - it will not be compiled, but taken from cacheengine.TemplateCache.Contains(templateKey);
โ Additional metadata references
๐ When RazorLight compiles your template - it loads all the assemblies from your entry assembly and creates MetadataReference from it. This is a default strategy and it works in 99% of the time. But sometimes compilation crashes with an exception message like "Can not find assembly My.Super.Assembly2000". In order to solve this problem you can pass additional metadata references to RazorLight.
var options = new RazorLightOptions();var metadataReference = MetadataReference.CreateFromFile("path-to-your-assembly")options.AdditionalMetadataReferences.Add(metadataReference );var project = new FileSystemRazorProject("path-to-your-views");var engine = new EngineFactory().Create(project, options);
-
v2.0-alpha2 Changes
September 18, 2017What is new?
- โ Added support for includes via @{ await IncludeAsync("key", model); }
- Disable encoding
As always, you can avoid encoding using @Raw() function
@Raw(Model.Data)
Or disable encoding for entire document
@{ DisableEncoding = true; }
๐ฅ Breaking change
GetTemplateAsync
is now calledCompileTemplateAsync
-
v2.0-alpha1 Changes
September 18, 20172.0 alpha version is out
This is not a full list of changes, only key notes about the changes and important info
- There are a lot of breaking changes. Project literally has been made from scratch
- ๐ IRazorLight interface is still there. There is no "Parse" method. Use "CompileRenderAsync" instead (method names might change in future releases)
- EngineFactory no longer static
- No IEngineConfiguration yet.
- No MVC version with @Inject yet.
- No ViewStarts yet
- FileSystem templates are not tracked and therefore are not invalidated from cache yet when you change them
- No string caching (Most people used it to for templates that are taken from database. Recommended approach is to create custom RazorLightProject class that will load your templates from database. That's all you need and this way, your templates will be cached). I will create a sample tomorrow with EntityFramework and NpgSql
So what is implemented?
- ๐ Basic Razor support
- Model
- Layout,
- Sections
- Caching
-
v1.1.0 Changes
May 01, 2017- ๐ Fixed bug with Configuration.Namespace not applied to the template
- โฌ๏ธ Downgrade dependency on Codeanalysis.CSharp to 1.3.0 to avoid nuget version conflicts with ASP.NET MVC
-
v1.0.1 Changes
April 14, 2017What's new
- #49 TemplateCompilationException now includes line and column number where an error occured
- ๐ #46 Added new overload for Parse() method. Now you can set a PreCenderCallback for each page individually. (Before you could only add callbacks to IEngineConfiguration that are applied for each page)
๐ Bug fixes
- ๐ Fix #47 (ExpandoObject as model type throws RuntimeBinderException)
-
v1.0.0 Changes
April 05, 2017What's new:
- โก๏ธ Update nuget packages to 1.1
- ๐ Minor bug fixes
-
v1.0.0-rc2 Changes
February 20, 2017What's new:
- Project migrated to MSBuild / *.csproj
- ๐ป For the convenience, compilation errors are now shown in Exception Message. No need to inspect CompilationErrors.
- EngineFactory now returns IRazorLightEngine (was RazorLightEngine)
- ๐ Minor bug fixes
-
v1.0.0-rc1 Changes
October 13, 2016๐ Out first Release Candidate!
๐ This release comes out with some improvements and refactorings. We are planning to roll up a stable version soon
- ๐
ParseString()
is extracted to an extension method (under RazorLight.Extensions namespace) - ๐ PreRenderCallbacks moved to
IEngineConfiguration
- While searching for Layout file - instead of
InvalidOperationException
-RazorLightException
is thrown - ๐ No more
AggregateExceptions
. I'm erasing annoying AggregateExceptions from code. Please, open an issue If you see it again somewhere
- ๐