sasajuric
Author of Elixir In Action
I’d like to announce a small library called boundaries.
This is an experimental project which explores the idea of enforcing boundaries in Elixir projects without requiring the extra ceremony of umbrella apps. You can find a brief explanation on the library repo, while a more detailed doc is available here.
Note that this library is still in an exploratory phase, and I haven’t really tried it out myself yet. At this point I’m opening it primarily to collect the community feedback.
Trending in Announcing
Hey everyone!
Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application.
This library uses Erlang esaml to provide
plug enabl...
New
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi all!
I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas.
You...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
It’s not that it’s vocabulary is too advanced. It’s something worse.
I get lost trying to follow even a paragraph written by Claude. It’...
New
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New
Introductory paragraph
I’ll be looking for a keen junior or someone that has a couple of years experience in the real world (so you’ve be...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #blog-post
- #ai
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
tcoopman
This looks very nice! I hope to find some time to play with it soon.
One question I had while reading. I was wondering what the reason is that the root module is always exported?
LostKobrakai
This is exactly how I imagine boundries to be reasonably enforced and it’s even part of elixir LS.
sasajuric
There are two reasons. One is mechanical, another conceptual.
The mechanical is that allowing root export to be configurable makes configuration a bit more messy. For example, let’s say we want to export
MySystemandMySystem.User. There are two options:Here, we require that the exported modules are referenced with the full name which makes the configuration more noisy. It can become a significant problem if we’re dealing with 2nd (or 3rd, or 4th, …) level boundaries (which is an addition I’m definitely considering).
Another option is to introduce some sort of special atom such as
:this, or:root:which looks a bit ugly/hacky to me.
The conceptual problem is that I’m somewhat skeptical that exporting e.g.
MySystem.User, while keepingMySysteminternal is a good code organization. If you want to have some internal helper functions, I think that using e.g.MySystem.Helpersor some such is a better approach. To be clear, I definitely don’t wantboundariesto be highly opinionated and rigid, but given the mechanical issues presented earlier, and this conceptual problem, I currently opted to always export the root module.In any case, none of the current choices is set in stone, so this decision is definitely up for discussion (in which case perhaps a GH issue would be a better place).
tcoopman
I was just wondering about the the reasons. Both reasons look valid.
Elixir LS has support for boundaries? Where can I read about that?
LostKobrakai
Look at the github readme.
sasajuric
I think that what @LostKobrakai tries to say is that boundaries integrates with ElixirLS, because it’s a mix compiler, and ElixirLS can work with mix. This is mentioned in the boundaries readme near the end:
tcoopman
Ah, now I get it. Thanks. I completely misinterpreted that.
axelson
First off this is a VERY interesting project! It’s really neat to be able to define enforced boundaries in such a succinct way. A tool like this could help an Elixir project stay in one application for much longer before feeling a need to move to an umbrella or poncho style with multiple applications.
I agree that it makes sense to export the root module by default. But in order to have a flexible tool it would be nice to optionally not export a root module. Perhaps a syntax like this could work:
{MySystem, exports: [MySystem.User], export_root: false}blatyo
Looking at this on my phone, but I didn’t see it mentioned anywhere how this interacts with the standard library and packages. Do they also need to be defined as boundaries? Also, I suspect this wouldn’t catch modules passes as variables? Would it notice you reference a module to store it into a variable?
gshaw
This is a great project. I ran it against a small app I’ve been working on and found a couple of useful violations. Definitely think something like this has legs.
If others run into a bug when reporting on
.eexfiles I posted a fix in GitHub.https://github.com/sasa1977/boundaries/issues/1