Coder Social home page Coder Social logo

generators.blazor's People

Contributors

excubo-jg avatar stefanloerwald avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mediabuff

generators.blazor's Issues

Source generators should implement IIncrementalGenerator instead of ISourceGenerator

The following source generators implement the "V1" API and use a syntax receiver, which requires reprocessing the entire project after every edit to a source file. This behavior quickly and unavoidably overwhelms the IDE for medium to large projects.

Switching to IIncrementalGenerator allows for incremental processing of syntax to avoid this overhead.

ReferenceOutputAssembly=false -> Attributes

Hello!
I love the RequiredAttribute and the analysis it provides! But I think this package can be improved when the Attributes are also generated. Because they are now 'real' we need a reference to Excubo.Generators.Blazor which we otherwise do not need. When the attribute is generated we could change this:

<PackageReference Include="Excubo.Generators.Blazor" Version="1.11.3" />

to

<PackageReference Include="Excubo.Generators.Blazor" Version="1.11.3" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>

which reduces the extra dll when downloading Blazor for WASM.

I can image it would work like this (and maybe for all the other Attributes/public 'interface' classes):

using System.Text;

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Text;

namespace Excubo.Generators.Blazor
{
    [Generator]
    public partial class AddAttributeAnalyzer : ISourceGenerator
    {
        private const string AttributeText = @"
using System;

namespace Excubo.Generators.Blazor
{
    [AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
    public sealed class RequiredAttribute : Attribute
    {
    }
}";

        public void Initialize(GeneratorInitializationContext context)
        {
        }

        public void Execute(GeneratorExecutionContext context)
        {
            context.AddSource("RequiredAttribute.generated.cs", SourceText.From(AttributeText, Encoding.UTF8));
        }
    }
}

Or maybe combine them in the current analyser.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.