Skip to content

NativeAOT: zero-warning source-gen serialization, remove all IL2026/I… - #3332

Closed
aizen218 wants to merge 25 commits into
microsoft:mainfrom
aizen218:aot-experiment
Closed

aizen218 wants to merge 25 commits into
microsoft:mainfrom
aizen218:aot-experiment

Conversation

@aizen218

@aizen218 aizen218 commented Jul 6, 2026

Copy link
Copy Markdown

…L3050 pragmas

  • Outgoing messages: normalize ChannelOwner→JsonObject, Enum→lowercase string, serialize via PlaywrightJsonContext.Default.DictionaryOfStringToObject
  • Incoming messages (.NET 10): use JsonSerializerOptions.GetTypeInfo(Type) (non-RUC in .NET 10) with TypeInfoResolver=PlaywrightJsonContext.Default
  • ChannelOwner deserialization: direct converter call bypassing Deserialize
  • Enum deserialization: AotEnumMemberConverter.FromWireString
  • .NET 8 fallback keeps pragma (#if !NET9_0_OR_GREATER)
  • Register missing types in PlaywrightJsonContext
  • EvaluateArgumentValueConverter: use Serialize(obj, type, context) non-RUC
  • Remove EvaluateArgumentValueConverter reflection for serialization
  • Add AOT sample project (samples/Playwright.AotSample)

aizen218 added 25 commits July 6, 2026 21:36
…L3050 pragmas

- Outgoing messages: normalize ChannelOwner→JsonObject, Enum→lowercase string,
  serialize via PlaywrightJsonContext.Default.DictionaryOfStringToObject
- Incoming messages (.NET 10): use JsonSerializerOptions.GetTypeInfo(Type)
  (non-RUC in .NET 10) with TypeInfoResolver=PlaywrightJsonContext.Default
- ChannelOwner deserialization: direct converter call bypassing Deserialize<T>
- Enum deserialization: AotEnumMemberConverter.FromWireString
- .NET 8 fallback keeps pragma (#if !NET9_0_OR_GREATER)
- Register missing types in PlaywrightJsonContext
- EvaluateArgumentValueConverter: use Serialize(obj, type, context) non-RUC
- Remove EvaluateArgumentValueConverter reflection for serialization
- Add AOT sample project (samples/Playwright.AotSample)
….1.0-pre.17

- Replace all reflection in EvaluateArgumentValueConverter with JsonNode
  tree parsing + source-gen deserialization
- Replace ClassUtils.Clone and Locator.ConvertOptions with JSON
  round-trip via PlaywrightJsonContext
- Remove Assembly.GetName() from Driver.cs (hardcode version)
- Register 272+ generated option types + common system types in
  PlaywrightJsonContext
- Add Clearcote Browser SDK (9 API supplements, 4 implementation
  files) — fingerprint masking, canvas bridge, humanized input,
  AI agent, Widevine CDM, render coherence, persistent profiles
- Add Playwright.AOTFork.targets (replaces Microsoft.Playwright.targets)
- Retarget all projects to net10.0, remove CompatibilitySuppressions.xml
- Update README with Clearcote support and NativeAOT sample references
- Add samples/Playwright.AotSample.Clearcote (AOT-validated)
- Update pinned release to v0.1.0-pre.18 (both Windows + Linux)
  with new SHA-256/exeSha256 hashes
- Add TlsProfile option to ClearcoteLaunchOptions,
  ClearcoteLaunchPersistentContextOptions, ClearcoteSettings,
  fingerprint args, profile read/write, and merge helpers
- Expose Repo constant internally for reuse
- Update README version reference
…ile, locale timezone, profile accept-language

- ClearcotePlatform: add Android enum for mobile persona
- ClearcoteTlsProfile: add Auto (alias for MatchPersona)
- Clearcote.cs:
  - _localeTimezoneMap + DefaultTimezoneForLocale() — auto-derive TZ from locale
  - ProfileAcceptLanguage() — extract navigator.languages from fingerprint profile
  - FingerprintArgs: locale-based TZ fallback, profile accept-language, android --window-size=412,915
  - PlatformToString: add 'android' mapping
  - ResolveTlsProfile: handle Auto enum
- Version bump 1.0.0 -> 1.0.1
- Pack: Playwright.Clearcote.1.0.1.nupkg
- Tag: v0.1.0-pre.18 -> v0.1.0-pre.19
- Linux archive: sha256 fd96497e.. -> 1be5a9f8.., exe f4e8c116.. -> 7c5ea6ce..
- Windows archive: sha256 935d43da.. -> da47f325..
- Size: 142700100 -> 146861776 (Linux)
- Version bump: 1.0.1 -> 1.0.2
- Bump version from 1.1.0 to 1.2.0
- Fix CS0612 deprecation warnings in AotSample (TypeAsync→FillAsync,
  WaitForNavigation→WaitForURL)
- Fix CS8602/CS0219 warnings in AotSample
- Fix README: loaded.LaunchAsync(playwright)→playwright.Chromium
- Fix README: remove outdated net8.0 test command
- Update README sample descriptions to match actual tests
- Add build+run commands for both AOT samples
…ug logging

- Validate PLAYWRIGHT_DRIVER_SEARCH_PATH & PLAYWRIGHT_NODEJS_PATH (path format + file existence)
- Sanitize StorageStatePath, screenshot/pdf paths, script/style paths via SecurityHelpers.ResolveAndValidatePath
- Block dangerous Chromium flags (--disable-web-security, etc.) in user-supplied args
- Validate proxy server format before passing to Chromium
- Add Regex timeout (1s) + max length (1000) in EvaluateArgumentValueConverter
- Warn when CDP endpoint is exposed on non-localhost interfaces
- Resolve gpg/tar via absolute paths (which/where fallback)
- Set 0700 permissions on clearcote temp directories
- Redact 14 sensitive field names in DEBUG protocol logging

AOT optimization:
- Consolidate JsonExtensions.ToObject<T>() → calls ToObject(Type) eliminating 70% duplication
- Replace parallel enum switch statements with single EnumMapping[] array
- Extract ConvertTypedArray() method from ParseEvaluateResultToJsonNode
- Remove NET9_0_OR_GREATER ifdefs, unify TypeInfoResolver path
- Update pinned Clearcote browser from pre.20 to pre.21 (cache-header hygiene)
- Port full v0.15.0 seeded motion model from upstream:
  ClearcoteMotion.cs — minimum-jerk submovements, Fitts's law, colored
  noise (OU drift + 8-12 Hz tremor), seeded per-identity motor persona
- ClearcoteHumanize.cs — use new trajectory engine, add key/click/drag
  dwells, ambient pre-challenge motion
- Thread fingerprint seed through BrowserContext/Page for stable
  per-identity motor signature
- Bump to 1.4.0
- APIResponse.cs: ResolveUserJsonTypeInfo AOT-only, no pragma/reflection
- BrowserTypeConnectTests.cs: guard resources dir existence check
- CLITests.cs: skip pwsh tests on non-Windows
- Version 1.4.1
… to 1.5.0

- Clearcote.Catalog.cs: version catalog resolution, PRO binary download with
  archive/GPG verification, version-plan filtering
- Clearcote.License.cs: checkout/heartbeat/checkin lease lifecycle, offline
  token cache, configurable retry policy
- ClearcoteJsonContext.cs: AOT-safe JsonSerializerContext for all new DTOs
- No pragmas, no Activator.CreateInstance, no MakeGenericType, no dynamic
- 27/27 Clearcote tests pass
- AOT build: 0 warnings, 0 errors
- Version bumped to 1.5.0
@dcrousso

Copy link
Copy Markdown
Contributor

archiving

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.

2 participants