exrm - When to use compile-only dependencies in Elixir -
when appropriate specify dependency in deps
in mix.exs
, not runtime dependency in applications
?
i thought applications
actual applications need started before own application can started, run problem exrm
wasn't putting jazz
library (which think contains pure functions) release until included :jazz
in applications
.
an otp application more component - bunch of modules , functions may (but need not) run processes. if otp app doesn't start own supervision tree, called library application. either way, if use of libs functions @ runtime, need specify runtime dep.
in contrast, compile-time dependency ensures 3rd party code fetched , available locally (on dev/build machine). useful if 3rd party code magic outside of runtime. example own exactor or pure erlang meck mocking library. in first case exactor magic during compilation, while in second case need mocking library during tests.
Comments
Post a Comment