ElixirScript - converts Elixir to JavaScript

I wanted to offer some feedback:

I am glad you have been working on compiling Elixir to JS. But what I’d really like to see is a ReactJS-like experience on the frontend. What I mean by that is:

  • keep the modules structure of Elixir, where anything in the project can be accessed without needing to know the specific file path or explicitly export anything

  • keep the ability for Elixir syntax to be transpiled to JavaScript

  • otherwise, remove the quirks and follow the structure of React

I’ll elaborate on the third point.

My main beef with JavaScript is the syntax includes meaningless, “boilerplate” characters. Conversely, I really like JSX. While it’s already too late and doesn’t mean much coming from a stranger, I think you went in the wrong direction with a DSL different from JSX.

I wish I could write a file like this:

# App.ex

defmodule ProjectName.App do
  use React # EX
  import ReactNativeWeb
  alias ProjectName.ErrorBoundary

  def mount,
    do: IO.inspect "Mounted!"

  def render(props, state) do
    <ErrorBoundary>
      <Text elixir={
        if Platform.OS == "web", do: "web", else: "screen"
      }/>
    </ErrorBoundary>
  end
end

This would render the text web on your computer or screen on your phone.