-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
.NET rewrite #30
.NET rewrite #30
Conversation
🎊 |
There was a problem hiding this 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.
We should add a task or an issue for the handling of the language detection. (As mentioned in the comments of the ArrowHeadController.
04173e2
to
e0c7afd
Compare
Make Fly builds work again (hopefully)
@chatterchats can I ask for your eyes on this PR as well? |
Contribution guide looks good, will be a lot better with the todos are finished there but it's great to get started! |
Co-authored-by: TheDarkGlobe <[email protected]>
There was a problem hiding this 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.
as discussed in #28 the API will be rewritten from Elixir to C#
The main goal is to provide a language/ecosystem that is more accessible to contribution, part of this effort is also the helldivers-2/json repository.
This PR switches over the Elixir implementation to an AOT ASP.NET Core application written in C#
Goals
Faster, better, stronger
So why is faster startup and lower memory usage through AOT such a big deal?
It basically comes down to the fact that the API is currently hosted on my own costs, and to keep those down as much as possible I try to minimize the KPI's most provides bill for: CPU time and memory usage.
By using less RAM and less CPU I can host the API on a lower tier, saving me costs and allowing me to put in higher API rate limits
Architecture
The new API is divided up in 4 components to give each part (domain) of the application it's own 'space':
Source generators
As mentioned, the 4th component is
Helldivers-2-SourceGen
, which basically does 1 thing:it generates a class
Helldivers.Models.Static
with properties for every JSON file pulled in from helldivers-2/json.Generate source files look a lot like this:
This allows us to intern names of sectors, planets etc for even more efficient memory usage.
It also makes sure I don't have to manually write out the names of planets and sectors in the C# code, or load them in at runtime (see 'Faster, better, stronger')
Migration path
if you are using the current API endpoints from the Elixir version, there will be breaking changes.
Please check the OpenAPI documents under
Helldivers-2-API/wwwroot/
for details on the new endpoints.Also feel free to add comments below here for endpoints you are using, and to see how those can be migrated in the new model.
Roadmap
document language selectionscrapped for later dategenerate documentation for .NET rather than Elixirscrapped for later date