Closed webmaster128 closed 4 years ago
Decorators look pretty nice but are currently only a stage 2 proposal for JS and an experimental feature in TS.
Good table of tradeoffs here: https://github.com/protobufjs/protobuf.js/blob/7bacfc8/README.md#reflection-vs-static-code
Decorators look pretty nice but are currently only a stage 2 proposal for JS and an experimental feature in TS.
Could you check the browser support for them? The Angular framework uses them for many years now, starting from Angular 2, the first version that uses TypeScript released in 2016. Maybe there is a way to transpile them into older JavaScript?
Ah, the support is there for "Type-Script + core-js 3", which is the combination documented in the Angular browser support, where they use the term "ES2015 polyfill" for core-js 3.
I think it is feasable to require the combination Type-Script + core-js 3 when creating custom message types in the application. And for the types shipped with the library we don't use decorators.
Closed in #221
We want to support many different message type, some from the Cosmos SDK and some from custom blockchains that are not standardized. The user of CosmJS should have the most common message types ready to be used shipped with this library. But it should also be possible to add new message types from the caller code.
Some thoughts that might help getting there: