-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
Make Cache dependency optional #1427
Conversation
@@ -58,7 +58,7 @@ class PageAdmin extends AbstractAdmin | |||
protected $siteManager; | |||
|
|||
/** | |||
* @var CacheManagerInterface | |||
* @var CacheManagerInterface|null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why it's possible to be null for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the plan is to remove it in next major version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then this bundle doesn't not require cache to works right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not anymore, that's why i moved it from require to require-dev for now
@@ -27,8 +27,6 @@ | |||
"doctrine/persistence": "^1.3.4 || ^2.0", | |||
"sonata-project/admin-bundle": "^3.91.1", | |||
"sonata-project/block-bundle": "^3.20", | |||
"sonata-project/cache": "^2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohh is it possible to remove cache and cache-bundle in 3.x
without any BC 😮
@Hanmac if it's not ready to review put as |
it should have been ready i think, just the lint stuff i couldn't get working in my IDE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this seems ok, the cache is used as soon as it's installed.
But since SonataCacheBundle is installed by blockBundle, it's always used.
So we need to add a config option to disable the cache, instead of relying on isset($bundles['SonataCacheBundle'])
. And we'll be able to add a deprecation is the cache is not disabled.
hmmm then in case this option is "true", we will throw a deprecation message and remove cache completely in the next major? |
Depends if the option is enableCache or disableCache, but yes that's the idea.
4.x we remove the cache feature. |
should cache still be removed from the required or not yet? |
Ohhh nice, then I guess we do not need to Touch in this composer depencies, only in 4.x |
I just took a look at blockBundle and The isset strategy could work then. WDYT @jordisala1991 |
But if we move the dependency from require to require-dev, it also need to be in the conflict section to restrict the range of the versions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mark something to removal on 4.x? We can make on another PR if needed.
The idea of moving this to optional dependencies is to remove it on NEXT_MAJOR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests need to be fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to add @group legacy
above the test
Issue1134Test::setUp from Sonata\PageBundle\Tests\Functional\Ticket
to avoid an error with the deprecation.
And we should also add a test with cache:false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal is to solve
Remaining self deprecation notices (1)
1x: Using SonataCacheBundle is deprecated since sonata-project/page-bundle 3.27 and will be removed in 4.x
1x in Issue1134Test::setUp from Sonata\PageBundle\Tests\Functional\Ticket
Maybe the group legacy should be added to the setUp of ResetableDBWebTestTest instead.
But you can also try to modify the test config
https://github.com/sonata-project/SonataPageBundle/blob/fed26c06856de8d6b1161d0f23001db7b8377e2b/tests/App/config/sonata.yaml
To add cache: false, instead.
You don't need anymore the |
Thanks |
Subject
Changelog