Augmint / augmint-web

Augmint Web Frontend
http://www.augmint.org
GNU Affero General Public License v3.0
17 stars 8 forks source link

add augmint-js package and use augmint-cli #588

Closed szerintedmi closed 5 years ago

szerintedmi commented 5 years ago

Nature of the PR: chore

This is a (hopefully) non intrusive addition of augmint-js package. First step on a long journey. For now it only brings the benefit that you won't need to worry about upgrades of the ganache docker containers. Any time augmint-js upgraded (via greenkeeper PR) yarn ganache:start will start the right version of the ganache container, the right way, specified by augmint-js

Background

yarn ganache:start now calls new augmint cli ganache {start|stop} instead of specifying the whole launch command line (which included the the container version). augmint-cli is part of the augmint-js package.

Package size

augmint-js uses a different web3.js version now than augmint-web. It's doesn't affect the bundle size yet because there is no import of @augmint/js in the code yet. We will need to check the effect of this when we start to use it.

  611.92 KB        build/static/js/2.a87359b9.chunk.js
  147.96 KB        build/static/js/main.688cda06.chunk.js
  10.62 KB (+8 B)  build/static/css/main.ffc5d9ef.chunk.css
  763 B            build/static/js/runtime~main.d653cc00.js
szerintedmi commented 5 years ago

Deploy preview for augmint ready!

Built with commit 0495d9896361809aac996a12f52380ed9f802412

https://deploy-preview-588--augmint.netlify.com

szerintedmi commented 5 years ago

Would be nice to see an actual call being made from the JS code (a simple ping/hello world would suffice).

It's coming (i.e. FE could use matchMultipleOrders already) but it's a bit more complicated because web3 connection object differences :) Also it might have effect on the bundle size (see PR descr.) . Anyways I want to keep this PR quick and small to see how the release workflow works with augmint-contracts release coming very soon.

Also, what’s the developer UX for making changes in augmint-js and augmint-web at the same time (i.e. depending on an unreleased local version)?

yarn link in the augmint-js local repo and yarn link @augmint/js in the dependent package. if you want to go back to the published version then yarn unlink

phraktle commented 5 years ago

It's coming (i.e. FE could use matchMultipleOrders already) but it's a bit more complicated because web3 connection object differences :) Also it might have effect on the bundle size (see PR descr.) . Anyways I want to keep this PR quick and small to see how the release workflow works with augmint-contracts release coming very soon.

Ok, though I think making a call would be the actual end-to-end test of this integration :)

yarn link in the augmint-js local repo and yarn link @augmint/js in the dependent package. if you want to go back to the published version then yarn unlink

Might want to add this to developer docs.

szerintedmi commented 5 years ago

@phraktle : agree that calling is the ultimate end2end test but augmint-cli and the container release workflow test is the first test. step by step...

that yarn linking is only required to augmint-js devs so it should to the augmint-js docs. right?

phraktle commented 5 years ago

that yarn linking is only required to augmint-js devs so it should to the augmint-js docs. right?

either one is fine as long as a developer will find it when needed ;)