feat: Snaps execution refactor#8369
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
…amask-mobile into fb/snaps-execution-refactor
|
E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/19a1c25f-217e-4dc7-8ad7-0cf279f77ea6 |
|
I tested https://metamask.github.io/snaps/test-snaps/latest/ and I kept getting this error on iOS. This occurs on first load and when you try to install a snap. This also occurred with version 1.0.1 of the test snap. |
owencraston
left a comment
There was a problem hiding this comment.
How were these web.bundle files generated? is there a way for us to create a script so that it automatically loads the bundled execution env code into the app so that we do not need to manually update it?
…amask-mobile into fb/snaps-execution-refactor
## **Description** This PR bumps snaps packages alongside others in order to allow snaps new architecture and refactored code from snaps codebase be used into mobile as an external dependency. The current PR builds the bases to the [8369](#8369). **Any failing tests related to snaps can be safely ignored** since the snaps "consumer" code is/will be handled/refactored on the PR above. ## **Related issues** Fixes: N/A ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained what problem this PR is solving and how it is solved. - [x] I've linked related issues - [x] I've included manual testing steps - [x] I've included screenshots/recordings if applicable - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [x] I’ve properly set the pull request status: - [x] In case it's not yet "ready for review", I've set it to "draft". - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: Owen Craston <owengc12@gmail.com>
|
Closing in favor of #8700 already merged. |


Description
This PR adds a refactored Snaps Webview approach and embedded execution environment to allow mobile app consume the new mobile snaps architecture.
Related issues
Fixes: N/A
Manual testing steps
First --> Copy snaps_controllers files to metamask-mobile repo
yarnon root dir.packages/snaps-controllerand run:yarn build:source && yarn builddistdirectory and copy theservicefolder fromcjs,esm, andtypesand paste insidenode_modules/@metamask/snaps-controller(cjs, esm, and types) onmetamask-mobilerepo.Second --> Start the execution environment locally
yarn build:lavamoat:policy && yarn build:lavamoat && yarn build:source && yarn buildscripts/start.jsfromconst PUBLIC = path.join(ROOT, '/dist/browserify/iframe');toconst PUBLIC = path.join(ROOT, '/dist/browserify/webview');Third:
app/lib/snaps/SnapsExecutionWebView.tsxwebview source to point tohttp://localhost:6363.Screen.Recording.2024-01-31.at.10.05.48.mov
Pre-merge author checklist
Pre-merge reviewer checklist
CI Related Section: DO NOT EDIT
Flag used by Bitrise to either run or skip E2E smoke tests