-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] Add gleam support to Mix #14262
base: main
Are you sure you want to change the base?
Conversation
421dc7c
to
0afa895
Compare
@josevalim when working on this I was always thinking of |
It should be possible because we use heroicons, a regular JS package, as a dependency on Phoenix applications. So we could probably support a |
Hello! You shouldn't need to do anything special target-wise as Gleam performs dead code elimination for code that is for other targets.
I would not expect Mix to become a front-end build tool by adding Gleam support. I think the workflow should be the same as it is today etc, with the desired build tool (esbuild, webpack, Adding frontend dependencies to the BEAM application dependency tree would either be wasted work compiling and managing them, or the programmer would need to go through every dependency in the lock file and add configuration to their
There is no such config. A Gleam package doesn't have an explicit target, each function in the public API is available on Erlang, JavaScript, or both, and they get either compiled or eliminated as needed. Whether a package is for Erlang or JavaScript is typically a matter of how the dependant is using them, not a matter of the configuration of the dependency. There is a |
8c06e6e
to
b91ae71
Compare
- Add Mix.Gleam module - Add specific gleam binary version requirement - Rely on `gleam export package-info`
b91ae71
to
c181ecd
Compare
@@ -269,6 +269,15 @@ Enum.each(fixtures, fn fixture -> | |||
File.cp_r!(source, dest) | |||
end) | |||
|
|||
## Set up Gleam fixtures | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And we should probably skip gleam tests if gleam is not installed, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I guess I need to add gleam to CI (although I need to wait until my gleam PR is merged and released).
- shell_cmd! wasn't handling tuples - Fix documentation
This PR adds support for the gleam language.
gleam.toml
inpath
depsgleam
in deps loader.deps.compile
gleam
binary version (hardcoded to 1.9.0 for now, see below)gleam
binarymain
already but not yet released)Notes:
gleam
binary version requirements are handled automatically when executinggleam compile-package
.gleam export package-info
but I can't know the reason for a bad exit status (maybe the dep path was wrong and the command was run in a dir without agleam.toml
).