All Projects β†’ praveenperera β†’ gleam_compile

praveenperera / gleam_compile

Licence: Apache-2.0 license
Tiny hex package to make the development experience of using gleam in elixir (and especially phoenix projects) better.

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to gleam compile

Alpine Phoenix Builder
Up to date Alpine image with the latest language versions for staged Elixir and Phoenix builds.
Stars: ✭ 71 (+144.83%)
Mutual labels:  hex, phoenix
Phoenix gon
πŸ”₯ Phoenix variables in your JavaScript without headache.
Stars: ✭ 84 (+189.66%)
Mutual labels:  hex, phoenix
ecto profiler
Project for Ecto DB profiling
Stars: ✭ 16 (-44.83%)
Mutual labels:  hex, phoenix
buffertools-php
Toolbox for working with binary and hex data. Similar to NodeJS Buffer.
Stars: ✭ 60 (+106.9%)
Mutual labels:  hex
hexagonTab
Hexagon bookmarks accented with a chosen colour. Customise the layout, style, background and bookmarks with hexagonTab.
Stars: ✭ 65 (+124.14%)
Mutual labels:  hex
phoenix bootstrap form
Bootstrap 4 Forms for Phoenix/Elixir Applications
Stars: ✭ 38 (+31.03%)
Mutual labels:  phoenix
reason-phoenix
ReasonML/ReScript bindings for the Phoenix javascript library
Stars: ✭ 14 (-51.72%)
Mutual labels:  phoenix
ColorMinePortable
ColorMinePortable
Stars: ✭ 37 (+27.59%)
Mutual labels:  hex
restyskeleton
Spawning barebones openresty applications from the terminal using ancient witchcraft
Stars: ✭ 21 (-27.59%)
Mutual labels:  autoreload
reload
Simple managed reload mechanism for Go
Stars: ✭ 18 (-37.93%)
Mutual labels:  autoreload
phoenix example
An example Phoenix app with one-click deployments to different cloud services.
Stars: ✭ 62 (+113.79%)
Mutual labels:  phoenix
colorsys
🎨 Minimalistic color converter for RGB, HSV, HSL, CMYK, HEX and CSS strings
Stars: ✭ 53 (+82.76%)
Mutual labels:  hex
agala
Full featured messaging bot framework.
Stars: ✭ 70 (+141.38%)
Mutual labels:  hex
ueberauth discord
Discord OAuth2 Strategy for Überauth.
Stars: ✭ 12 (-58.62%)
Mutual labels:  phoenix
ticker-phoenix
Elixir Phoenix Stock Quotes API (IEX Trading)
Stars: ✭ 15 (-48.28%)
Mutual labels:  phoenix
gleam-mode
πŸ™ Gleam support for Emacs
Stars: ✭ 30 (+3.45%)
Mutual labels:  gleam
bird watch
Blog post demo application
Stars: ✭ 15 (-48.28%)
Mutual labels:  phoenix
ex sieve
Implement dynamic filtering and sorting API for Ecto queries
Stars: ✭ 37 (+27.59%)
Mutual labels:  phoenix
graphmath
An Elixir library for performing 2D and 3D mathematics.
Stars: ✭ 72 (+148.28%)
Mutual labels:  hex
color
A library of well-tested helper methods for working with colors.
Stars: ✭ 13 (-55.17%)
Mutual labels:  hex

GleamCompile

Elixir + Gleam = ❀️

Hex.pm Hex.pm Hex.pm HexDocs.pm


Description

A tiny hex package makes it easier to use gleam in elixir and phoenix projects

This package does two things

  1. Runs the gleam compiler
  2. In development it automatically reloads the gleam files when recompiled

Demo with Phoenix Live Reload

Explainer

Installation

Note: Make sure gleam is already installed on your system.

This package is available on hex.

  1. The package can be installed by adding gleam_compile to your list of dependencies in mix.exs:

    def deps do
      [
        {:gleam_compile, "~> 0.2.0"}
      ]
    end
  2. Add :gleam to list of compilers, and the gleam folders to the erlc_paths in your mix.exs

    def project do
      [
       app: :jib,
       version: "0.1.0",
       elixir: "~> 1.5",
       elixirc_paths: elixirc_paths(Mix.env()),
    +  erlc_paths: ["src", "gen"],
    +  compilers: [:gleam] ++ Mix.compilers(),
       start_permanent: Mix.env() == :prod,
       releases: releases(),
       aliases: aliases(),
       deps: deps()
      ]
    end

Integrating with Phoenix Live Reloader

  1. Add :gleam to list of compilers in your mix.exs

    compilers: [:phoenix, :gettext, :gleam] ++ Mix.compilers()
      def project do
     [
       app: :jib,
       version: "0.1.0",
       elixir: "~> 1.5",
       elixirc_paths: elixirc_paths(Mix.env()),
       erlc_paths: ["src", "gen"],
    -  compilers: [:phoenix, :gettext] ++ Mix.compilers(),
    +  compilers: [:phoenix, :gettext, :gleam] ++ Mix.compilers(),
       start_permanent: Mix.env() == :prod,
       releases: releases(),
       aliases: aliases(),
       deps: deps()
     ]
    end
  2. In dev.exs add this line in the Endpoint config

    reloadable_compilers: [:gettext, :phoenix, :elixir, :gleam],
    config :my_app, MyAppWeb.Endpoint,
      http: [port: 4000],
      debug_errors: true,
      code_reloader: true,
      check_origin: false,
    + reloadable_compilers: [:gettext, :phoenix, :elixir, :gleam],
      watchers: [
        node: [
          "node_modules/webpack/bin/webpack.js",
          "--mode",
          "development",
          "--watch-stdin",
          cd: Path.expand("../assets", __DIR__)
        ]
      ]
  3. Add gleam files to the live_reload patterns

    ~r"src/.*(gleam)$",
    config :my_app, MyAppWeb.Endpoint,
      live_reload: [
        patterns: [
          ~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
          ~r"priv/gettext/.*(po)$",
    +     ~r"src/.*(gleam)$",
          ~r"lib/jib_web/{live,views}/.*(ex)$",
          ~r"lib/jib_web/templates/.*(eex)$"
        ]
      ]

Acknowledgements

License

GleamCompile is released under the Apache License 2.0 - see the LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].