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

chore: optimize build #116

Merged
merged 2 commits into from
Feb 22, 2023
Merged

chore: optimize build #116

merged 2 commits into from
Feb 22, 2023

Conversation

0xmad
Copy link
Member

@0xmad 0xmad commented Feb 21, 2023

Explanation

Get rid of clean scripts and replace source maps to get rid of eval code + improve build speed a little bit.

Details are bellow:

  • Remove clean scripts
  • Update source maps

More Information

Fixes #107

Screenshots/Screencaps

N/A

Manual Testing Steps

Just try to run npm run dev and npm run build to check if extension loads properly.

Pre-Merge Checklist

  • PR template is filled out
  • IF this PR fixes a bug, a test that would have caught the bug has been added
  • PR is linked to the appropriate GitHub issue
  • PR has been added to the appropriate release Milestone

+ If there are functional changes:

  • Manual testing complete & passed
  • "Extension QA Board" label has been applied

PR template source from github.com/MetaMask

@0xmad 0xmad added the 🛠 enhancement Optimizing current features label Feb 21, 2023
@0xmad 0xmad requested a review from 0xisk February 21, 2023 23:43
@0xmad 0xmad self-assigned this Feb 21, 2023
Copy link
Member

@0xisk 0xisk left a comment

Choose a reason for hiding this comment

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

Well I still cant approve this change since the eval code is still there not in the dist/js/backgroundPage.js script but in the dist/js/injected.js script in both builds the prod and the dev. That's because of moving the proof generation part from the background to the contentscript.

@0xmad
Copy link
Member Author

0xmad commented Feb 22, 2023

@iskdrews what's the exact error there? I can't see any eval errors and the demo works as expected.

@0xisk
Copy link
Member

0xisk commented Feb 22, 2023

@iskdrews what's the exact error there? I can't see any eval errors and the demo works as expected.

There isn't any error, because the eval code is just moved the dist/js/injected.js still not sure if that would be accepted this way to be approved from chrome reviewers or not.

- [x] Remove clean scripts
- [x] Update source maps
@AtHeartEngineer
Copy link
Collaborator

Ya I'm not seeing any errors on the cryptkeeper side, except for a ObjectMultiplex - orphaned data for stream "publicConfig" warning.

@0xmad
Copy link
Member Author

0xmad commented Feb 22, 2023

@iskdrews I think it's ok if we have generated code with new Function(...). It doesn't use any user input and it's just hardcoded.
I think it was an error on background script before because of inline source maps. For injected, nothing is changed. It probably had the same code before moving proof generation (it's common generated code for most of the files).

Copy link
Collaborator

@AtHeartEngineer AtHeartEngineer left a comment

Choose a reason for hiding this comment

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

This is building and working good for me. I am not understanding the injection being an issue @iskdrews, could you explain that to me when you can?

@0xisk
Copy link
Member

0xisk commented Feb 22, 2023

This is building and working good for me. I am not understanding the injection being an issue @iskdrews, could you explain that to me when you can?

I think all is good now, as @0xmad said it is just an hardcoded value and it doesn't take any inputs so no security risk.

@0xisk 0xisk merged commit fce1171 into master Feb 22, 2023
@0xisk 0xisk deleted the chore/optimize-build branch February 22, 2023 18:42
@0xisk
Copy link
Member

0xisk commented Feb 23, 2023

Ya I'm not seeing any errors on the cryptkeeper side, except for a ObjectMultiplex - orphaned data for stream "publicConfig" warning.

There is an issue for tracking resolving this warning already, but not resolved yet.
#111

@0xisk 0xisk added this to the v0.1.0-beta milestone Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠 enhancement Optimizing current features
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Remove clean scripts
3 participants