Skip to content

Conversation

@rossbulat
Copy link
Contributor

@rossbulat rossbulat commented Apr 7, 2025

This PR introduces a new package, observables-connect to abstract extensions discovery from React. Instead, react-connect-kit now relies on this new package by subscribing to these observables and updating its extension state when extensions are discovered.

This PR paves the way to decoupling all API state from React components, allowing dapps like staking dashboard to be more flexible with their data management.

@rossbulat rossbulat marked this pull request as draft April 7, 2025 12:55
@rossbulat rossbulat marked this pull request as ready for review April 7, 2025 15:11
@rossbulat rossbulat requested a review from Copilot April 7, 2025 15:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 20 out of 26 changed files in this pull request and generated 1 comment.

Files not reviewed (6)
  • builder/package.json: Language not supported
  • library/factories/package.json: Language not supported
  • library/hooks/package.json: Language not supported
  • library/observables-connect/package.json: Language not supported
  • library/observables-connect/tsconfig.json: Language not supported
  • library/react-connect-kit/package.json: Language not supported
Comments suppressed due to low confidence (1)

builder/src/builders/observables-connect/index.ts:22

  • Throwing a plain string instead of an Error object may hinder debugging and stack trace visibility. Consider throwing an Error instance (e.g. throw new Error('Prebuild failed.')) to improve error handling.
if (!(await prebuild(folder))) { throw `Prebuild failed.` }

@rossbulat rossbulat requested a review from Copilot April 7, 2025 15:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 20 out of 26 changed files in this pull request and generated 1 comment.

Files not reviewed (6)
  • builder/package.json: Language not supported
  • library/factories/package.json: Language not supported
  • library/hooks/package.json: Language not supported
  • library/observables-connect/package.json: Language not supported
  • library/observables-connect/tsconfig.json: Language not supported
  • library/react-connect-kit/package.json: Language not supported
Comments suppressed due to low confidence (2)

library/react-connect-kit/src/types.ts:4

  • Please verify that the exported types from '@w3ux/types' fully match the previously used local definitions to ensure all usages in react-connect-kit remain compatible.
import type { ExtensionInjected, ExtensionInterface } from '@w3ux/types'

library/react-connect-kit/src/ExtensionsProvider/index.tsx:52

  • Confirm that the imported 'canConnect' function from '@w3ux/observables-connect/extensions' accurately reflects the previous logic (i.e. checking installation and connection status) to avoid unexpected scenarios.
const extensionCanConnect = (id: string): boolean => canConnect(id)

@rossbulat rossbulat merged commit a5ade6b into main Apr 7, 2025
@rossbulat rossbulat mentioned this pull request Apr 7, 2025
@rossbulat rossbulat mentioned this pull request Jun 7, 2025
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