Skip to content

refactor: move $globals.ENV to $globals.config #2534

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

Merged
merged 12 commits into from
Nov 4, 2024
Merged

Conversation

buchdag
Copy link
Member

@buchdag buchdag commented Nov 3, 2024

This PR create a corresponding entry in the $globals.config map for every $globals.ENV.* value that where previously accessed throughout the template, so those global values can be displayed by the debug endpoint from #2525.

The PR also try to cut down on some non idiomatic / hard to read stuff :

  • expressions like (foo (bar (buzz (qux "something")))) , replaced by qux "something" | buzz | bar | foo.
  • use of coalesce / or to get a default value to a possibly null or empty one (coalesce "nullable" "defaultValue"), replaced by "nullable" | default "defaultValue"

note: the boolean values in $globals.config that are used later in the template as a default global value to per-vhost one are currently strings rather than real booleans, and displayed as such in the debug endpoint. This is to avoid an additional if / else / end for each of those values when using them as fallback default.

@buchdag buchdag added the type/feat PR for a new feature label Nov 3, 2024
@buchdag buchdag self-assigned this Nov 3, 2024
@buchdag buchdag merged commit a79445f into main Nov 4, 2024
4 checks passed
@buchdag buchdag deleted the refactor-globals branch November 4, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feat PR for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant