Skip to content

Respect blaze directive compile: false override#184

Merged
ganyicz merged 4 commits into
mainfrom
filip/compile-false-fix
Jun 8, 2026
Merged

Respect blaze directive compile: false override#184
ganyicz merged 4 commits into
mainfrom
filip/compile-false-fix

Conversation

@ganyicz

@ganyicz ganyicz commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

The scenario

A component with a blaze directive with compile: false will not override Blaze::optimize() config.

// app/Providers/AppServiceProvider.php

Blaze::optimize()->add(resource_path('views/components'));
<!-- resources/views/components/input.blade.php -->

@blaze(compile: false)

The above component will compile.

The problem

We are only checking if the @blaze directive is present to decide whether to compile a component.

The solution

Check for compile === false first.

Fixes #183

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Benchmark Result: Default

Attempt Blade Blaze Improvement
#1 356.25ms 16.00ms 95.5%
#2 357.10ms 15.88ms 95.6%
#3 350.32ms 15.63ms 95.5%
#4 348.19ms 15.71ms 95.5%
#5 352.56ms 15.91ms 95.5%
#6 351.95ms 16.09ms 95.4%
#7 357.37ms 16.22ms 95.5%
#8 349.60ms 16.17ms 95.4%
#9 354.57ms 15.69ms 95.6%
#10 354.11ms 16.02ms 95.5%
Snapshot 350.75ms 15.77ms 95.5%
Result 353.34ms (~) 15.96ms (~) 95.5% (~)

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

To run a specific benchmark, comment /benchmark <name> where name is one of: attributes, aware, class, default, forwarding, merge, named-slots, no-attributes, slot

@ganyicz ganyicz merged commit ac00b2b into main Jun 8, 2026
4 checks passed
@ganyicz ganyicz deleted the filip/compile-false-fix branch June 13, 2026 08:29
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.

@blaze(compile: false) Not Respected When Component Inside Optimized Directory

1 participant