Skip to content

Commit

Permalink
fix: replace lodash imports from root with subpath imports (#6052)
Browse files Browse the repository at this point in the history
Co-authored-by: Batuhan Wilhelm <batuhanwilhelm@gmail.com>
  • Loading branch information
aliemir and BatuhanW authored Jun 20, 2024
1 parent 55cd066 commit 50d2107
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .changeset/smooth-maps-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@refinedev/hasura": patch
---

fix(hasura): broken lodash import in bundle

ESM bundle of `@refinedev/hasura` was broken due to incorrect lodash import. Import has been replaced with subdirectory import to get handled properly in the bundling process.

Fixes [#6044](https://github.com/refinedev/refine/issues/6044)
7 changes: 7 additions & 0 deletions .changeset/tall-geckos-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@refinedev/devtools-server": patch
---

fix(devtools-server): lodash import from root

`@refinedev/devtools-server` was using `lodash` imports from root which are interpreted as CJS imports in the ESM bundle. To avoid any future issues, lodash imports have been replaced with subdirectory imports.
7 changes: 7 additions & 0 deletions .changeset/twenty-insects-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@refinedev/inferencer": patch
---

fix(inferencer): broken lodash import in bundle

ESM bundle of `@refinedev/inferencer` was broken due to incorrect lodash import. Import has been replaced with subdirectory import to get handled properly in the bundling process.
2 changes: 1 addition & 1 deletion packages/devtools-server/src/reload-on-change.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from "fs";
import path from "path";
import { debounce } from "lodash";
import debounce from "lodash/debounce";
import { DevtoolsEvent, send } from "@refinedev/devtools-shared";

import type { Server } from "ws";
Expand Down
2 changes: 1 addition & 1 deletion packages/hasura/src/utils/upperCaseValues.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mapValues } from "lodash";
import mapValues from "lodash/mapValues";

export const upperCaseValues = (obj: any): any => {
if (!obj) return undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/inferencer/src/use-relation-fetch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
InferencerComponentProps,
ResourceInferenceAttempt,
} from "../types";
import { get } from "lodash";
import get from "lodash/get";
import { pickMeta } from "../utilities/get-meta-props";

type UseRelationFetchProps = {
Expand Down

0 comments on commit 50d2107

Please sign in to comment.