This is a description of a concept and is up for discussion. Please share you views, knowledge and comments on this topic
So, this other day I started looking at building a dashboard for a project. A local application that’s suppose to display on a monitor in a room showing widgets with data. I didn’t need any database stuff in my project as all would work with external apis. All I needed was
- A http stack
- Some caching (to save responses untill next refresh)
But when i install a clean version of Flow I get a lot of requirements installed that I would need and only slow down a process (imagine this in a larger scale app, that needed to download and deploy the same amount of packages). To show a example I did the following
soren@kevin > ~/Projects/flow-no-database > composer why zendframework/zend-eventmanager zendframework/zend-code 3.1.0 requires zendframework/zend-eventmanager (^2.6 || ^3.0) soren@kevin > ~/Projects/flow-no-database > composer why zendframework/zend-code ocramius/proxy-manager 2.0.4 requires zendframework/zend-code (3.0.0 - 3.0.2 || ^3.0.4) soren@kevin > ~/Projects/flow-no-database > composer why ocramius/proxy-manager doctrine/migrations v1.3.1 requires ocramius/proxy-manager (^1.0|^2.0) soren@kevin > ~/Projects/flow-no-database > composer why doctrine/migrations neos/flow-development-collection dev-master requires doctrine/migrations (~1.3.0)
What entities do we have in the core?
In the core we have the following enties, that requires the migrations and database related packages to be installed (please correct me if I’m wrong )
- Flow security account
- Routing ObjectPathMapping
- PersistentResource entity
Lately a lot of small utility packages have been created - could we do the same with these? My proposal is (And please comment and describe the blocking part of the different things)
Move the Security account to it’s own package
Create a package like
Neos.SecurityAccount or even
Neos.Security and move that part out there ?
Move the routing objectmapping to a cache
Could the object path mapping go to a cache instead of a entity? Perhaps introduce a Database cache backend if you are using databases anyway - otherwise use the file system or no cache at all?
Move the persistent resource to a own package
Yes, you guessed it. Move the whole ResourceManagement context of the Neos.Flow package to a own
What would we benefit
I did some testing using
composer why and what I seem to have come up to was that a “Flow Light” could come down to the following packages
doctrine/annotations v1.4.0 Docblock Annotations Parser doctrine/cache v1.6.1 Caching library offering an object-oriented API for many cache backends doctrine/collections v1.4.0 Collections Abstraction library doctrine/common 2.7.x-dev 562b53a Common Library for Doctrine projects neos/composer-plugin 2.0.1 Flow Composer Plugin paragonie/random_compat v2.0.10 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7 psr/log 1.0.2 Common interface for logging libraries ramsey/uuid 3.6.1 Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 universally un... symfony/console v2.8.19 Symfony Console Component symfony/debug v3.0.9 Symfony Debug Component symfony/dom-crawler v2.8.19 Symfony DomCrawler Component symfony/polyfill-mbstring v1.3.0 Symfony polyfill for the Mbstring extension symfony/yaml v2.8.19 Symfony Yaml Component typo3fluid/fluid 2.1.3 The TYPO3 Fluid template rendering engine
And the moving the FlowAnnotationDriver and the whole Persistence context into a own package, would also remove a requirement of the
doctrine/annotations package (as far as I can understand from the usage).
So, now it’s out. A few days of thinking… Please give your feedback. I’ll be happy if you took the time to response more than “+1”, “go go go” or “hey, are you mad?!”. Read it, suck it in and give it some thought and perhaps give a reponse next week.
I’m very well aware of this not being a “walk in the park” and “what about backward compatibility” - so this is a place for discussion, meaning sharing and your change to share your knowledge about Flow that could prevent this from happening or something that might make this “easier”.
I’m giving it a try in next week by moving the routing into a cache - wish me luck
Have a great weekend!