Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove type declaration for a module in types package #646

Closed
wants to merge 2 commits into from
Closed

Remove type declaration for a module in types package #646

wants to merge 2 commits into from

Conversation

mmv08
Copy link
Contributor

@mmv08 mmv08 commented Nov 17, 2021

In the current form, the declaration overwrites types for modules named @walletconnect/types, this makes it impossible to properly integrate walletconnect v1 and v2 in the same app, so if you'd try to import types for v2 it will resolve to v1 types.

Required for safe-global/safe-react-apps#178

@vercel
Copy link

vercel bot commented Nov 17, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

react-app – ./examples/react-app

🔍 Inspect: https://vercel.com/walletconnect/react-app/8ePHkjJSFJSBAAiQBB8GW7Zj1SjR
✅ Preview: Failed

[Deployment for 0a1ad1f failed]

react-wallet – ./examples/react-wallet

🔍 Inspect: https://vercel.com/walletconnect/react-wallet/aCFy4FXEbGwrACLDF63FEDwEm9m7
✅ Preview: Failed

[Deployment for 0a1ad1f failed]

@@ -67,6 +67,7 @@
"lerna": "3.20.2",
"npm-run-all": "4.1.5",
"prettier": "1.19.1",
"typescript": "^4.4.4",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npx tsc in the build step asked me to install typescript first

@pedrouid
Copy link
Contributor

pedrouid commented Nov 22, 2021

What I've been recommending instead is that you install using NPM aliases not only for the client but also for it's dependencies.

    "@walletconnect/client": "1.6.6",
    "@walletconnect/types": "1.6.6",
    "@walletconnect/utils": "1.6.6",
    "@walletconnect/v2-client": "npm:@walletconnect/[email protected]",
    "@walletconnect/v2-types": "npm:@walletconnect/[email protected]",
    "@walletconnect/v2-utils": "npm:@walletconnect/[email protected]",

I know it's not a perfect solution nor the best developer experience but we intend to improve this 🙏

@mmv08
Copy link
Contributor Author

mmv08 commented Nov 22, 2021

What I've been recommending instead is that you install using NPM aliases not only for the client but also for it's dependencies.

    "@walletconnect/client": "1.6.6",
    "@walletconnect/types": "1.6.6",
    "@walletconnect/utils": "1.6.6",
    "@walletconnect/v2-client": "npm:@walletconnect/[email protected]",
    "@walletconnect/v2-types": "npm:@walletconnect/[email protected]",
    "@walletconnect/v2-utils": "npm:@walletconnect/[email protected]",

I know it's not a perfect solution nor the best developer experience but we intend to improve this 🙏

This is hacky and does not fix the issue. What's wrong with merging my PR that fixes the problem? You don't need to include module declaration for types package because that's literally what the type package is for.

@mmv08
Copy link
Contributor Author

mmv08 commented Dec 6, 2021

@pedrouid Could you please take another look? I believe the current type packages users declare statement wrongly and blocks v2 integration

@pedrouid
Copy link
Contributor

pedrouid commented Jan 5, 2022

Thanks for the PR @mikheevm 🙌 I will handle this on the next branch

@pedrouid pedrouid closed this Jan 5, 2022
@pedrouid
Copy link
Contributor

pedrouid commented Jan 5, 2022

Check commit ea0d4e3

@mmv08
Copy link
Contributor Author

mmv08 commented Jan 5, 2022

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants