Open
Conversation
Nova apps can now declare their own nova_apps dependencies.
When compiling routes, Nova recursively resolves all nested
nova_apps depth-first so child app routes are registered
before the parent.
This allows library nova_apps like shigoto_board to declare
their dependencies (e.g. arizona_nova) so users only need:
{my_app, [{nova_apps, [shigoto_board]}]}
Instead of manually listing all transitive nova_apps.
Cycle detection prevents infinite loops if apps reference
each other.
burbas
requested changes
Mar 26, 2026
src/nova_sup.erl
Outdated
| App -> | ||
| ExtraApps = application:get_env(App, nova_apps, []), | ||
| nova_router:compile([nova|[App|ExtraApps]]) | ||
| AllApps = resolve_nova_apps(ExtraApps, []), |
Contributor
There was a problem hiding this comment.
You should probably call resolve_nova_apps([nova|[App|AllApps]]) instead so that you don't hit multiple occurrences of nova or App.
Collaborator
Author
There was a problem hiding this comment.
Good catch. I will look at it.
Route nova and the bootstrap app through resolve_nova_apps so the cycle detection prevents duplicates if nested apps also reference them.
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.
Summary
Nova apps can now declare their own
nova_appsdependencies. When compiling routes, Nova recursively resolves all nested nova_apps depth-first so child app routes are registered before the parent.Before
Users must manually list all transitive nova_apps:
{my_app, [{nova_apps, [arizona_nova, shigoto_board]}]}After
Library apps declare their own dependencies:
Users only list what they need:
{my_app, [{nova_apps, [shigoto_board]}]}Nova resolves:
shigoto_board → arizona_novaautomatically.Implementation
resolve_nova_apps/2tonova_sup.erlTest plan
rebar3 eunit— 347 tests passrebar3 xref— cleanrebar3 compile— clean