use-ink / link

Unstoppable URL shortener built with the ink! smart contract language.
https://tiny.ink
Apache License 2.0
29 stars 8 forks source link

feat: upgrading `useink` #250

Closed peetzweg closed 1 year ago

peetzweg commented 1 year ago

Tried to upgrade useink to the best of my abilities. Use the useink docs to upgrade. 👍 Btw it seems like the previous LocalStorage is not compatible with the new one, so it crashed on me until I cleared it. Might be bad for previous tiny.ink users.

Worked well but I'am not able to connect to my wallets, neither subwallet nor polkadotjs extension. Not error is thrown or outputted somehow, any idea what's wrong @DoubleOTheven ?

https://github.com/paritytech/link/blob/54a82493e22d342bfab1a4069a270ad50cbe9ef9/frontend/src/components/Header.tsx#L44-L52


Using useink i've encountered these two issues, we should address in 1.0 release.

https://github.com/paritytech/link/blob/54a82493e22d342bfab1a4069a270ad50cbe9ef9/frontend/src/index.tsx#L5

https://github.com/paritytech/link/blob/5e87a8e092ce246f917d3dba80f932bd5a3c7739/frontend/src/App.tsx#L9

When I try to connect, it seems to cause a lot of unnecessary rerenders of the component. Maybe something worthwhile to investigate before the release.

demo

netlify[bot] commented 1 year ago

Deploy Preview for inklink ready!

Name Link
Latest commit 54a82493e22d342bfab1a4069a270ad50cbe9ef9
Latest deploy log https://app.netlify.com/sites/inklink/deploys/64624681d568ca0008920385
Deploy Preview https://deploy-preview-250--inklink.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

DoubleOTheven commented 1 year ago

useink is currently built with Deno using DNT to export node-compatible modules. Inside of that config we are exporting single package that has multiple import paths. In order for TypeScript to recognize these you must add this to your tsconfig.json

    "moduleResolution": "nodenext",
DoubleOTheven commented 1 year ago

I'm working on a branch that is updating useink in this dApp. I have some updates in useink I've made in the process that I will be releasing soon. I think you can hold off on this PR, but I'm glad you got to use the lib a bit

DoubleOTheven commented 1 year ago

The multi-render issue is something I need to look at. Thanks for bringing this up

DoubleOTheven commented 1 year ago

Hey @peetzweg , I'm closing this one because I already merged. Just FYI, { "moduleResolution": "bundler" } works as well. It is a new resolution scheme that looks for additional import paths in a package.json file