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

react: add inbox hooks #659

Merged
merged 2 commits into from
Dec 11, 2023
Merged

react: add inbox hooks #659

merged 2 commits into from
Dec 11, 2023

Conversation

krzysu
Copy link
Contributor

@krzysu krzysu commented Oct 31, 2023

No description provided.

@height
Copy link

height bot commented Oct 31, 2023

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@changeset-bot
Copy link

changeset-bot bot commented Oct 31, 2023

🦋 Changeset detected

Latest commit: 1585de4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@lens-protocol/react-web Minor
@lens-protocol/react Minor
@lens-protocol/wagmi Major
@lens-protocol/react-native Patch

Not sure what this means? Click here to learn what changesets are.

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

@vercel
Copy link

vercel bot commented Oct 31, 2023

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

Name Status Preview Updated (UTC)
lens-sdk-example-web-wagmi ✅ Ready (Inspect) Visit Preview Dec 11, 2023 9:58am

@@ -74,6 +75,7 @@
},
"peerDependencies": {
"@lens-protocol/metadata": "^1.0.0",
"@xmtp/react-sdk": "^3.0.0",
Copy link
Member

Choose a reason for hiding this comment

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

Are we in a position to make this also optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they are, see below

"peerDependenciesMeta": {
    "@xmtp/react-sdk": {
      "optional": true
    }
  },

Copy link
Member

@cesarenaldi cesarenaldi Nov 23, 2023

Choose a reason for hiding this comment

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

can you please double check the import chain? basically only importing the relevant hook should end up importing the XMTP SDK

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, I checked, all xmtp imports are in the inbox folder, which is even exported as @lens-protocol/react-web/inbox. I also tested example web app without xmtp peer dep and of course without inbox hooks, it all works fine.

@krzysu
Copy link
Contributor Author

krzysu commented Nov 29, 2023

@cesarenaldi the issue with xmtp messages constant rerender was solved, see last commit, this PR is then ready from my side.

function EnhanceConversation({ conversation, walletAddress }: EnhanceConversationProps) {
const { conversation: enhancedConversation, isLoading } = useEnhanceConversation({
conversation,
});
Copy link
Member

Choose a reason for hiding this comment

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

Can it be just useEnhanceConversation(conversation) like we discussed. Any rationale for keeping the object?

export function ConversationComposer({ peerProfile }: ConversationComposerProps) {
const { startConversation, isLoading, error } = useStartLensConversation({
peerProfile,
});
Copy link
Member

Choose a reason for hiding this comment

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

What about here? Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

everywhere else in the sdks we use objects as arguments to make them open for future additions without breaking changes, so the same thought is here

@krzysu krzysu merged commit 7507672 into develop Dec 11, 2023
5 checks passed
@krzysu krzysu deleted the v2/xmtp-hooks branch December 11, 2023 10:10
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