Skip to content

Commit

Permalink
Remove Zod
Browse files Browse the repository at this point in the history
Zod was not used in many places, and it had almost no added value for us.
So, we're going to remove it for now since it was about 80% of the core's bundle
size.
  • Loading branch information
Kavian77 committed Dec 27, 2024
1 parent 5c67788 commit 5d49a40
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
3 changes: 1 addition & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"turbo": "^1.12.5",
"typescript": "^5.5.3",
"typescript-eslint": "^8.3.0",
"vitest": "^1.3.1",
"zod": "^3.22.4"
"vitest": "^1.3.1"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "^4.29.1"
Expand All @@ -43,5 +42,6 @@
"eslint --fix",
"prettier --write"
]
}
},
"packageManager": "[email protected]"
}
15 changes: 6 additions & 9 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { z } from "zod";
export type TrackingEvent = {
id: string;
type: string;
timestamp: number;
context: Record<string, unknown>;
};

export const TrackingEventSchema = z.object({
id: z.string(),
type: z.string(),
timestamp: z.number(),
context: z.record(z.unknown()),
});

export type TrackingEvent = z.infer<typeof TrackingEventSchema>;
export type BatchSize = number | "disabled";

export type EventMiddleware = (
Expand Down
2 changes: 1 addition & 1 deletion turbo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"],
Expand Down

0 comments on commit 5d49a40

Please sign in to comment.