Closed jyecusch closed 5 months ago
For javascript/ts using a more modular approach would improve tree-shaking, reducing the size of our bundles. Example of this being used: https://firebase.google.com/docs/web/modular-upgrade
Not saying we do this, just something to think about.
An early decision when creating Nitric was to use functions, rather than constructors, to create resources. One of the reasons for this decision was the challenge creating fluent interfaces off constructors in some languages (e.g.
new Topic("test").for("publishing")
) isn't always possible.In hindsight, the avoidance of constructors made resource creation somewhat less intuitive. Let's explore these tradeoffs in more detail.