Skip to content

Support for trimming & AOT#94

Merged
adams85 merged 15 commits intomasterfrom
aot-support
Aug 21, 2024
Merged

Support for trimming & AOT#94
adams85 merged 15 commits intomasterfrom
aot-support

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
@sonarqubecloud
Copy link

@adams85 adams85 merged commit e6e4d77 into master Aug 21, 2024
@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