Skip to content

Commit

Permalink
remove lodash (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
kingsleydon authored May 22, 2024
1 parent e2d2526 commit a1f7b24
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 35 deletions.
1 change: 0 additions & 1 deletion apps/app/components/BasePool/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ const BasePoolList: FC<{
spacing={2}
>
{page.basePoolsConnection.edges.map((edge) =>
// biome-ignore lint/correctness/useJsxKeyInIterable: <explanation>
variant === 'farm' ? (
<FarmCard
key={edge.node.id}
Expand Down
6 changes: 5 additions & 1 deletion apps/app/components/TopBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ const TopBar: FC = () => {

const icons = (
<Stack direction="row" spacing={1} alignItems="center">
<IconButton size="small" href="https://discord.gg/phala-network" target="_blank">
<IconButton
size="small"
href="https://discord.gg/phala-network"
target="_blank"
>
<FontAwesomeIcon
icon={faDiscord}
width={18}
Expand Down
8 changes: 4 additions & 4 deletions apps/app/components/WrapDecimal.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import {Box} from '@mui/material'
import {uniqueId} from 'lodash-es'
import {type FC, Fragment, type ReactNode, useMemo} from 'react'

const regex = /(\d+\.\d+)/g
const WrapDecimal: FC<{children: ReactNode}> = ({children}) => {
const parts = useMemo(() => {
if (typeof children === 'string') {
return children.split(regex).map((part) => [part, uniqueId()])
return children.split(regex)
}
return []
}, [children])

return (
<>
{typeof children === 'string'
? parts.map(([part, id]) => {
? parts.map((part, index) => {
if (part.match(regex) != null) {
const [integer, decimal] = part.split('.')
return (
<Fragment key={id}>
// biome-ignore lint/suspicious/noArrayIndexKey: the order of parts will not change
<Fragment key={index}>
{integer}.
<Box component="span" sx={{filter: 'brightness(0.5)'}}>
{decimal}
Expand Down
4 changes: 2 additions & 2 deletions apps/app/hooks/useDebounced.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {debounce} from 'lodash-es'
import {debounce} from 'radash'
import {useEffect, useMemo, useState} from 'react'

const useDebounced = <T>(state: T, delay = 500): T => {
const [debouncedState, setDebouncedState] = useState(state)
const debouncedSetState = useMemo(
() => debounce(setDebouncedState, delay),
() => debounce({delay}, setDebouncedState),
[delay],
)

Expand Down
27 changes: 13 additions & 14 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,51 +16,50 @@
"@fortawesome/free-brands-svg-icons": "^6.5.2",
"@fortawesome/free-regular-svg-icons": "^6.5.2",
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fortawesome/react-fontawesome": "^0.2.0",
"@mui/icons-material": "^5.15.17",
"@fortawesome/react-fontawesome": "^0.2.1",
"@mui/icons-material": "^5.15.18",
"@mui/lab": "5.0.0-alpha.170",
"@mui/material": "^5.15.17",
"@mui/material": "^5.15.18",
"@mui/material-nextjs": "^5.15.11",
"@mui/x-data-grid": "^7.3.2",
"@mui/x-data-grid": "^7.5.0",
"@phala/lib": "workspace:*",
"@phala/store": "workspace:*",
"@polkadot/api": "^11.0.3",
"@polkadot/extension-inject": "^0.47.4",
"@polkadot/api": "^11.1.1",
"@polkadot/extension-inject": "^0.47.5",
"@polkadot/keyring": "^12.6.2",
"@polkadot/react-identicon": "^3.6.6",
"@polkadot/types": "^11.0.3",
"@polkadot/types": "^11.1.1",
"@polkadot/util": "^12.6.2",
"@sentry/nextjs": "^7.114.0",
"@sentry/nextjs": "^7.116.0",
"@talismn/connect-wallets": "^1.2.5",
"@tanstack/react-query": "^5.35.1",
"@tanstack/react-query-devtools": "^5.35.1",
"@tanstack/react-query": "^5.37.1",
"@tanstack/react-query-devtools": "^5.37.1",
"ajv": "^8.13.0",
"date-fns": "^3.6.0",
"decimal.js": "^10.4.3",
"graphql": "^16.8.1",
"graphql-request": "^6.1.0",
"graphql-tag": "^2.12.6",
"jotai": "^2.8.0",
"jotai": "^2.8.1",
"jotai-devtools": "^0.9.1",
"lodash-es": "^4.17.21",
"mutative": "^1.0.5",
"next": "^14.2.3",
"notistack": "^3.0.1",
"radash": "^12.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-intersection-observer": "^9.10.2",
"react-markdown": "^9.0.1",
"react-snap-carousel": "^0.4.0",
"recharts": "^2.12.7",
"sharp": "^0.33.3",
"sharp": "^0.33.4",
"swr": "^2.2.5"
},
"devDependencies": {
"@next/bundle-analyzer": "^14.2.3",
"@svgr/webpack": "^8.1.0",
"@swc-jotai/debug-label": "^0.1.0",
"@swc-jotai/react-refresh": "^0.1.0",
"@types/lodash-es": "^4.17.12",
"@types/sharp": "^0.32.0"
}
}
10 changes: 5 additions & 5 deletions apps/subbridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@
"start": "next start"
},
"dependencies": {
"@buildwithsygma/sygma-contracts": "2.5.3",
"@buildwithsygma/sygma-contracts": "2.6.1",
"@buildwithsygma/sygma-sdk-core": "2.10.0",
"@emotion/cache": "^11.11.0",
"@emotion/react": "^11.11.4",
"@emotion/server": "^11.11.0",
"@emotion/styled": "^11.11.5",
"@metamask/detect-provider": "^2.0.0",
"@metamask/providers": "^16.1.0",
"@mui/icons-material": "^5.15.17",
"@mui/icons-material": "^5.15.18",
"@mui/lab": "5.0.0-alpha.170",
"@mui/material": "^5.15.17",
"@mui/material": "^5.15.18",
"@mui/material-nextjs": "^5.15.11",
"@phala/lib": "workspace:*",
"@phala/store": "workspace:*",
"@phala/ui": "workspace:*",
"@polkadot/api": "^11.0.2",
"@polkadot/api": "^11.1.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@talismn/connect-components": "^1.1.8",
"@talismn/connect-ui": "^1.1.3",
"@talismn/connect-wallets": "^1.2.5",
"decimal.js": "^10.4.3",
"ethers": "^5.7.2",
"jotai": "^2.8.0",
"jotai": "^2.8.1",
"jotai-devtools": "^0.9.1",
"next": "^14.2.3",
"next-images": "^1.8.5",
Expand Down
Binary file modified bun.lockb
Binary file not shown.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"devDependencies": {
"@biomejs/biome": "1.7.3",
"@total-typescript/ts-reset": "^0.5.1",
"@types/node": "^20.12.11",
"lefthook": "^1.6.10",
"tsx": "^4.9.3",
"@types/node": "^20.12.12",
"lefthook": "^1.6.12",
"tsx": "^4.10.5",
"turbo": "^1.13.3",
"typescript": "^5.4.5"
},
Expand Down
18 changes: 17 additions & 1 deletion packages/polkadot-types/interfaces/augment-api-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
import '@polkadot/api-base/types/calls';

import type { ApiTypes, AugmentedCall, DecoratedCallBase } from '@polkadot/api-base/types';
import type { Bytes, Null, Option, Vec, u32 } from '@polkadot/types-codec';
import type { Bytes, Null, Option, Result, Vec, u32 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { CheckInherentsResult, InherentData } from '@polkadot/types/interfaces/blockbuilder';
import type { BlockHash } from '@polkadot/types/interfaces/chain';
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
import type { CollationInfo } from '@polkadot/types/interfaces/cumulus';
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
import type { GenesisBuildErr } from '@polkadot/types/interfaces/genesisBuilder';
import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata';
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { AccountId, Balance, Block, Header, Index, KeyTypeId, SlotDuration, Weight } from '@polkadot/types/interfaces/runtime';
Expand Down Expand Up @@ -105,6 +106,21 @@ declare module '@polkadot/api-base/types/calls' {
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xfbc577b9d747efd6/1 */
genesisBuilder: {
/**
* Build `RuntimeGenesisConfig` from a JSON blob not using any defaults and store it in the storage.
**/
buildConfig: AugmentedCall<ApiType, (json: Bytes | string | Uint8Array) => Observable<Result<ITuple<[]>, GenesisBuildErr>>>;
/**
* Creates the default `RuntimeGenesisConfig` and returns it as a JSON blob.
**/
createDefaultConfig: AugmentedCall<ApiType, () => Observable<Bytes>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37e397fc7c91f5e4/2 */
metadata: {
/**
Expand Down
Loading

0 comments on commit a1f7b24

Please sign in to comment.