Skip to content

Refactor analytics client with Ajv improvements#8191

Open
Sujaicodes wants to merge 1 commit intosegmentio:developfrom
Sujaicodes:patch-1
Open

Refactor analytics client with Ajv improvements#8191
Sujaicodes wants to merge 1 commit intosegmentio:developfrom
Sujaicodes:patch-1

Conversation

@Sujaicodes
Copy link

Updated Ajv import and initialization, improved validation error handling, and optimized the Typewriter client API.

Proposed changes

Updated Ajv import and initialization to use a single shared instance instead of creating a new instance for every validation call.

Optimized schema validation performance by compiling schemas once and reusing the compiled validators.

Improved validation error handling to provide clearer warnings and better debugging information when analytics events do not match the Tracking Plan schema.

Refactored parts of the Typewriter client API to reduce repeated logic and improve maintainability without changing existing behavior.

Ensured the client continues to forward events correctly to the underlying analytics instance.

These changes improve performance, maintainability, and developer debugging experience while keeping the runtime behavior and public API unchanged.
This change focuses on performance optimization and internal improvements to the generated Typewriter client.

Updated Ajv import and initialization, improved validation error handling, and optimized the Typewriter client API.
@Sujaicodes Sujaicodes requested a review from a team as a code owner March 14, 2026 21:41
@Sujaicodes Sujaicodes requested a review from stayseesong March 14, 2026 21:41
@netlify
Copy link

netlify bot commented Mar 14, 2026

Deploy Preview for segment-docs ready!

Name Link
🔨 Latest commit 1c9ea4f
🔍 Latest deploy log https://app.netlify.com/projects/segment-docs/deploys/69b5d61fa558b40008219c33
😎 Deploy Preview https://deploy-preview-8191--segment-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

1 participant