feat(candid): better UI for composite types#374
Conversation
Co-Authored-By: Hans <hans.larsen@dfinity.org>
|
Minor UX issue: |
| })().catch(err => { | ||
| left.className += ' error'; | ||
| left.innerText = err.name + ': ' + err.message; | ||
| left.innerText = err.stack; |
There was a problem hiding this comment.
there is no err body here?
There was a problem hiding this comment.
stack includes everything. The error message and the call stack.
src/userlib/js/src/index.ts
Outdated
|
|
||
| import * as IDL from './idl'; | ||
| export { IDL }; | ||
| import * as UI from './idl-ui'; |
There was a problem hiding this comment.
This will break Node and TypeScript.
| border: 1px solid #E5E5E5; | ||
| color: #545454; | ||
| font-family: sans-serif; | ||
| font-family: monospace; |
There was a problem hiding this comment.
no idea about this whole css section from me.
cc @hansl if you can take a look.
| public visitType<T>(t: Type<T>, data: D): R { | ||
| throw new Error('Not implemented'); | ||
| } | ||
| public visitPrimitive<T>(t: PrimitiveType<T>, data: D): R { |
There was a problem hiding this comment.
this seems a bit too manual? Any way to generate?
There was a problem hiding this comment.
The hard work is done here. You don't need to implement all the visit functions, e.g. you can implement only the visitPrimitive function, because all the primitive types call visitPrimitive by default. See example from idl-ui.ts.
|
LGTM, we can get this in the release. You tested it manually? |
|
Yep, works locally. |
## Changelog for common: Branch: master Commits: [dfinity-lab/common@a1a1d2ad...43c86c9f](https://github.com/dfinity-lab/common/compare/a1a1d2adcecd48b98a220d968ea8d477e242d01d...43c86c9f80a82577da4c35bf7c1ece491d71016d) * [`43c86c9f`](https://github.com/dfinity-lab/common/commit/43c86c9f80a82577da4c35bf7c1ece491d71016d) darwin: Only build required jobs ([dfinity-lab/common#374](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/common/issues/374))
## Changelog for common: Branch: master Commits: [dfinity-lab/common@a1a1d2ad...43c86c9f](https://github.com/dfinity-lab/common/compare/a1a1d2adcecd48b98a220d968ea8d477e242d01d...43c86c9f80a82577da4c35bf7c1ece491d71016d) * [`43c86c9f`](https://github.com/dfinity-lab/common/commit/43c86c9f80a82577da4c35bf7c1ece491d71016d) darwin: Only build required jobs ([dfinity-lab/common#374](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/common/issues/374))
## Changelog for common: Branch: master Commits: [dfinity-lab/common@43c86c9f...22ad8d18](https://github.com/dfinity-lab/common/compare/43c86c9f80a82577da4c35bf7c1ece491d71016d...22ad8d18f6b20cedf6b4501754c151c7c7bc1bae) * [`6242df59`](https://github.com/dfinity-lab/common/commit/6242df59f04fa680cc3627d5653bc6d20a03444d) [VER-612] Do not patch libunwind, as it makes _Unwind_RaiseException unsafe to call ([dfinity-lab/common#376](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/common/issues/376)) * [`9a6ce05f`](https://github.com/dfinity-lab/common/commit/9a6ce05fb33bacb8f9c278e6b4dbea26137d1f4f) Take LLVM 9 out of tree ([dfinity-lab/common#378](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/common/issues/378)) * [`22ad8d18`](https://github.com/dfinity-lab/common/commit/22ad8d18f6b20cedf6b4501754c151c7c7bc1bae) Revert "darwin: Only build required jobs ([dfinity-lab/common#374](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/common/issues/374))" ([dfinity-lab/common#379](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/common/issues/379))
## Changelog for common: Branch: master Commits: [dfinity-lab/common@43c86c9f...22ad8d18](https://github.com/dfinity-lab/common/compare/43c86c9f80a82577da4c35bf7c1ece491d71016d...22ad8d18f6b20cedf6b4501754c151c7c7bc1bae) * [`6242df59`](https://github.com/dfinity-lab/common/commit/6242df59f04fa680cc3627d5653bc6d20a03444d) [VER-612] Do not patch libunwind, as it makes _Unwind_RaiseException unsafe to call ([dfinity-lab/common#376](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/common/issues/376)) * [`9a6ce05f`](https://github.com/dfinity-lab/common/commit/9a6ce05fb33bacb8f9c278e6b4dbea26137d1f4f) Take LLVM 9 out of tree ([dfinity-lab/common#378](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/common/issues/378)) * [`22ad8d18`](https://github.com/dfinity-lab/common/commit/22ad8d18f6b20cedf6b4501754c151c7c7bc1bae) Revert "darwin: Only build required jobs ([dfinity-lab/common#374](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/common/issues/374))" ([dfinity-lab/common#379](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/common/issues/379))
It looks like this:
