fix: fix web-worker related issues#140
Merged
brionmario merged 4 commits intoasgardeo:mainfrom Sep 8, 2025
Merged
Conversation
web-worker related issues
e6ae494 to
44ccb00
Compare
DonOmalVindula
approved these changes
Sep 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request introduces significant improvements to the browser package, focusing on enhanced web worker integration, error handling, and configuration flexibility. The main changes include switching to an inline web worker build approach, improving error serialization and propagation between threads, and adding support for configurable storage mechanisms. These updates help modernize the codebase, improve reliability, and make the authentication client more adaptable for different environments.
Web Worker Integration & Build System:
esbuild-plugin-inline-workerfor bundling web workers, updating the build configuration inesbuild.config.mjsand adding the dependency topackage.json. This allows the worker code to be bundled inline and ensures proper polyfills for browser environments. [1] [2] [3]worker.tstoweb.worker.tsand added polyfills forBufferandglobalto ensure compatibility in browser worker contexts.web.worker.tsand enabled dynamic worker instantiation. [1] [2] [3] [4]Error Handling Improvements:
MessageUtilsto robustly handleErrorobjects, non-Error objects, and primitives, ensuring errors are reliably transferred between main thread and worker.web-worker-client.tsby parsing errors safely and wrapping unknown or malformed errors in a customAsgardeoAuthException. [1] [2] [3]Configuration Flexibility:
AsgardeoBrowserConfigtype to support multiple storage options, includingsessionStorage,localStorage,browserMemory, andwebWorker. [1] [2]Related Issues
@asgardeo/react&@asgardeo/nextjs#81Related PRs
Checklist
Security checks