All Versions
21
Latest Version
2.0
Avg Release Cycle
80 days
Latest Release
2406 days ago

Changelog History
Page 2

  • v2.0.0-beta2 Changes

    December 19, 2019

    What'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, 2017

    What'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

    • ๐Ÿ›  Fix ViewBag not passed to the engine #97
    • Close stream after read - #120
    • ๐Ÿ›  Fix concurrent template build fails - #103
  • v2.0-alpha3 Changes

    September 23, 2017

    What 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, 2017

    What 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 called CompileTemplateAsync
  • v2.0-alpha1 Changes

    September 18, 2017

    2.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, 2017

    What'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, 2017

    What's new:

    • โšก๏ธ Update nuget packages to 1.1
    • ๐Ÿ›  Minor bug fixes
  • v1.0.0-rc2 Changes

    February 20, 2017

    What'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