Merged
Conversation
* Made doc fixes * Separation of dispatcher and consent config params --------- Authored-by: mandlamoyo <mandla.moyo@hotmail.com>
…ckkit into typed-events
… docs to highlight features
There was a problem hiding this comment.
Pull request overview
Adds first-class typed events support to Trackkit’s factory API by introducing an EventMap generic that type-checks track() event names and properties at compile time, while keeping the default (untyped) behavior unchanged. The PR also adds Vitest typecheck tests and updates docs/examples to reflect the newer configuration and API shapes.
Changes:
- Introduce
EventMap/AnyEventMapand generictrack()signatures onAnalyticsInstanceandAnalyticsFacade. - Add Vitest typecheck configuration plus compile-time
.test-d.tscoverage for typed events. - Update docs/examples and stabilize a batching-related network dispatcher unit test.
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/trackkit/vitest.config.ts | Enables Vitest typecheck runs for .test-d.ts files. |
| packages/trackkit/test/unit/types/typed-events.test-d.ts | Adds compile-time type tests for typed events. |
| packages/trackkit/test/unit/facade/typed-events.test.ts | Adds runtime tests to confirm generics don’t affect behavior. |
| packages/trackkit/test/unit/dispatcher/network-dispatcher.test.ts | Reduces flakiness by waiting for async dispatch rather than sleeping. |
| packages/trackkit/src/types.ts | Defines EventMap/AnyEventMap and makes AnalyticsInstance generic with conditional track() args. |
| packages/trackkit/src/factory.ts | Makes createAnalytics generic and returns AnalyticsFacade<E>. |
| packages/trackkit/src/facade/index.ts | Makes AnalyticsFacade generic and applies typed track() signature. |
| packages/trackkit/package.json | Adds test:typecheck script for typecheck-only Vitest runs. |
| packages/trackkit/README.md | Documents typed events usage and clarifies singleton limitations. |
| examples/react-spa-umami/README.md | Expands example documentation and explains features/flow. |
| examples/next-ssr-ga4/pages/index.tsx | Replaces commented stub with a working SSR + client demo page. |
| examples/next-ssr-ga4/pages/_document.tsx | Replaces commented stub with working SSR queue capture/injection. |
| examples/next-ssr-ga4/README.md | Rewrites README to explain SSR queue/hydration behavior. |
| docs/reference/configuration.md | Updates config docs to reflect dispatcher nesting (dispatcher.*). |
| docs/reference/api.md | Updates API reference for typed events and current signatures. |
| docs/providers/umami.md | Removes mention of unsupported metadata config. |
| docs/providers/ga4.md | Removes defaultProps mention and updates best-practices guidance. |
| docs/overview/quickstart.md | Adds “typed events” section to quickstart. |
| docs/overview/architecture.md | Corrects config module references. |
| docs/index.md | Adds npm “Download Now” link on docs landing page. |
| docs/guides/resilience-and-transports.md | Updates resilience docs to match dispatcher.resilience.*. |
| docs/guides/queue-management.md | Updates diagnostics snapshot format and wording. |
| docs/guides/custom-providers.md | Updates provider configuration examples to provider: { name, ... }. |
| docs/guides/consent-management.md | Fixes consent examples to use createAnalytics(...) and current option names. |
| README.md | Updates top-level positioning and flow explanation. |
| .gitignore | Adds .audit ignore entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.