Skip to content
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

Compare with RazorLight. #58

Closed
MNF opened this issue May 15, 2021 · 7 comments
Closed

Compare with RazorLight. #58

MNF opened this issue May 15, 2021 · 7 comments

Comments

@MNF
Copy link

MNF commented May 15, 2021

Could you please add to Readme comparison, why someone should choose your library compare to https://github.com/toddams/RazorLight.

Just as curiosity, what was the reason to create an alternative library, when one similar already existed?

@adoconnection
Copy link
Owner

adoconnection commented May 21, 2021

Hi! First of all I appreciate toddams's work and it's great to have a choice of what library to use.

RazorLight as I see it, although it can render strings, it is aiming to be view engine framework detached from MVC relying on files a lot.
Wheres my implementration aiming to be "I just want to render template from string" library. No asking any extras.

At a time I started RazorEngineCore I was looking for a library to be able:

  • save / load compiled templates - RazorLight does not support it
  • transparent caching - RazorLight have ICachingProvider but you are unable to implement anything but memory cache
  • transparent compiled template handling - once I have a template handle I can render it at any time unlike RazorLight where I have to construct entire engine every time.
  • custom template properties and methods (https://github.com/adoconnection/RazorEngineCore#helpers-and-custom-members)
  • personally CompileRenderString method is making me nuts :) as a questionable decision to blindly migrate it from https://github.com/Antaris/RazorEngine
  • RazorLight is HTML safe by default, RazorEngineCore is HTML unsafe by default (see wiki: @Raw)

noone was able to provide that, so I did RazorEngineCore
Basically we do the same, but I strongly belive razor engine should work in a way RazorEngineCore do and not like RazorLight :)

@MNF
Copy link
Author

MNF commented May 21, 2021

Great answer.
Please consider to copy to Readme or Wiki (or link from them to this answer)

@304NotModified
Copy link
Contributor

304NotModified commented Jul 24, 2021

  • razorlight is by default safe for producing html, as it does html encoding by default (opt out). Unfortunately not that case for RazorEngineCore

@benmccallum
Copy link

Is that true @adoconnection regarding no html encoding by default? That's a bit of a deal breaker for me as we've got client input being sent around by emails.

RazorLight looks a little unmaintained for my liking though, has been on rc forever. Rock and a hard place at the moment.

@304NotModified
Copy link
Contributor

304NotModified commented Aug 12, 2021

RazorLight looks a little unmaintained for my liking though, has been on rc forever.

Also noticed that indeed.

Is that true @adoconnection regarding no html encoding by default? That's a bit of a deal breaker for me as we've got client input being sent around by emails.

See #65. But those are work arounds and won't work for every case. Also it uses a prerelease package

@adoconnection
Copy link
Owner

I have updated #65 to keep HTML safety discussion in one issue.

@adoconnection
Copy link
Owner

I have started wiki page to close this issue.
all improvements are welcome!

https://github.com/adoconnection/RazorEngineCore/wiki/Package-comparison

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants