by mattste · 6y ago · 0 comments
Here are a few pain points I've ran into: 1. Typespecs leave something to be desired compared to other type systems 2. Maps vs structs and easily using one in place of the other
Things that my team would like to see: 1. Components in addition to templates as a first-class citizen in Phoenix. My team loves React because of the component model even though we hardly use an insane amount of interactivity.
Surface is a server-side rendering component library that allows developers to build rich interactive user-interfaces, writing minimal custom Javascript.
Features: * An HTML-centric templating language with built-in directives (:for, :if, ...) and syntactic sugar for attributes (inspired by Vue.js). * Components as modules - they can be stateless, stateful, renderless or compile-time. * Declarative properties - explicitly declare the inputs (properties and events) of each component. * Slots - placeholders declared by a component that you can fill up with custom content. * Contexts - allows a parent component to share data with its children without passing them as properties.. * Compile-time checking of components and their properties. * Integration with editor/tools for warnings/errors, syntax highlighting, jump-to-definition, auto-completion (soon!) and more.
And in general Erlang and Elixir have very little automatic type conversions, if any.
But maps and structs are interchangeable, I don't get why using one or the other would make your GenServer code any different. A struct is just a map with an additional field called "__struct__".