-
Notifications
You must be signed in to change notification settings - Fork 18
[SBA-03] extract WASM functions from LNC into WasmManager class #132
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
base: auth-02b-eslint
Are you sure you want to change the base?
Conversation
3de4eac to
515034d
Compare
4878338 to
a0489fb
Compare
2d53e9d to
8d6504a
Compare
96711f0 to
763f15d
Compare
41df1c5 to
f2f808f
Compare
763f15d to
13bd745
Compare
f2f808f to
bd9f16a
Compare
13bd745 to
bdca5e3
Compare
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.
Pull request overview
This PR extracts WASM-related lifecycle, connection, and RPC logic from the LNC class into a new WasmManager class. The refactoring maintains the existing public API while improving maintainability and preparing for future session-based authentication features.
Key Changes:
- Created
WasmManagerclass to encapsulate all WASM operations, connection management, and RPC communication - Updated
LNCclass to delegate WASM operations toWasmManagerwhile preserving its public interface - Moved
lncGlobalreference fromlnc.tstowasmManager.tsfor better encapsulation
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/wasmManager.ts | New class implementing WASM lifecycle, connection logic, and RPC communication |
| lib/wasmManager.test.ts | Comprehensive test suite for the new WasmManager class |
| lib/lnc.ts | Refactored to delegate WASM operations to WasmManager while maintaining public API |
| lib/lnc.test.ts | Updated tests to reflect delegation pattern and removed implementation detail assertions |
| test/utils/test-helpers.ts | Updated import path for lncGlobal reference |
| lib/index.ts | Exported WasmManager for external use |
| lib/index.test.ts | Added test coverage for WebAssembly polyfill functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
bd9f16a to
169fb35
Compare
bdca5e3 to
da2316c
Compare
da2316c to
5bf01d8
Compare
Summary
This PR moves almost all WASM-related lifecycle, connection, and RPC logic out of the main
LNCclass into a dedicatedWasmManager, while keeping the publicLNCAPI the same. The goal is to keepLNCsmall and focused as it grows with upcoming session-based auth and passkey features, so new behavior can be added without turningLNCinto an unmaintainable “god class.” These changes build on the groundwork from #130 and #131 as part of the Session-Based Authentication & Passkeys work.Technical Notes
LNCfocused and maintainable: As we add more auth/session logic, the mainLNCclass would otherwise accumulate a lot of low-level WASM, connection, and RPC details; pushing those concerns intoWasmManagerkeepsLNCcloser to a thin façade over the APIs.Steps to Test
Run the unit tests (including the new
WasmManagertests and updatedLNCtests):yarn testBuild the library to ensure the production bundle still compiles correctly:
Related Issues & Pull Requests
Depends on: