Open lkraav opened 5 years ago
Some additional notes:
It would be good to not load functions that aren't actually going to be used. If the service provider for the view system, for example, was not booted, there'd be little point in including the related functions.
What I'd need to do here is to determine which functions files we can do this with. And, I need to make sure there's no back-compat issues. I don't think there should be any because all this code should be loaded before theme authors are actually attempting to use any of the functions. Basically, this should be a load-order check.
Another consideration might be if there are any components that have a dependency from other components. Most are self contained.
https://themehybrid.slack.com/archives/C8T1S6HDG/p1542551454417900
When I extend
Application
class and skip registeringView
provider because I want to replace it with my own, including all these functions depending onView
provider unconditionally will cause fatal PHP errors.https://github.com/justintadlock/hybrid-core/blob/master/src/bootstrap-functions.php is the problematic spot.
Not all of these functions fit into a service provider. Many are just free-floating functions. For those that require a service like the View-related functions, it might make sense to migrate.