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

Conditional styled feature flags #9

Open
Rasmus-Bertell opened this issue Jun 18, 2020 · 1 comment
Open

Conditional styled feature flags #9

Rasmus-Bertell opened this issue Jun 18, 2020 · 1 comment

Comments

@Rasmus-Bertell
Copy link

In my opinion feature flags, styled as conditional statements, would be an improvement. It would allow you to have mutually exclusive lines and cleaner syntax. This would be a breaking change for the earlier implementation of feature flags, but it would make them easier to read without prior knowledge of the correct syntax. Of course, it would be possible to keep the old behavior, but that would make the code more convoluted.

For example, taking the code from the readme:

This line will always be included
### IF FEATURE1
This line will only be included when FEATURE1 is enabled.
### ELSE
This line will be included otherwise.
### END FEATURE1
This line will always be included.

I would be happy to make an effort on implementing this, but I would like to hear your thoughts first.
This could also be expanded to feature logical operators AND, OR, and XOR, but I think those are out of scope for this issue.

@kesslern
Copy link
Owner

kesslern commented Jun 18, 2020

As long as existing templates don't break, I think this would be a great feature.

If it's not too convoluted to keep the old behavior that'd be good... I'm not sure how bad that would be. Maybe use something like ###~ for feature flags with logical operators? I'd like to avoid having breaking changes to dotfiles if at all possible.

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