Coder Social home page Coder Social logo

Enable trimming about weather HOT 1 OPEN

rocksdanister avatar rocksdanister commented on May 26, 2024
Enable trimming

from weather.

Comments (1)

rocksdanister avatar rocksdanister commented on May 26, 2024

Early test shows upto 50% reduction (50mb -> 25mb) with the following Default.md file:

    <!--<Assembly Name="*Application*" Dynamic="Required All" />-->
    
    <!-- .NET Native fix -->
    <Assembly Dynamic="Required All" Name="NLog"/>
    <Assembly Dynamic="Required All" Name="Microsoft.Extensions.DependencyInjection"/>
    <Assembly Dynamic="Required All" Name="Microsoft.Extensions.Options"/>
    <Assembly Dynamic="Required All" Name="Microsoft.Extensions.Logging"/>
    <Assembly Dynamic="Required All" Name="Microsoft.Extensions.Http"/>

Problem is serializers returning null due to reflection, will need to rewrite using source generator:
https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/source-generation

I was suggested to use System.Text.Json 8.0 Preview 1 for better source generators.

Sample:

[JsonSourceGenerationOptions(PropertyNameCaseInsensitive = true)]
[JsonSerializable(typeof(AirQuality), GenerationMode = JsonSourceGenerationMode.Metadata)]
internal partial class MyJsonContext : JsonSerializerContext
{
}
..
await JsonSerializer.DeserializeAsync(stream, MyJsonContext.Default.AirQuality);

from weather.

Related Issues (20)

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.