Skip to content

Commit 0284c0a

Browse files
weaverryansmnandre
andcommitted
Add new TwigComponent namespaces & auto-naming rules
``` twig_component: anonymous_template_directory: 'components/' defaults: # Namespace & directory for components App\Twig\Components: 'components/' ``` Co-authored-by: Simon André <[email protected]>
1 parent d244c0c commit 0284c0a

File tree

21 files changed

+1555
-638
lines changed

21 files changed

+1555
-638
lines changed

src/LiveComponent/tests/Fixtures/Kernel.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ protected function configureContainer(ContainerConfigurator $c): void
114114
'default_path' => '%kernel.project_dir%/tests/Fixtures/templates',
115115
]);
116116

117+
$c->extension('twig_component', [
118+
'defaults' => [
119+
'Symfony\UX\LiveComponent\Tests\Fixtures\Component\\' => 'components/',
120+
],
121+
'anonymous_template_directory' => 'components/',
122+
]);
123+
117124
$c->extension('zenstruck_foundry', [
118125
'auto_refresh_proxies' => false,
119126
]);

src/StimulusBundle/src/DependencyInjection/StimulusExtension.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ public function load(array $configs, ContainerBuilder $container): void
3232
$loader = new Loader\PhpFileLoader($container, new FileLocator(__DIR__.'/../../config'));
3333
$loader->load('services.php');
3434

35-
$configuration = $this->getConfiguration($configs, $container);
36-
$config = $this->processConfiguration($configuration, $configs);
35+
$config = $this->processConfiguration($this, $configs);
3736

3837
$container->findDefinition('stimulus.asset_mapper.controllers_map_generator')
3938
->replaceArgument(2, $config['controller_paths'])
@@ -64,11 +63,6 @@ public function prepend(ContainerBuilder $container)
6463
]);
6564
}
6665

67-
public function getConfiguration(array $config, ContainerBuilder $container): ConfigurationInterface
68-
{
69-
return $this;
70-
}
71-
7266
public function getConfigTreeBuilder(): TreeBuilder
7367
{
7468
$treeBuilder = new TreeBuilder('stimulus');

src/TwigComponent/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## 2.13.0
44

5+
- Deprecate calling `ComponentTemplateFinder` constructor without `directory` argument.
56
- Add profiler integration: `TwigComponentDataCollector` and debug toolbar templates
7+
- Add search feature in `debug:twig-component` command.
68

79
## 2.12.0
810

0 commit comments

Comments
 (0)