vegaprotocol / vegawallet-desktop

Desktop application for Vega Protocol's wallet
MIT License
15 stars 12 forks source link

Bootstrap the desktop application #1

Closed ValentinTrinque closed 3 years ago

ValentinTrinque commented 3 years ago

We would like to distribute the wallet as a desktop application using a cross platform bundler.

Possible bundler: https://github.com/wailsapp/wails/releases

edd commented 3 years ago
  1. The instructions in /frontend say to run npm run serve during development, but using that command results in the following error. It's pretty clear it's expecting to run in a browser instance with some stuff injected, is there a way to mock that for local dev?

TypeError: window.wails is undefined
Init
src/vega/desktop-wallet/frontend/node_modules/@wailsapp/runtime/init.js:19

  16 |  * @param {function} callback
  17 |  */
  18 | function Init(callback) {
> 19 |   window.wails._.Init(callback);
  20 | }
  21 | 
  22 | module.exports = Init;

./src/index.tsx
src/vega/desktop-wallet/frontend/src/index.tsx:10

   7 | 
   8 | import * as Wails from '@wailsapp/runtime';
   9 | 
> 10 | Wails.Init(() => {
  11 |     ReactDOM.render(
  12 |         <React.StrictMode>
  13 |             <App/>

__webpack_require__
src/vega/desktop-wallet/frontend/webpack/bootstrap:766

  763 | };
  764 | 
  765 | // Execute the module function
> 766 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  767 | 
  768 | // Flag the module as loaded
  769 | module.l = true;

fn
src/vega/desktop-wallet/frontend/webpack/bootstrap:129

  126 |         );
  127 |         hotCurrentParents = [];
  128 |     }
> 129 |     return __webpack_require__(request);
      | ^  130 | };
  131 | var ObjectFactory = function ObjectFactory(name) {
  132 |     return {```
edd commented 3 years ago
  1. Definitely non-blocking but switching jshint for eslint would be good, but not essential

https://github.com/vegaprotocol/console/blob/develop/.eslintrc.js

edd commented 3 years ago
  1. as above, minor one: a .nvmrc and engine config would be useful, but not essential as it doesn't really enforce anything (just makes it more convenient). Suggesting this I've realised that the package.json engines variable is probably wrong (I don't think node 15 actually works...)

https://github.com/vegaprotocol/console/blob/develop/.nvmrc

https://github.com/vegaprotocol/console/blob/effdde848216ad423bd8aac32314eaab9ddc3a3d/package.json#L8-L10

edd commented 3 years ago

Number 1 stop me running it, but it looks like a skeleton that lines up with https://github.com/vegaprotocol/console / https://github.com/vegaprotocol/token-frontend well. I’ll leave it to @dexturr to review when he’s not so busy but I think instructions on running it locally are probably all that’s required. Thanks for getting it this far!

ValentinTrinque commented 3 years ago
  1. I will investigate this
  2. Ok for eslint
  3. .nvmrc is already done. Ok for engines, I'll look into this