Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Accept full and partial component paths in resolver #140
For components to be able to call other components (composeable components) they need to use a component path that includes
Consider the following component:
<div class="govuk-govspeak-html-publication"> <%= partial: 'govuk_component/govspeak', locals: govspeak_locals %> </div>
In this example, the application can make a request for the
When testing in static we don't use slimmer, so the test attempts to load
Changing the nested component to one that works with tests:
<div class="govuk-govspeak-html-publication"> <%= render file: 'govuk_component/govspeak.raw', locals: govspeak_locals %> </div>
This works locally, but when requested by an application through slimmer, slimmer would take
The simplest approach is to allow apps to request components using the complete template filename, the raw variant, or just its name. This avoids bespoke template resolver logic.
There is a longer term plan to move component loading to its own API, rather than riding on the Rails template resolver magic.