Skip to content

Commit

Permalink
Remove memoizeOne dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
stephlow committed Oct 18, 2024
1 parent b101f82 commit 328241e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
7 changes: 0 additions & 7 deletions packages/types/memoize-one.d.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"build": "tsc"
},
"devDependencies": {
"zod": "^3.23.8",
"memoize-one": "^6.0.0"
"zod": "^3.23.8"
}
}
8 changes: 7 additions & 1 deletion packages/types/src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
// =========================================== //

import { z } from "zod";
import memoizeOne from "memoize-one";

// TODO: Polyfill memoizeOne for now, seems like this breaks our TypeScript setup
// See: https://github.com/alexreardon/memoize-one/issues/267
// Couldn't get it to work reliably on both the CI and locally with custom module type definitions
function memoizeOne<T>(schema: T) {
return schema;
}

export const AppStateSchema = memoizeOne(() =>
z.object({ workspace: z.union([z.lazy(WorkspaceSchema), z.null()]) }),
Expand Down
8 changes: 7 additions & 1 deletion xtask/src/commands/schemas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ fn generate_zod_schemas(schemas: Vec<RootSchema>) -> Result<Vec<u8>> {
// =========================================== //
import { z } from "zod";
import memoizeOne from "memoize-one";
// TODO: Polyfill memoizeOne for now, seems like this breaks our TypeScript setup
// See: https://github.com/alexreardon/memoize-one/issues/267
// Couldn't get it to work reliably on both the CI and locally with custom module type definitions
function memoizeOne<T>(schema: T) {
return schema;
}
"#,
);

Expand Down

0 comments on commit 328241e

Please sign in to comment.