liveview-native / live_view_native_stylesheet

MIT License
9 stars 3 forks source link

Change stylesheet output to JSON #74

Open bcardarella opened 1 month ago

bcardarella commented 1 month ago

We currently emit Elixir but I believe for various reasons it will be better to emit JSON.

  1. JSON parsing is available in nearly every language so future clients won't have to implement a new parser, Elixir language parsing is not or has incomplete parsing
  2. JSON parsing is very fast in most languages
  3. We are already encoding some attribute values in JSON

I don't believe we need to change how we are currently constructing our AST, so we will keep that in Elixir format but before it writes to the stylesheet it will convert to JSON

bcardarella commented 1 month ago

The only type in Elixir that we are using that isn't supported by the :json lib is Tuple