feat: Initial migration from legacy project#1
Conversation
SerratedSharp
commented
Feb 12, 2026
- Dedicated solution/repo for SerratedJSInterop, migrated from SerratedJQ
- Rework API to be simpler to use and simpler to maintain
- Source generator for internal proxies
- Better factoring of projects
- Imrpoved naming
- All tests succeeding
- SerratedDom to support additional testing
- Tests don't have full coverage yet
- Dedicated solution/repo for SerratedJSInterop, migrated from SerratedJQ - Rework API to be simpler to use and simpler to maintain - Source generator for internal proxies - Better factoring of projects - Imrpoved naming - All tests succeeding - SerratedDom to support additional testing - Tests don't have full coverage yet
- Dedicated solution/repo for SerratedJSInterop, migrated from SerratedJQ - Rework API to be simpler to use and simpler to maintain - Source generator for internal proxies - Better factoring of projects - Imrpoved naming - All tests succeeding - SerratedDom to support additional testing - Tests don't have full coverage yet
There was a problem hiding this comment.
Pull request overview
Initial migration into a dedicated SerratedJSInterop solution/repo, introducing a simplified JS interop API (wrappers + extension methods) and an internal source-generator-based approach for JS proxy plumbing, along with WASM Browser-based test harness projects.
Changes:
- Added core
SerratedSharp.SerratedJSInteroplibrary with wrapper interfaces, instance/property helpers, and JS module import/bootstrap helpers. - Added
Internal+SourceGeneratorprojects to generate Uno-vs-.NET routing + JSImport proxy declarations, plus a Blazor RCL that ships the JS shim as a static web asset. - Added WASM Browser test app and shared test suite (largely exercising SerratedJQ behaviors while validating the interop surface).
Reviewed changes
Copilot reviewed 60 out of 61 changed files in this pull request and generated 206 comments.
Show a summary per file
| File | Description |
|---|---|
| .gitignore | Ignores generated source output directory for the interop project. |
| SerratedJSInterop.sln | New solution file wiring up JSInterop, generator, internal, DOM, and test projects. |
| SerratedSharp.SerratedDom/_Imports.razor | Adds common Blazor imports for the DOM wrapper project. |
| SerratedSharp.SerratedDom/HtmlElement.cs | DOM HTMLElement wrapper built on top of SerratedJSInterop helpers. |
| SerratedSharp.SerratedDom/SerratedSharp.SerratedDom.csproj | Razor Class Library project for DOM wrappers targeting browser/WASM. |
| SerratedSharp.SerratedDom/wwwroot/.gitkeep | Ensures wwwroot exists for the RCL. |
| SerratedSharp.SerratedJSInterop/GlobalJS.cs | Convenience wrappers for global JS objects (e.g., console). |
| SerratedSharp.SerratedJSInterop/IJSObjectWrapper.cs | Wrapper interface(s) for JSObject-backed managed types. |
| SerratedSharp.SerratedJSInterop/InstanceHelperProxy.cs | Placeholder/legacy proxy code captured as comments. |
| SerratedSharp.SerratedJSInterop/Internal/Breaker.cs | Overload-disambiguation helper for CallerMemberName + params scenarios. |
| SerratedSharp.SerratedJSInterop/JSInteropHelpersModule.cs | JSImport-based module import helper for loading the JS shim. |
| SerratedSharp.SerratedJSInterop/JSImportInstanceHelpers.cs | Core property/function invocation helpers and wrapper-casting logic. |
| SerratedSharp.SerratedJSInterop/JSObjectExtensions.cs | “V1” extension API for property access/calls using CallerMemberName patterns. |
| SerratedSharp.SerratedJSInterop/JSObjectExtensionsV2.cs | “V2” API introducing JSParams + SerratedJS.Params(...) factory patterns. |
| SerratedSharp.SerratedJSInterop/ParamsHelpers.cs | Small array/params utility helpers. |
| SerratedSharp.SerratedJSInterop/Properties/AssemblyInfo.cs | Marks assembly as browser-only for platform analyzer suppression. |
| SerratedSharp.SerratedJSInterop/README.md | Package overview and platform-specific initialization guidance. |
| SerratedSharp.SerratedJSInterop/SerratedSharp.SerratedJSInterop.csproj | Core library project definition and Internal-project reference. |
| SerratedSharp.SerratedJSInterop.Blazor/_Imports.razor | Adds common Blazor imports for the Blazor integration RCL. |
| SerratedSharp.SerratedJSInterop.Blazor/README.md | Blazor package overview / initialization placeholder. |
| SerratedSharp.SerratedJSInterop.Blazor/SerratedSharp.SerratedJSInterop.Blazor.csproj | Blazor RCL packaging the shim as a static web asset. |
| SerratedSharp.SerratedJSInterop.Blazor/wwwroot/SerratedJSInteropShim.js | JS shim implementing helper functions and exporting module namespace. |
| SerratedSharp.SerratedJSInterop.Internal/AgnosticJSImportAttribute.cs | Attribute for marking agnostic JSImport declarations for generation. |
| SerratedSharp.SerratedJSInterop.Internal/AgnosticJSMarshalAsAttribute.cs | Marshal-as attribute stand-in used by the custom source generator. |
| SerratedSharp.SerratedJSInterop.Internal/AgnosticModuleReferenceAttribute.cs | Declares module/namespace metadata for generated proxy code. |
| SerratedSharp.SerratedJSInterop.Internal/HelpersJSSource.cs | Source-of-truth declarations for helper JSImport methods. |
| SerratedSharp.SerratedJSInterop.Internal/InstanceHelperJSSource.cs | Source-of-truth declarations for instance helper JSImport methods. |
| SerratedSharp.SerratedJSInterop.Internal/README.md | Documents generator workflow and why generated proxies live in main project. |
| SerratedSharp.SerratedJSInterop.Internal/SerratedSharp.SerratedJSInterop.Internal.csproj | Internal “source-of-truth” project that runs the generator and outputs to main. |
| SerratedSharp.SerratedJSInterop.SourceGenerator/HelpersJSSourceGenerator.cs | Incremental generator that emits routing + JSImport proxy declarations. |
| SerratedSharp.SerratedJSInterop.SourceGenerator/README.md | Documents generated outputs and constraints with the .NET JSImport generator. |
| SerratedSharp.SerratedJSInterop.SourceGenerator/SerratedSharp.SerratedJSInterop.SourceGenerator.csproj | Source generator project configuration and Roslyn package references. |
| SerratedSharp.SerratedJSInterop.Tests.Shared/ClassAttributes.cs | Shared WASM tests (class attribute jQuery behaviors). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/Copying.cs | Shared WASM tests (clone/copying behaviors). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/CrossSiteScripting.cs | Shared WASM tests (basic XSS-related parsing scenarios). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/Data.cs | Shared WASM tests (jQuery .data() scenarios and memory load test). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/ElementManipulation.cs | Shared WASM tests (append + class manipulation behaviors). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/Events.cs | Shared WASM tests (event subscription + triggering). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/Filtering.cs | Shared WASM tests (filter/first/last/etc. traversal behaviors). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/GeneralAttributes.cs | Shared WASM tests (attr/prop/val behaviors). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/GlobalJQuery.cs | Shared WASM tests (global jQuery methods like Select/ParseHtml). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/InsertionAround.cs | Shared WASM tests (wrap/unwrap behaviors). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/InsertionInside.cs | Shared WASM tests (append/prepend and related insertion behaviors). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/InsertionOutside.cs | Shared WASM tests (before/after/insertBefore/insertAfter behaviors). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/InstanceProperties.cs | Shared WASM tests (instance properties + wrapper/property interop). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/MiscTraversal.cs | Shared WASM tests (misc traversal behaviors like Add/AddBack/Contents). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/Properties/AssemblyInfo.cs | Marks shared test assembly as browser-only. |
| SerratedSharp.SerratedJSInterop.Tests.Shared/Removal.cs | Shared WASM tests (remove/detach/empty behaviors). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/Replacement.cs | Shared WASM tests (replaceWith behaviors). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/SerratedSharp.SerratedJSInterop.Tests.Shared.csproj | Shared test project definition and dependencies. |
| SerratedSharp.SerratedJSInterop.Tests.Shared/Setters.cs | Shared WASM tests (CallerMemberName SetProperty/GetProperty on DOM). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/StyleProperties.cs | Shared WASM tests (height/width/scroll style property behaviors). |
| SerratedSharp.SerratedJSInterop.Tests.Shared/TestOrchestrator.cs | Shared test runner/orchestrator to discover and execute test classes. |
| SerratedSharp.SerratedJSInterop.Tests.Shared/TreeTraversal.cs | Shared WASM tests (tree traversal behaviors: parent/children/siblings/etc.). |
| SerratedSharp.SerratedJSInterop.Tests.WasmBrowser/Program.cs | WASM Browser app entry point running the shared test orchestrator. |
| SerratedSharp.SerratedJSInterop.Tests.WasmBrowser/Properties/AssemblyInfo.cs | Marks WASM Browser test assembly as browser-only. |
| SerratedSharp.SerratedJSInterop.Tests.WasmBrowser/Properties/launchSettings.json | Launch settings for the WASM Browser test app. |
| SerratedSharp.SerratedJSInterop.Tests.WasmBrowser/README.md | Notes on the WASM Browser test project naming workaround + prerequisites. |
| SerratedSharp.SerratedJSInterop.Tests.WasmBrowser/SerratedSharp.0SerratedJSInterop.Tests.WasmBrowser.csproj | WASM Browser test project definition + references. |
| SerratedSharp.SerratedJSInterop.Tests.WasmBrowser/wwwroot/index.html | Host page for the WASM Browser test app UI. |
| SerratedSharp.SerratedJSInterop.Tests.WasmBrowser/wwwroot/main.js | JS bootstrap for the WASM Browser test app (module imports + UI wiring). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
SerratedSharp.SerratedJSInterop.Internal/SerratedSharp.SerratedJSInterop.Internal.csproj
Show resolved
Hide resolved
| { | ||
| public static class Console | ||
| { | ||
| static Lazy<JSObject> _console = new(() => JSHost.GlobalThis.GetPropertyAsJSObject("console")); |
There was a problem hiding this comment.
Field '_console' can be 'readonly'.
|
|
||
| public abstract class JQTest : IJQTest | ||
| { | ||
| JQueryPlainObject body = JQueryPlain.Select("body"); |
There was a problem hiding this comment.
Field 'body' can be 'readonly'.
| JQueryPlainObject body = JQueryPlain.Select("body"); | ||
| public int TestNum { get; set; } | ||
| //public bool IsModelTest { get; set; } = false; | ||
| Exception exc = null; JQueryPlainObject status = null; |
There was a problem hiding this comment.
Field 'exc' can be 'readonly'.
| JQueryPlainObject body = JQueryPlain.Select("body"); | ||
| public int TestNum { get; set; } | ||
| //public bool IsModelTest { get; set; } = false; | ||
| Exception exc = null; JQueryPlainObject status = null; |
There was a problem hiding this comment.
Field 'status' can be 'readonly'.
|
|
||
| partial class StopwatchSample | ||
| { | ||
| private static Stopwatch stopwatch = new(); |
There was a problem hiding this comment.
Field 'stopwatch' can be 'readonly'.
|
@SerratedSharp I've opened a new pull request, #2, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@SerratedSharp I've opened a new pull request, #3, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@SerratedSharp I've opened a new pull request, #4, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: SerratedSharp <97156524+SerratedSharp@users.noreply.github.com>
…him.js Co-authored-by: SerratedSharp <97156524+SerratedSharp@users.noreply.github.com>
|
@SerratedSharp I've opened a new pull request, #5, to work on those changes. Once the pull request is ready, I'll request review from you. |
Fix spelling errors in WasmBrowser test project README
Fix documentation referencing obsolete filename SerratedInteropHelpers.js
|
@SerratedSharp I've opened a new pull request, #7, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@SerratedSharp I've opened a new pull request, #8, to work on those changes. Once the pull request is ready, I'll request review from you. |
…vior The documentation incorrectly stated that parameters are logged as a single array. In reality, the implementation uses JavaScript's apply() method which passes parameters as separate arguments to console.log. Addresses feedback from PR #1 comment discussion_r2796371629 Co-authored-by: SerratedSharp <97156524+SerratedSharp@users.noreply.github.com>