Drop redundant compile-time config validator - #149
Merged
Conversation
Global resource config keys are already read through Application.compile_env/2 inside the live_admin/2 router macro, which expands into the host application's router. Elixir therefore raises at the host's boot whenever one of these keys diverges between compile time and runtime, giving us the guarantee for free. The application-level boot check duplicated this behavior, and did so unreliably: it captured compile_env against LiveAdmin's own compilation rather than the host app's, so the values it compared were not the ones actually used. Remove it and lean on Elixir's built-in mismatch detection instead, and clarify the docs to say so.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes the application-level
validate_compile_time_config!/0boot check (and its test), and clarifies the config docs.Why
Global resource config keys are already read through
Application.compile_env/2inside thelive_admin/2router macro, which expands into the host application's router. Elixir therefore raises at the host's boot whenever one of these keys diverges between compile time and runtime — we get the guarantee for free.The application-level boot check duplicated this, and did so unreliably: it captured
compile_envagainst LiveAdmin's own compilation rather than the host app's, so the values it compared were not the ones actually used. This removes it and leans on Elixir's built-in mismatch detection instead.Verification
mix do compile --warnings-as-errors + test— clean compile, 45 tests, 0 failuresmix formatclean🤖 Generated with Claude Code