Skip to content

Commit

Permalink
Revert "fix(core): fix Webpack static analysis issue with dynamic imp…
Browse files Browse the repository at this point in the history
…orts (#211)"

This reverts commit 4f77fc3.
  • Loading branch information
drichar committed Aug 9, 2024
1 parent b3c4f7d commit fc1529b
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/use-wallet/src/wallets/defly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class DeflyWallet extends BaseWallet {

private async initializeClient(): Promise<DeflyWalletConnect> {
console.info(`[${this.metadata.name}] Initializing client...`)
const module = await import(/* webpackIgnore: true */ '@blockshake/defly-connect')
const module = await import('@blockshake/defly-connect')
const DeflyWalletConnect = module.default
? module.default.DeflyWalletConnect
: module.DeflyWalletConnect
Expand Down
4 changes: 1 addition & 3 deletions packages/use-wallet/src/wallets/kibisis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,7 @@ export class KibisisWallet extends BaseWallet {
`[${KibisisWallet.name}]#${_functionName}: initializing @agoralabs-sh/avm-web-provider...`
)

this.avmWebProviderSDK = await import(
/* webpackIgnore: true */ '@agoralabs-sh/avm-web-provider'
)
this.avmWebProviderSDK = await import('@agoralabs-sh/avm-web-provider')

if (!this.avmWebProviderSDK) {
throw new Error(
Expand Down
2 changes: 1 addition & 1 deletion packages/use-wallet/src/wallets/lute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class LuteWallet extends BaseWallet {

private async initializeClient(): Promise<LuteConnect> {
console.info(`[${this.metadata.name}] Initializing client...`)
const module = await import(/* webpackIgnore: true */ 'lute-connect')
const module = await import('lute-connect')
const LuteConnect = module.default

const client = new LuteConnect(this.options.siteName as string)
Expand Down
5 changes: 2 additions & 3 deletions packages/use-wallet/src/wallets/magic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ export class MagicAuth extends BaseWallet {

private async initializeClient(): Promise<MagicAuthClient> {
console.info(`[${this.metadata.name}] Initializing client...`)
const Magic = (await import(/* webpackIgnore: true */ 'magic-sdk')).Magic
const AlgorandExtension = (await import(/* webpackIgnore: true */ '@magic-ext/algorand'))
.AlgorandExtension
const Magic = (await import('magic-sdk')).Magic
const AlgorandExtension = (await import('@magic-ext/algorand')).AlgorandExtension
const client = new Magic(this.options.apiKey as string, {
extensions: {
algorand: new AlgorandExtension({
Expand Down
2 changes: 1 addition & 1 deletion packages/use-wallet/src/wallets/pera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class PeraWallet extends BaseWallet {

private async initializeClient(): Promise<PeraWalletConnect> {
console.info(`[${this.metadata.name}] Initializing client...`)
const module = await import(/* webpackIgnore: true */ '@perawallet/connect')
const module = await import('@perawallet/connect')
const PeraWalletConnect = module.default
? module.default.PeraWalletConnect
: module.PeraWalletConnect
Expand Down
2 changes: 1 addition & 1 deletion packages/use-wallet/src/wallets/pera2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class PeraWallet extends BaseWallet {

private async initializeClient(): Promise<PeraWalletConnect> {
console.info(`[${this.metadata.name}] Initializing client...`)
const module = await import(/* webpackIgnore: true */ '@perawallet/connect-beta')
const module = await import('@perawallet/connect-beta')

const PeraWalletConnect = module.PeraWalletConnect || module.default.PeraWalletConnect

Expand Down
6 changes: 2 additions & 4 deletions packages/use-wallet/src/wallets/walletconnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@ export class WalletConnect extends BaseWallet {

private async initializeClient(): Promise<SignClient> {
console.info(`[${this.metadata.name}] Initializing client...`)
const SignClient = (await import(/* webpackIgnore: true */ '@walletconnect/sign-client'))
.SignClient
const SignClient = (await import('@walletconnect/sign-client')).SignClient
const client = await SignClient.init(this.options)

client.on('session_event', (args) => {
Expand All @@ -289,8 +288,7 @@ export class WalletConnect extends BaseWallet {

private async initializeModal(): Promise<WalletConnectModal> {
console.info(`[${this.metadata.name}] Initializing modal...`)
const WalletConnectModal = (await import(/* webpackIgnore: true */ '@walletconnect/modal'))
.WalletConnectModal
const WalletConnectModal = (await import('@walletconnect/modal')).WalletConnectModal
const modal = new WalletConnectModal({
projectId: this.options.projectId,
chains: this.chains,
Expand Down

0 comments on commit fc1529b

Please sign in to comment.