Comments (8)
Hi @TorreyGarland,
Sounds like a good idea to add the ability to ignore specific types for the generated methods. In fact, I'm already ignoring some types like IFormFile. To exclude custom types, I think adding an assembly attribute would be the easiest way to do it. Would something like this for you? in that case any parameters of the type GridParameters
will not be included in the generated method.
[assembly: UrlActionGenerator.ExcludeUrlParameterType(typeof(GridParameters))]
I'll probably add CancellationToken as a default excluded parameter type as well.
Regarding the performance, the source generator is invoked a lot while editing so even if it only takes a few more milliseconds it can degrade the experience a lot. The integration of source generators and razor pages is currently non-existent (as far as I know) so for that I have to resort to file system reads, together with the fact it is invoked a lot it can become very slow. Having a quick look at the new razor source generator for .NET 6 it looks like they are using a new incremental generator, that could help improve this in the future but I haven't seen any documentation about the changes in .NET 6 for this. I will keep an eye on this and update the generator to use the new features when possible.
For now, I'll try to see if I can reduce the time it takes for the source generator to complete.
from urlactiongenerator.
@JoaoFCorreia I have just released a new version to nuget, 0.6.0, which now ignores CancellationToken parameters by default.
@TorreyGarland This release also enabled you to specify types that should not be generated as parameters by using an assembly attribute like this:
[assembly: UrlActionGenerator.ExcludedParameterType(typeof(MyCustomTypeThatShouldBeExcluded))]
from urlactiongenerator.
Thanks for looking into this!
from urlactiongenerator.
Hi @TorreyGarland the feature for ignoring parameters of type CancellationToken is still being planned?
from urlactiongenerator.
Hi @JoaoFCorreia I have actually implemented most of the changes to support ignoring custom types (and added CancellationToken as ignored by default). I will try to finish it either this week or next week and release a new version with the change.
from urlactiongenerator.
have you considered using an IIncrementalGenerator and blazor capable?
from urlactiongenerator.
Hi @TorreyGarland yes I have looked at the IIncrementalGenerator and it is actually already released in version 0.5.0. I haven't looked into support for blazor yet
from urlactiongenerator.
Thanks again.
from urlactiongenerator.
Related Issues (8)
- Support for [Route] and Http Methods Attributes. HOT 2
- Feature Request: JavaScript Replaceable URLs
- Generate for Minimal APIs?
- Request: Add Support for PageModels, Web Api Controllers and SignalR Hubs HOT 8
- Add doccomment to the generated methods
- Generator Not Running (v4.0-alpha.1) HOT 13
- Generate actions for identity ui
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from urlactiongenerator.