Skip to content

Commit

Permalink
fix(react): fix @toss/react to support esm (toss#179)
Browse files Browse the repository at this point in the history
* fix(react): fix @toss/react to support esm

* fix: fix @toss/react to support esm - lodash throttle

Co-authored-by: goo <[email protected]>
  • Loading branch information
LineGu and goo authored Jan 3, 2023
1 parent f9bc6ea commit 3fe4d0a
Showing 7 changed files with 54 additions and 11 deletions.
31 changes: 27 additions & 4 deletions .pnp.cjs

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

Binary file not shown.
Binary file not shown.
6 changes: 4 additions & 2 deletions packages/react/react/package.json
Original file line number Diff line number Diff line change
@@ -25,7 +25,8 @@
"@toss/storage": "workspace:^1.1.0",
"@toss/utils": "workspace:^1.3.0",
"classnames": "^2.3.1",
"lodash": "^4.17.20"
"lodash.debounce": "^4.0.8",
"lodash.throttle": "^4.1.1"
},
"devDependencies": {
"@babel/core": "^7",
@@ -44,7 +45,8 @@
"@tossteam/jest": "^17",
"@types/babel__preset-env": "^7",
"@types/jest": "^28.1.8",
"@types/lodash": "^4",
"@types/lodash.debounce": "^4",
"@types/lodash.throttle": "^4.1.6",
"@types/react": "^18.0.21",
"@types/testing-library__jest-dom": "^5.9.5",
"@types/testing-library__react-hooks": "^3.2.0",
2 changes: 1 addition & 1 deletion packages/react/react/src/hooks/useDebounce.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import debounce from 'lodash/debounce';
import debounce from 'lodash.debounce';
import { useEffect, useMemo } from 'react';
import { usePreservedCallback } from './usePreservedCallback';
import { usePreservedReference } from './usePreservedReference';
2 changes: 1 addition & 1 deletion packages/react/react/src/hooks/useThrottle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import throttle from 'lodash/throttle';
import throttle from 'lodash.throttle';
import { useEffect, useMemo } from 'react';
import { usePreservedCallback } from './usePreservedCallback';
import { usePreservedReference } from './usePreservedReference';
24 changes: 21 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -5858,7 +5858,8 @@ __metadata:
"@tossteam/jest": ^17
"@types/babel__preset-env": ^7
"@types/jest": ^28.1.8
"@types/lodash": ^4
"@types/lodash.debounce": ^4
"@types/lodash.throttle": ^4.1.6
"@types/react": ^18.0.21
"@types/testing-library__jest-dom": ^5.9.5
"@types/testing-library__react-hooks": ^3.2.0
@@ -5870,7 +5871,8 @@ __metadata:
jest: ^29.0.1
jest-environment-jsdom: ^29
jsdom: ^15.2.1
lodash: ^4.17.20
lodash.debounce: ^4.0.8
lodash.throttle: ^4.1.1
react: ^18.2.0
react-dom: ^18.2.0
react-test-renderer: ^18.2.0
@@ -6739,7 +6741,16 @@ __metadata:
languageName: node
linkType: hard

"@types/lodash@npm:*, @types/lodash@npm:^4":
"@types/lodash.throttle@npm:^4.1.6":
version: 4.1.7
resolution: "@types/lodash.throttle@npm:4.1.7"
dependencies:
"@types/lodash": "*"
checksum: 6e1b3836488fecbdc537b6ad9b3fe4855c7336b0fa388773cd57d486619f565a48cabc04b28677fd3819be3f2d13d2bb8f9d4428aa5632885c86cb99729bfd69
languageName: node
linkType: hard

"@types/lodash@npm:*":
version: 4.14.186
resolution: "@types/lodash@npm:4.14.186"
checksum: ee0c1368a8100bb6efb88335107473a41928fc307ff1ef4ff1278868ccddba9c04c68c36d1ffe3a0392ef4a956e1955f7de3203ec09df4f1655dd1b88485c549
@@ -16557,6 +16568,13 @@ __metadata:
languageName: node
linkType: hard

"lodash.throttle@npm:^4.1.1":
version: 4.1.1
resolution: "lodash.throttle@npm:4.1.1"
checksum: 129c0a28cee48b348aef146f638ef8a8b197944d4e9ec26c1890c19d9bf5a5690fe11b655c77a4551268819b32d27f4206343e30c78961f60b561b8608c8c805
languageName: node
linkType: hard

"lodash.truncate@npm:^4.4.2":
version: 4.4.2
resolution: "lodash.truncate@npm:4.4.2"

0 comments on commit 3fe4d0a

Please sign in to comment.