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

Support for trimming & AOT #94

Merged
merged 15 commits into from
Aug 21, 2024
Merged

Support for trimming & AOT #94

merged 15 commits into from
Aug 21, 2024

Conversation

adams85
Copy link
Contributor

@adams85 adams85 commented Jul 27, 2024

Describe the purpose of your pull request

The main goal of the PR is to make the SDK trimmable and AOT-friendly. To make this happen, it was necessary to switch to source generation of JSON serialization metadata. (Besides this, source generation of regular expressions has also been enabled for improving performance in .NET 8+ applications.)

To support Unity WebGL, HttpConfigFetcher has been refactored into two classes (DefaultConfigFetcher and HttpClientConfigFetcher) so that the actual HTTP request logic can be replaced with a user-defined implementation. (This was done by following the pattern used in the JS SDK.) As a bonus, this also improves the testability of the SDK by allowing consumers to mock the HTTP communication in their tests.)

Since Unity WebGL doesn't support multi-threading, a minimal platform abstraction layer (PlatformCompatibilityOptions and TaskShim) has also been introduced.

The PR adds two new sample apps (BlazorWasm, MAUI) and some scripts to show how to make the SDK work in Unity WebGL.

Related issues (only if applicable)

n/a

Requirement checklist (only if applicable)

  • I have covered the applied changes with automated tests.
  • I have executed the full automated test set against my changes.
  • I have validated my changes against all supported platform versions.
  • I have read and accepted the contribution agreement.

@adams85 adams85 requested a review from a team as a code owner July 27, 2024 21:47
@adams85 adams85 changed the title Support trimming & AOT Support for trimming & AOT Jul 27, 2024
# Conflicts:
#	src/ConfigCat.Client.Tests/UtilsTests.cs
#	src/ConfigCatClient/ConfigService/DefaultConfigFetcher.cs
Copy link

sonarcloud bot commented Aug 21, 2024

@adams85 adams85 merged commit e6e4d77 into master Aug 21, 2024
7 checks passed
@adams85 adams85 deleted the aot-support branch August 21, 2024 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants