sonata-project / SonataEasyExtendsBundle

[deprecated] Prototype to easily share entities across Bundle and Application
https://sonata-project.org/
MIT License
168 stars 47 forks source link

[RFC] Improve namespace for flex #172

Closed Xymanek closed 4 years ago

Xymanek commented 6 years ago

The current generated namespace App\Application\Sonata\XyzBundle is very redundant and weird looking. A much more sensible namespace would be something like App\Sonata\XyzBundle.

Also (from what I was told on sf slack) it's completely fine to remap [project root]/src folder to another namespace. As such, it would be nice to support case when the "root" project namespace is something other than App and generate something like AcmeCorp\Shop\Sonata\XyzBundle (if the "root" namespace is AcmeCorp\Shop)

covex-nn commented 6 years ago

Applications with Flex are bundle-less. So everything starting from Application to the XyzBundle is redundant in App\Application\Sonata\XyzBundle

jordisala1991 commented 6 years ago

Also (from what I was told on sf slack) it's completely fine to remap [project root]/src folder to another namespace. As such, it would be nice to support case when the "root" project namespace is something other than App and generate something like AcmeCorp\Shop\Sonata\XyzBundle (if the "root" namespace is AcmeCorp\Shop)

This should be already doable using --namespace_prefix

Xymanek commented 6 years ago

This should be already doable using --namespace_prefix

I meant that if this is reworked

Xymanek commented 6 years ago

@covex-nn Is it possible to provide the functionality without using bundles?

covex-nn commented 6 years ago

I think yes, it is possible!

IMO recipes for NotificationBundle or PageBundle must contain everything we need to launch them out from the box without any additional manual configuration. Additional configuration could be done after installation just to tune up that bundles, of course.

Please, see example https://github.com/covex-nn/recipes-contrib/commit/2e5da5cbe9121d9f4d53190c8d6036c2b15a9b07 - this commit is my future proposal, a recipe for NotificationBundle. It contains bundle configuration, entity class and serializer metadata configuration.

@kunicmarko20 wrote me on slack, that i am forgetting the document and phpcr and the serialization config. Serializer metadata configuration is not loaded by default right now in Flex-applications, but i am working on it https://github.com/symfony/recipes-contrib/pull/293 =) And i hope that document and phpcr can be used without bundles too

Xymanek commented 6 years ago

Relevant discussion: https://github.com/sonata-project/dev-kit/issues/397

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.