Skip to content

Fix custom namespaces#100

Merged
ganyicz merged 8 commits intomainfrom
filip/fix-custom-namespaces
Mar 5, 2026
Merged

Fix custom namespaces#100
ganyicz merged 8 commits intomainfrom
filip/fix-custom-namespaces

Conversation

@ganyicz
Copy link
Collaborator

@ganyicz ganyicz commented Mar 1, 2026

The scenario

Blaze doesn't recognize components registered via Blade::anonymousComponentNamespace:

Blade::anonymousComponentNamespace('components.admin', 'admin');
<x-admin::button />

The problem

BladeService::componentNameToPath only accounted for anonymousComponentPath registrations, not anonymousComponentNamespace.

The solution

Replaced the manual resolution logic with calls to Laravel's ComponentTagCompiler, which already handles both registration methods.

Relocated test fixtures from tests/fixtures/components/ to tests/fixtures/views/components/ so the view finder can resolve them when using anonymousComponentNamespace.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Benchmark Results

Attempt Blade Blaze Improvement
#1 246.90ms 14.88ms 94%
#2 246.00ms 14.70ms 94%
#3 244.35ms 14.79ms 93.9%
#4 245.85ms 14.67ms 94%
#5 245.95ms 14.68ms 94%
#6 245.31ms 14.84ms 94%
#7 246.51ms 14.70ms 94%
#8 245.54ms 14.79ms 94%
#9 245.33ms 14.76ms 94%
#10 245.60ms 14.77ms 94%
Snapshot 245.50ms 14.85ms 94%
Result 245.73ms (~) 14.77ms (~) 94% (~)

Median of 10 attempts, 5000 iterations x 10 rounds, 33.28s total

@ganyicz ganyicz marked this pull request as ready for review March 5, 2026 19:19
@ganyicz ganyicz merged commit dcb8d9c into main Mar 5, 2026
8 checks passed
@ganyicz ganyicz deleted the filip/fix-custom-namespaces branch March 5, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant