Skip to content
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

[Proposal] Lower the usage of macros #612

Open
yordis opened this issue Sep 10, 2023 · 2 comments
Open

[Proposal] Lower the usage of macros #612

yordis opened this issue Sep 10, 2023 · 2 comments

Comments

@yordis
Copy link
Member

yordis commented Sep 10, 2023

#367 (comment)
I would discourage usage of macros for DRY. It's better to use the Runtime middleware.

After many years of using Tesla, I came across too many situations that are much simpler to deal with using the Runtime middleware, slowing questioning the value of having macros.

@teamon I am not sure if you still feel strongly about having such a feature or if it would be something that maybe is worth deprecating/discouraging/removing in the future.

@yordis
Copy link
Member Author

yordis commented Sep 10, 2023

https://github.com/elixir-tesla/tesla/pull/575/files is an example where the macro style ends up wanting a Runtime Middleware style of execution (not quite, but similar)

So eventually, every middleware will end up having to support MFA, static values, and function pointers ... it is just a matter of somebody wanting to do it their style.

Versus Runtime Middleware removing all that complexity.

@teamon
Copy link
Member

teamon commented Sep 12, 2023

🎶 Hello macros my old friend 🎶

The first step would be to update the README and make the runtime middleware the default way, while keeping macros for backwards compatibility.

yordis added a commit that referenced this issue Oct 1, 2023
related to #612

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants