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

Adding package results in large file size? #55

Open
fredrikbaberg opened this issue Sep 15, 2021 · 2 comments
Open

Adding package results in large file size? #55

fredrikbaberg opened this issue Sep 15, 2021 · 2 comments
Labels
feature New feature or request

Comments

@fredrikbaberg
Copy link

Hi,
I've just started to look at this as a solution to integrate BabylonJS in a Blazor WebAssembly project.

I noticed the output project from dotnet publish -c Release increases a lot after adding this package, where the main contributor seems to be Microsoft.CodeAnalysis at 84 files in _framework for a total of 20,2 MB.

To recreate:

dotnet new blazorwasm -o TestCodeAnalysis
cd TestCodeAnalysis
dotnet add package EventHorizon.Blazor.TypeScript.Interop.Generator
dotnet publish -c Release

The resulting publish folder increases from 14.8 MB to 41,3 MB.

Is Microsoft.CodeAnalysis required, or is this a bug?

I'm currently on .NET 6 Preview 7, so I haven't verified if this happens on 5.0 or 6 RC1 yet.

@canhorn
Copy link
Owner

canhorn commented Sep 15, 2021

The main source project is not optimized for a deployed application, it's intended to create the C# projects as part of an out of process build.
But the dependency comes from the embedded CSharp formatter, that can be used to format the generated files. It's is not necessary and I will look at moving it into a sub-project in a future release.

The Generation Tool can be used from the CLI and in the Sample directory there is an example of a Console application that uses EventHorizon.Blazor.TypeScript.Interop.Generator to create the C# project.

If you want a more flushed out example of a game that uses the Generation Tool for BabylonJS and integrates it with a Blazor Wasm application: https://github.com/canhorn/BabylonJS.Blazor.Game.Tutorial

@canhorn canhorn added the feature New feature or request label Sep 15, 2021
@fredrikbaberg
Copy link
Author

Thank you for the quick reply. I saw that repository and thought I followed it, but noticed some differences when I had another look. The resulting size is now more reasonable.

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

No branches or pull requests

2 participants