Closed
Conversation
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.
UserALE Changes
1. OTLP-specific changes
Output format migrated to OTLP/HTTP JSON
UserALE no longer posts logs as a proprietary JSON array. All telemetry is now emitted as OTLP/HTTP JSON to
POST /v1/logson the configured endpoint. This makes UserALE compatible with any OpenTelemetry-compliant collector (Jaeger, Grafana, Honeycomb, etc.) out of the box.userale.*resource attributesbrowser.url,user_agent.original, etc.)Endpoint configuration
The
urloption (previously pointing at a custom UserALE backend) now points directly at an OTLP/HTTP collector. The default ishttp://localhost:4318, which matches the standard OTLP gRPC/HTTP port.The script-tag attribute is
data-url; the JS API isuserale.options({ url: '...' }).Shared local collector
A
docker-compose.ymlat the repository root provides a Jaeger all-in-one container as a zero-config local collector:pnpm collector:up # OTLP on :4318, Jaeger UI on :16686 pnpm collector:down2. Other end-user facing changes
Three distinct deployment packages
UserALE is now distributed as three separate packages with clear use-case boundaries:
core-sdk/flagon-useraleiife/flagon-userale-iife<script>tag and no build stepextension/flagon-userale-extIIFE build is configuration-only
The IIFE (
flagon-userale-iife) is a drop-in that readsdata-*attributes from the<script>tag and starts automatically. It does not expose awindow.useraleJavaScript API.Applications that need runtime control (
addCallbacks,stop,options, etc.) should useflagon-userale(the core SDK) directly in their build.New programmatic API surface (core SDK)
The core SDK exposes a class-based API:
Browser extension: options take effect immediately
Changing the logging endpoint or URL allowlist in the extension options page now takes effect immediately in the running background service worker — no extension reload required.
Browser extension: tab events logged
The extension captures browser tab lifecycle events (activate, create, update, remove, zoom, etc.) as custom UserALE logs alongside DOM events from the instrumented page.
3. Internal architecture and development changes
Package folder rename
The workspace package directories were renamed to match their function:
packages/flagon-userale/packages/core-sdk/flagon-useralepackages/flagon-userale-iife/packages/iife/flagon-userale-iifepackages/flagon-userale-ext/packages/extension/flagon-userale-extnpm publish names are unchanged; downstream consumers are unaffected.
Monorepo workspace dependencies
The extension package dependency on the core SDK was changed from a hardcoded
file:path to a pnpmworkspace:*reference, ensuring correct version resolution across the workspace.Test architecture: per-distribution Playwright specs
Integration tests are now split across three spec files, each targeting one distribution:
01-iife.spec.ts02-esm.spec.ts03-extension.spec.tsEach spec uses a dedicated Playwright fixture (
page.fixture.tsfor iife/esm,extension.fixture.tsfor extension) to avoid context contamination. Previously all tests shared a single spec and the extension fixture caused wrong-browser launches for non-extension tests.Test server: three example pages
example-server/now serves three pages, one per distribution:/iifeiife.html/esmesm.html+esm.js/no-loggingno-logging.htmlExtension: replaced Plasmo messaging with raw chrome.runtime
The
background/messages/config_change.tsPlasmo message handler was replaced with a rawchrome.runtime.onMessagelistener inbackground/index.ts. Plasmo's generated messaging glue unconditionally returnedtruefrom itsonMessagelistener, causing a Chrome warning ("A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received") for every message that wasn'tconfig_change. The raw listener returnsfalseafter each handled message type, eliminating the warning.sendToBackgroundinutils/storage.tswas replaced withchrome.runtime.sendMessagefor the same reason.Extension: MV3 migration (Plasmo)
The extension was migrated from Manifest V2 to Manifest V3 using Plasmo. The background page became a service worker; persistent background state is managed via the
background/index.tsentrypoint rather than a long-lived page.TypeScript project references
A root
tsconfig.jsonwas added with project references tocore-sdkandextension, enabling incremental compilation across the workspace.Unit test isolation: getInitialSettings
The
getInitialSettingsunit tests were migrated from loading the IIFE bundle via jsdom to calling the function directly with injected DOM<script>elements. This removes the dependency on a built artifact from the test suite.