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

feat: add jsx support detection #416

Conversation

khanti42
Copy link
Collaborator

@khanti42 khanti42 commented Nov 6, 2024

This PR is to handle MM version that don't support JSX (<v11)

Requirements

@khanti42 khanti42 requested a review from a team as a code owner November 6, 2024 21:36
@khanti42 khanti42 requested review from Julink-eth and stanleyyconsensys and removed request for a team November 6, 2024 21:36
Copy link
Collaborator

@stanleyyconsensys stanleyyconsensys left a comment

Choose a reason for hiding this comment

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

We dont need a state mgr , as this is TEMP solution, and eventually needed to remove when most of the user has the latest MM version

packages/starknet-snap/src/utils/snap.ts Outdated Show resolved Hide resolved
packages/starknet-snap/src/index.tsx Outdated Show resolved Hide resolved
packages/starknet-snap/src/index.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@stanleyyconsensys stanleyyconsensys left a comment

Choose a reason for hiding this comment

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

the init state mgr still exist
the wallet ui still change when we already split it into other PR

@khanti42 khanti42 force-pushed the feat/sf-715-jsx-support-detection branch from bd56316 to 9f03456 Compare November 20, 2024 07:49
Copy link

sonarcloud bot commented Nov 20, 2024

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-wallet-ui'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

Copy link

sonarcloud bot commented Nov 20, 2024

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-starknet-snap'

Issues
9 New issues
0 Accepted issues

Measures
0 Security Hotspots
2.5% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@stanleyyconsensys stanleyyconsensys merged commit 6531485 into feat/snap-fee-token-selection Nov 20, 2024
13 checks passed
@stanleyyconsensys stanleyyconsensys deleted the feat/sf-715-jsx-support-detection branch November 20, 2024 09:37
github-merge-queue bot pushed a commit that referenced this pull request Nov 21, 2024
… Snap (#429)

* chore: add jsx support in snap (#415)

* chore: add jsx support in snap

* chore: fix comment

* chore: update yarn.lock

* feat: add common jsx component (#417)

* chore: add jsx support in snap

* chore: add jsx support in snap

* feat: jsx support management

* feat: common jsx components and fragments

* chore: fix test and lint

* chore: rollback jsx support detection not here

* chore: fix comment

* chore: fix comments

* chore: fix comments

* chore: update yarn.lock

* chore: update yarn.lock

* chore: add react-dom types

* chore: fix comments

* chore: rebase wallet-ui changes happening elsewhere

* feat: add fee token selection interactive UI (#418)

* chore: add jsx support in snap

* chore: add jsx support in snap

* feat: jsx support management

* feat: common jsx components and fragments

* chore: fix test and lint

* feat: add interactive-ui for execute txn

* fix: add mutex in jsx support detection mechanism

* chore: fixture request addapted

* chore: ensure test pass

* chore: lint

* chore: remove console.log

* chore: rollback jsx support detection not here

* chore: rollback index.tsx

* chore: fix comment

* chore: fix comments

* chore: fix comments

* chore: update yarn.lock

* chore: update yarn.lock

* chore: update yarn.lock

* chore: rebase wallet-ui changes happening elsewhere

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: removed utils

* fix: implement comments

* fix: implement comments

* chore: fix comments

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/types/snapState.ts

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: lint

---------

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* feat: adopt fee token selection dialog in RPC `starkNet_executeTxn` (#419)

* chore: add jsx support in snap

* chore: add jsx support in snap

* feat: jsx support management

* feat: common jsx components and fragments

* chore: fix test and lint

* feat: add interactive-ui for execute txn

* fix: add mutex in jsx support detection mechanism

* chore: fixture request addapted

* chore: ensure test pass

* chore: lint

* feat: add interactive-ui in execute txn

* chore: remove console.log

* chore: missing helper in tests

* chore: lint

* chore: rollback jsx support detection not here

* chore: rollback index.tsx

* chore: fix comment

* chore: fix comments

* chore: fix comments

* chore: update yarn.lock

* chore: update yarn.lock

* feat: update wallet-ui message

* chore: update yarn.lock

* chore: rebase wallet-ui changes happening elsewhere

* chore: rebase wallet-ui changes happening elsewhere

* chore: fix comments

* chore: fix comments

* fix: formatter-utils

* chore: fix comments

* chore: fix comments

* chore: lint

* chore: lint

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: removed utils

* fix: implement comments

* fix: implement comments

* chore: fix comments

* chore: fix comments

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/types/snapState.ts

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: lint

* chore: lint

* chore: fix comments

* chore: fix comments

---------

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* chore: fix tests

* feat: add jsx support detection (#416)

* chore: add jsx support in snap

* chore: add jsx support in snap

* feat: jsx support management

* chore: fix test and lint

* fix: add mutex in jsx support detection mechanism

* chore: ensure test pass

* feat: new init state manager class to manage state init and support check

* fix: wait for hooks in request handler

* chore: lint

* fix: set jsx support to true before showing dialog

* chore: fix comment

* fix: moved ping pong

* chore: lint

* chore: rollback state

* chore: lint

* chore: fix comments

* fix: test suits

* feat: add event listener for fee token selection (#420)

* chore: add jsx support in snap

* chore: add jsx support in snap

* feat: jsx support management

* feat: common jsx components and fragments

* chore: fix test and lint

* feat: add interactive-ui for execute txn

* fix: add mutex in jsx support detection mechanism

* chore: fixture request addapted

* chore: ensure test pass

* chore: lint

* feat: add interactive-ui in execute txn

* chore: remove console.log

* chore: missing helper in tests

* chore: lint

* feat: event-handler in index.tsx

* feat: event controller

* feat: error handling and tests suits for event controller

* fix: test suits

* fix: signer in fee-token-selector

* chore: rollback jsx support detection not here

* chore: rollback index.tsx

* chore: lint

* chore: fix comment

* chore: fix comments

* chore: fix comments

* chore: update yarn.lock

* chore: update yarn.lock

* feat: update wallet-ui message

* chore: update yarn.lock

* chore: rebase wallet-ui changes happening elsewhere

* chore: rebase wallet-ui changes happening elsewhere

* chore: fix comments

* chore: fix comments

* fix: formatter-utils

* chore: fix comments

* chore: fix comments

* chore: lint

* chore: lint

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: lint

* chore: lint

* chore: removed utils

* feat: add comments in user-input classes

* fix: implement comments

* fix: implement comments

* chore: fix comments

* chore: fix comments

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/types/snapState.ts

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: lint

* chore: lint

* chore: fix rebase

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: rebase

* fix: removed user-input controller abstract class and derived ones

* chore: rollback execute-txn

* chore: update

* chore: fix comments

* chore: fix comments

* chore: refine the code

* fix: add execution test

* fix: update execute txn test

---------

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/state/state-manager.ts

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/index.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/types/snapState.ts

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/index.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/index.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/index.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* chore: lint

---------

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>
@github-actions github-actions bot mentioned this pull request Nov 21, 2024
github-merge-queue bot pushed a commit that referenced this pull request Nov 21, 2024
* chore: add jsx support in snap (#415)

* chore: add jsx support in snap

* chore: fix comment

* chore: update yarn.lock

* feat: add common jsx component (#417)

* chore: add jsx support in snap

* chore: add jsx support in snap

* feat: jsx support management

* feat: common jsx components and fragments

* chore: fix test and lint

* chore: rollback jsx support detection not here

* chore: fix comment

* chore: fix comments

* chore: fix comments

* chore: update yarn.lock

* chore: update yarn.lock

* chore: add react-dom types

* chore: fix comments

* chore: rebase wallet-ui changes happening elsewhere

* feat: add fee token selection interactive UI (#418)

* chore: add jsx support in snap

* chore: add jsx support in snap

* feat: jsx support management

* feat: common jsx components and fragments

* chore: fix test and lint

* feat: add interactive-ui for execute txn

* fix: add mutex in jsx support detection mechanism

* chore: fixture request addapted

* chore: ensure test pass

* chore: lint

* chore: remove console.log

* chore: rollback jsx support detection not here

* chore: rollback index.tsx

* chore: fix comment

* chore: fix comments

* chore: fix comments

* chore: update yarn.lock

* chore: update yarn.lock

* chore: update yarn.lock

* chore: rebase wallet-ui changes happening elsewhere

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: removed utils

* fix: implement comments

* fix: implement comments

* chore: fix comments

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/types/snapState.ts

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: lint

---------

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* feat: adopt fee token selection dialog in RPC `starkNet_executeTxn` (#419)

* chore: add jsx support in snap

* chore: add jsx support in snap

* feat: jsx support management

* feat: common jsx components and fragments

* chore: fix test and lint

* feat: add interactive-ui for execute txn

* fix: add mutex in jsx support detection mechanism

* chore: fixture request addapted

* chore: ensure test pass

* chore: lint

* feat: add interactive-ui in execute txn

* chore: remove console.log

* chore: missing helper in tests

* chore: lint

* chore: rollback jsx support detection not here

* chore: rollback index.tsx

* chore: fix comment

* chore: fix comments

* chore: fix comments

* chore: update yarn.lock

* chore: update yarn.lock

* feat: update wallet-ui message

* chore: update yarn.lock

* chore: rebase wallet-ui changes happening elsewhere

* chore: rebase wallet-ui changes happening elsewhere

* chore: fix comments

* chore: fix comments

* fix: formatter-utils

* chore: fix comments

* chore: fix comments

* chore: lint

* chore: lint

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: removed utils

* fix: implement comments

* fix: implement comments

* chore: fix comments

* chore: fix comments

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/types/snapState.ts

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: lint

* chore: lint

* chore: fix comments

* chore: fix comments

---------

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* chore: fix tests

* feat: replace rpc dialogs with jsx

* feat: add sign-message in jsx

* feat: add jsx support detection (#416)

* chore: add jsx support in snap

* chore: add jsx support in snap

* feat: jsx support management

* chore: fix test and lint

* fix: add mutex in jsx support detection mechanism

* chore: ensure test pass

* feat: new init state manager class to manage state init and support check

* fix: wait for hooks in request handler

* chore: lint

* fix: set jsx support to true before showing dialog

* chore: fix comment

* fix: moved ping pong

* chore: lint

* chore: rollback state

* chore: lint

* chore: fix comments

* fix: test suits

* fix: use functional component

* feat: add event listener for fee token selection (#420)

* chore: add jsx support in snap

* chore: add jsx support in snap

* feat: jsx support management

* feat: common jsx components and fragments

* chore: fix test and lint

* feat: add interactive-ui for execute txn

* fix: add mutex in jsx support detection mechanism

* chore: fixture request addapted

* chore: ensure test pass

* chore: lint

* feat: add interactive-ui in execute txn

* chore: remove console.log

* chore: missing helper in tests

* chore: lint

* feat: event-handler in index.tsx

* feat: event controller

* feat: error handling and tests suits for event controller

* fix: test suits

* fix: signer in fee-token-selector

* chore: rollback jsx support detection not here

* chore: rollback index.tsx

* chore: lint

* chore: fix comment

* chore: fix comments

* chore: fix comments

* chore: update yarn.lock

* chore: update yarn.lock

* feat: update wallet-ui message

* chore: update yarn.lock

* chore: rebase wallet-ui changes happening elsewhere

* chore: rebase wallet-ui changes happening elsewhere

* chore: fix comments

* chore: fix comments

* fix: formatter-utils

* chore: fix comments

* chore: fix comments

* chore: lint

* chore: lint

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: lint

* chore: lint

* chore: removed utils

* feat: add comments in user-input classes

* fix: implement comments

* fix: implement comments

* chore: fix comments

* chore: fix comments

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/types/snapState.ts

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/components/ExecuteTxnUI.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* Update packages/starknet-snap/src/ui/utils.test.tsx

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: lint

* chore: lint

* chore: fix rebase

* chore: fix comments

* chore: fix comments

* chore: fix comments

* chore: rebase

* fix: removed user-input controller abstract class and derived ones

* chore: rollback execute-txn

* chore: update

* chore: fix comments

* chore: fix comments

* chore: refine the code

* fix: add execution test

* fix: update execute txn test

---------

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>

* chore: lint

* chore: docstring

* chore: lint

* chore: docstring

* chore: lint

* chore: lint

* chore: lint

---------

Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>
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