nmeri17 / suphle

Opinionated PHP framework for building performant, extensible, and testable web applications
http://angry-cray-9c191b.netlify.app/
MIT License
33 stars 0 forks source link

Decouple laravel framework into a separate package #48

Open nmeri17 opened 1 year ago

nmeri17 commented 1 year ago

The bridge component is currently bundled with the rest of the framework, because I incorrectly predicted its presence would fast track existing projects being upgraded to use suphle. That being far from reality, the component merely serves to bloat project size. Those dependencies are such a huge amount of code that will never be used

So I tried to extract this part into a separate package https://github.com/nmeri17/suphle/tree/master/src/Bridge/Laravel. Unfortunately, there seems to be more entanglement than would make that possible. Some contents of that directory, eg LaravelAppConcrete.php, used by the orm and artisan (for migrations), imports classes from illuminate foundation, support, and contract, which aren't distributed standalone.

Indeed, the only classes in that directory that strictly perform bridge tasks are config and routing. So if anyone can move everything else to another namespace (say, eloquentDependencies), and more importantly, import those dependencies without installing the entire laravel on suphle, that will be splendid. Move the contents of bridge/config and routing to a separate project, along with its tests and stub classes. That project can be called "Laravel-bridge"

Ideally, facade booting and executing service providers should be done optionally. But eloquent's migration, database etc is unable to function without the "migration" string binding the class. I couldn't build that class so I deferred it to their providers. If that step can be cut off, the method invoking provider booting (from the interface loader) can first confirm bridge mode is activated before calling it