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

Asp net core support #79

Merged
merged 17 commits into from
Apr 24, 2024
Merged

Asp net core support #79

merged 17 commits into from
Apr 24, 2024

Conversation

bounav
Copy link
Collaborator

@bounav bounav commented Apr 19, 2024

  • New csproj that targets .net 8.0
  • Moved precompilation bits from the SparkViewFactory class to its own class
  • H() method replaced with OutputValue(object value, bool automaticEncoding) in the base classes all generated views inherit from, this simplified the HTML encoding of values.

bounav and others added 15 commits January 24, 2024 09:20
…ependencies

- Now using constructor injection instead of auto-initializing properties
- Removed ISparkServiceInitialize and ISparkServiceContainer (and it's implementation)
- New IBatchCompiler interface so that we can use different compilers
- ~2x performance improvement when compiling views with Roslyn
- CodeDom compilation can still be used at the moment (class marked as obsolete)
- CastleMonoRail still using codedom (rosylin doesn't like the assembly name when compiling in that project)
…ewEngine/spark into microsoft-di-and-roslyn-compiler
- CodeDom complilation cannot target .net core
- BatchCompiler.cs contains the code to complile with codedom and/or roslyn
- Improved readability of RemoveSuffix method
- Renamed ISparkSettings.PageBaseType to BaseClassTypeName
- An instance of ISparkSettings is used instead of duplicated properties on the ViewCompiler base class
- New ISparkSettings.ExcludeAssemblies property that can be used to the prevent the view compiler from loading .DLLs that would containt precompile views (and would might already be loaded)
- Replaced by a callback in the IoC configuration
- See ServiceCollectionExtensions.cs
- InMemoryCacheService cache can be used in any .net standard project
- CacheExpires class not longer has depenency on System.Web.Caching.Cache
- Renamed DefaultCacheService to WebCacheService
- Moved NullCacheService to Castle.MonoRail.Views project (it's the only place using it)
- Moved some classes back to Spark project when possible
- Moved markdown dependency back to spark
- Use of a new SparkRouteData class
- Avoids having a dependency on Microsoft.AspNet.Mvc
- New OutputValue(value, automaticEncoding) on SparkViewBase
- Removed H() method (replaced by OutputValue
- GeneratedCodeVisitor calls new OutputValue() method instead of Output.Write()
- This method gives simplifies the HTML encoding logic
- This method handles MvcHtmlString for MVC 5
- This method handles IHtmlContent for aspnetcore
- HtmlHelperResultFilter to help get funnel the IHtmlHelper from the controllers to the view
- Can now set base class for views with new SparkSettings<TBaseClass>() shortcut
@bounav bounav mentioned this pull request Apr 19, 2024
Copy link
Member

@RobertTheGrey RobertTheGrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but there seems to be a merge conflict?

# Conflicts:
#	src/Spark.Web.Mvc/SparkViewFactory.cs
@bounav
Copy link
Collaborator Author

bounav commented Apr 23, 2024

Looks good to me, but there seems to be a merge conflict?

My bad. I fixed the conflict.

…re compilation

- Can now use name, full name or absolute path to an assembly
@RobertTheGrey RobertTheGrey merged commit 452fa92 into master Apr 24, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants