Using/Teaching zone.exo instead of Far --wip--#89
Conversation
dckc
left a comment
There was a problem hiding this comment.
baggage is the 3rd arg of start. Let's go ahead and do it that way. I think it simplifies things considerably.
I'm not confident that mixing u16 and u12 dependencies is reliable.
| "@agoric/ertp": "^0.16.3-u12.0", | ||
| "@agoric/vat-data": "0.5.3-u16.1", | ||
| "@agoric/zoe": "^0.26.3-u12.0", | ||
| "@agoric/zone": "^0.3.0-u16.1", |
There was a problem hiding this comment.
What impact does this have on the contract bundle size? Does it introduce duplicate dependencies?
Other dependencies in this dapp (zoe, ertp) look like they're from u12. IME, mixing u12 and u16 is asking for trouble.
I know dapp-agoric-basics uses u14: Agoric/dapp-agoric-basics@817bc8a
Are you familiar with the fragility of dependency versions?
- bundle contains duplicated modules based on duplicated packages in node_modules agoric-sdk#8621
- fix: contract bundles have duplicate dependencies #34
- Test that compressed contract bundles are less than 1MB #36
- cannot publish inter protocol bundles over 1M due to max_tx_bytes tendermint config agoric-sdk#7501
It looks like @Jovonni managed to use u16 in dapp-orchestration-basics, though it took some troubleshooting. See item 9 in particular.
|
I gather recent symptoms include a problem when starting the ui: a blank page and a console error: |
zone.exo instead of Farzone.exo instead of Far --wip--
eb2d98b to
b5d3dea
Compare
| const publicFacet = Far('Items Public Facet', { | ||
| // Use zone.exo to make a publicFacet suitable for use by remote callers. | ||
| const publicFacet = zone.exo('Items Public Facet', undefined, { | ||
| makeTradeInvitation, |
There was a problem hiding this comment.
I suggest inlining makeTradeInvitation here.
- That's the more usual idiom.
- I think exo methods have to use concise method syntax.
There was a problem hiding this comment.
I think exo methods have to use concise method syntax.
"have to" is a bit too strong, but is directionally right. And exo singleton such as this one does not need to refer to this. Therefore, arrow functions happen to work. But they are not idiomatic and should not be. Methods of exo classes and exo class kits generally do need to refer to their this, and so must use concise method syntax. Also, methods in JavaScript class syntax are necessarily in concise method syntax. So for uniformity, I strongly recommend that even for exo singletons, methods use only concise method syntax.
1bc346c to
1be91de
Compare
| * Make an invitation to trade for items. | ||
| * | ||
| * Proposal Keywords used in offers using these invitations: | ||
| * - give: `Price` | ||
| * - want: `Items` |
There was a problem hiding this comment.
any particular reason to drop this bit of documentation?
There was a problem hiding this comment.
hmm, don't remember removing them at all, will put them back.
Also, currently there are a lot of type errors in the CI which is bothering me a bit. Let me know if you can find time to help there.
Co-authored-by: Dan Connolly <connolly@agoric.com>
Co-authored-by: Dan Connolly <connolly@agoric.com>
Co-authored-by: Dan Connolly <connolly@agoric.com>
Co-authored-by: Dan Connolly <connolly@agoric.com>
Co-authored-by: Dan Connolly <connolly@agoric.com>
e67fe75 to
79f9868
Compare
This adds code to contract file (and related deps to package.json) to use
zone.exoto replaceFar. Note that this is only for teaching purpose at the moment and does not make resulting contract upgradable becausezoneandbaggageare created insidestartfunction. The upgradability will require changingstartsignature which I am avoiding at the moment.Ref(s):
Agoric/documentation#1033