Skip to content
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

Components registry safe reload #5780

Merged
merged 1 commit into from
Jun 12, 2024

Commits on Jun 12, 2024

  1. Allow safe reloads of the component registry

    This adds a new `ComponentRegistry` class that allows:
    - setting component classes as strings (to allow for easy reloading)
    - getting nice errors when requesting components that don't exist
    - getting nice errors when setting a component to a non-existing class
    
    It also moves some of the logic from `SolidusAdmin::Configuration` into
    a separate class.
    
    I've decided not to add memoization here as I'm not sure this would make
    a giant difference performance-wise, and also the Rails Guide on
    Reloading constants very clearly says:
    
    ```
    Bottom line: do not cache reloadable classes or modules.
    ```
    mamhoff committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    0408942 View commit details
    Browse the repository at this point in the history