8000 [StimulusBundle] Fixing bug where new custom controllers were not seen due to cache by weaverryan · Pull Request #964 · symfony/ux · GitHub
[go: up one dir, main page]

Skip to content

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

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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public function getControllersJsonPath(): string
return $this->controllersJsonPath;
}

public function getControllerPaths(): array
{
return $this->controllerPaths;
}

/**
* @return array<string, MappedControllerAsset>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ public function compile(string $content, MappedAsset $asset, AssetMapperInterfac
$eagerControllerParts = [];
$lazyControllers = [];
$loaderPublicPath = $asset->publicPathWithoutDigest;

// add file dependencies so the cache rebuilds
$asset->addFileDependency($this->controllersMapGenerator->getControllersJsonPath());
foreach ($this->controllersMapGenerator->getControllerPaths() as $controllerDir) {
$asset->addFileDependency($controllerDir);
}

foreach ($this->controllersMapGenerator->getControllersMap() as $name => $mappedControllerAsset) {
$controllerPublicPath = $mappedControllerAsset->asset->publicPathWithoutDigest;
$relativeImportPath = $this->createRelativePath($loaderPublicPath, $controllerPublicPath);
Expand Down
0