-
-
Notifications
You must be signed in to change notification settings - Fork 98
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: alternate syntax for the character /
in file systems
#532
Comments
Hi @vincent-hoodoo 👋 I'm definitely open to a proposal for an alternative syntax for conditionals. What are your thoughts on something like:
It would just be an alternative syntax to the existing:
We could also support
As an alternative syntax to:
The reason why I'd prefer not to do something like Let me know what you think and sorry for the inconvenience! |
Thank you for the response @felangel !
looks great. Just a few remarks:
A few other remarks not directly linked to this but related:
|
I just went through the closed issues and saw a comment about the backslash being interpreted the same way as the forward slash: #440 @felangel Is it a bug or is the backslash meant to be interpreted the same way as the forward slash? |
This is working as intended because mason supports windows, macos, and linux so the paths get normalized internally. |
This is great news! I noticed that it is represented as a single file at least:
Not sure how it's represented on Windows though... Should this then be the recommended way of templating conditional files? |
…#532) Bumps [eslint](https://github.com/eslint/eslint) from 8.33.0 to 8.34.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](eslint/eslint@v8.33.0...v8.34.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@felangel is there something blocking us from introducing the alternative syntax for conditionals? I liked your proposed solution introducing |
@felangel could you fix this, this is a big issue and could be fixed easely. thx |
What’s your proposed solution? I’m not sure we ever landed on an agreed upon solution. |
/
in file systems
I renamed the issue to better reflect that what we are discussing here are the problems that come from using the characters Could we identify a character that would be substituted with a slash? That way, we could (almost) keep adhering to the moustache syntax |
Just have a readable non IDE breaking convention I would go for:
or
|
The current syntax for conditional files and folders is functional, but generates a file system representation that is really hard to understand and maintain.
Example:
If I want a brick to generate an
android.dart
file only if the boolean parameterandroid
is true, I'm supposed to name a file{{#android}}android.dart{{/android}}
.This has the effect of generating a directory named
{{#android}}android.dart{{
that contains a file namedandroid}}
View in the MacOS finder:
View in VSCode
This split in a directory and a file doesn't match at all how we think about a single file.
Proposal
If another syntax for conditional files and folders was introduced, that doesn't include the character
/
, we could view them as regular files, which would match the mental model about them being a file.Dummy suggestions:
##
symbol for closing tags? like{{#android}}android.dart{{##android}}
{{#android}}android.dart{{^android}}
Migration path
If this new syntax was introduced, it could be distributed in a first step alongside the current syntax, but the current syntax would trigger a warning with a recommendation to migrate to the new syntax. Then after a few versions, the old syntax would go away.
The text was updated successfully, but these errors were encountered: