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

Fix web-wagmi build #416

Merged
merged 5 commits into from
Jul 13, 2023
Merged

Fix web-wagmi build #416

merged 5 commits into from
Jul 13, 2023

Conversation

desfero
Copy link
Collaborator

@desfero desfero commented Jul 13, 2023

No description provided.

@desfero desfero self-assigned this Jul 13, 2023
@changeset-bot
Copy link

changeset-bot bot commented Jul 13, 2023

⚠️ No Changeset found

Latest commit: ddcfbc4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@height
Copy link

height bot commented Jul 13, 2023

This pull request has been linked to 1 task:

💡Tip: Add "Close T-3972" to the pull request title or description, to a commit message, or in a comment to mark this task as "Done" when the pull request is merged.

@vercel
Copy link

vercel bot commented Jul 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lens-sdk-example-web-wagmi ✅ Ready (Inspect) Visit Preview Jul 13, 2023 8:25am

@desfero desfero changed the title Add build:with-packages script to web-wagmi Fix web-wagmi build Jul 13, 2023
@@ -1,39 +1,21 @@
import { useWalletLogin, useWalletLogout } from '@lens-protocol/react-web';
import { useEffect } from 'react';
import toast from 'react-hot-toast';
import { useAccount, useConnect, useDisconnect } from 'wagmi';
import { InjectedConnector } from 'wagmi/connectors/injected';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Simplifying next.js example given it was anyway broken as was using the older wagmi 0.x. We anyway have wagmi integration inside web-wagmi so to simplify maintenance this is using now just in memory signer as the react-native example.

Copy link
Contributor

Choose a reason for hiding this comment

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

nice, thanks!

@@ -15,7 +16,7 @@
"tsc": "tsc --noEmit"
},
"dependencies": {
"@bundlr-network/client": "^0.10.3",
"@bundlr-network/client": "^0.11.9",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Had to upgrade bundler due to some heresy in build pipline.
vitejs/vite#9703
Older @bundlr-network/client was using near-api-js which is probably wrongly published and was causing build failures for production web-wagmi deployment.

"typescript": "^4.9.5",
"vite": "^4.1.3",
"vite-plugin-node-polyfills": "^0.7.0"
"vite": "^4.4.3",
Copy link
Collaborator Author

@desfero desfero Jul 13, 2023

Choose a reason for hiding this comment

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

While trying fix the error mentioned above also upgraded vite to the latest, didn't resolve the issue but anyway it's better to have the latest one in use.

@@ -11,19 +11,4 @@ export default defineConfig({
nodePolyfills({ protocolImports: true }),
visualizer({ open: true }) as PluginOption,
],

build: {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

simplifying, for example app it's not needed

@@ -3,8 +3,9 @@
"private": true,
"version": "0.1.0",
"scripts": {
"build:with-packages": "turbo run build --filter=...example-wagmi",
Copy link
Contributor

Choose a reason for hiding this comment

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

what does --filter=...example-wagmi do?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Builds all dependencies of the example-wagmi inside monorepo, we could also build the whole monorepo but this one is better as only builds what example-wagmi is actually using.

Copy link
Contributor

@krzysu krzysu left a comment

Choose a reason for hiding this comment

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

nice!

@@ -1,39 +1,21 @@
import { useWalletLogin, useWalletLogout } from '@lens-protocol/react-web';
import { useEffect } from 'react';
import toast from 'react-hot-toast';
import { useAccount, useConnect, useDisconnect } from 'wagmi';
import { InjectedConnector } from 'wagmi/connectors/injected';
Copy link
Contributor

Choose a reason for hiding this comment

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

nice, thanks!

@@ -0,0 +1,21 @@
// This is NOT PRODUCTION READY implementation of the EOA.
Copy link
Contributor

Choose a reason for hiding this comment

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

good to show usage of the SDK without wagmi 👍

@desfero desfero merged commit 442b1ef into main Jul 13, 2023
2 checks passed
@desfero desfero deleted the T-3972/deploy-the-web-wagmi-example-app branch July 13, 2023 09:35
},

define: {
'process.env': {},
Copy link
Member

Choose a reason for hiding this comment

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

@desfero did we check metadata upload via WebBundlr works still? This line and the use of nodePolyfills plugin were needed to make WebBundlr works on browsers.

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.

None yet

4 participants