Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[AssetMapper] Allow DirectoryResource for cache #50749

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

Merged
merged 1 commit into from
Jun 24, 2023

Conversation

weaverryan
Copy link
Member

Q A
Branch? 6.3
Bug fix? (needed for a bug fix)
New feature? yes/no
Deprecations? no
Tickets None
License MIT
Doc PR Not needed

Hi!

In StimulusBundle, one file is dynamically generated to contain the list of custom Stimulus controllers. This means the file's contents need to be regenerated in the dev environment whenever a new file is added to that directory. This PR allows the fileDependencies to also be a directory so that we can use a DirectoryResource.

This may not quite fit technically as a bug fix. However, as the component is experimental, this affects the dev environment only and it will allow for a pretty critical bug fix in StimulusBundle, I've characterized it as a bug fix for 6.3.

Thanks!

@@ -103,6 +104,7 @@ public function testAssetConfigCacheResourceContainsDependencies()

// just adding any file as an example
$mappedAsset->addFileDependency(__DIR__.'/../fixtures/importmap.php');
$mappedAsset->addFileDependency(__DIR__.'/../fixtures/dir3');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have a addDirectoryDependency instead to make the intent more clear ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps - though I'm also trying to keep the patch on the smaller side.

We could merge this as-is, then think about a more generic method name like addPathDependency() for 6.4.

@fabpot fabpot force-pushed the asset-mapper-directory-resource branch from eb79228 to d2d1476 Compare June 24, 2023 06:20
@fabpot
Copy link
Member

fabpot commented Jun 24, 2023

Thank you @weaverryan.

@fabpot fabpot merged commit 35675ee into symfony:6.3 Jun 24, 2023
@weaverryan weaverryan deleted the asset-mapper-directory-resource branch June 25, 2023 15:46
@fabpot fabpot mentioned this pull request Jun 26, 2023
weaverryan added a commit to symfony/ux that referenced this pull request Jun 26, 2023
…e not seen due to cache (weaverryan)

This PR was merged into the 2.x branch.

Discussion
----------

[StimulusBundle] Fixing bug where new custom controllers were not seen due to cache

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| Tickets       | Fix #961
| License       | MIT

This requires symfony/symfony#50749

Cheers!

Commits
-------

4503e3d [StimulusBundle] Fixing bug where new custom controlles were not seen due to cache
symfony-splitter pushed a commit to symfony/stimulus-bundle that referenced this pull request Jun 26, 2023
…e not seen due to cache (weaverryan)

This PR was merged into the 2.x branch.

Discussion
----------

[StimulusBundle] Fixing bug where new custom controllers were not seen due to cache

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| Tickets       | Fix #961
| License       | MIT

This requires symfony/symfony#50749

Cheers!

Commits
-------

4503e3de [StimulusBundle] Fixing bug where new custom controlles were not seen due to cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants