asuh / forage

Forage is a WordPress Starter Theme for custom themes using Laravel Blade, Vite, and Biome.
GNU General Public License v3.0
5 stars 1 forks source link

Plain PHP version? #8

Open asuh opened 4 months ago

asuh commented 4 months ago

Blade has some notable features that help PHP developers move faster. Here are a few reasons to keep using it:

(quickly generated by ChatGPT, with edits and additions by me)

I attempted to order the above in the order of importance, with the top few being quite more efficient than plain PHP.


My overall observation is that Blade should truly be considered if you can think of good use cases for adding components rendered by PHP. At some point, it might be less useful as Web Components find their way into the WordPress ecosystem.

Additionally, the auto-escape and inheritance for Blade is pretty great for efficiency. The benefits of these features are quite convenient.

The rest are just nice little sprinkles to clean up PHP. Nice, but not necessary.

If I review everything I've used with Blade, I really don't think I have any real needs yet for PHP driven components. All the rest of the bullet points could easily have been regular PHP in my own personal work flow, but I'm really only using themes on smaller sites that don't have a lot of complexity.

If Blade is removed from any project, you likely have the option to completely remove a dependency on Composer as well as some application methods to render the Blade syntax into PHP. I can also see this argument for those who prefer to stay as close to the original languages as possible.

At some point in the near future, decisions to support Laravel Blade might come down to whether or not you want a build step to compile a language. There's a potential future approaching where the browser contains so much power that build steps can once again become optional. That's a very interesting future!

With all of this said, if we remove Blade, we can further reduce the overhead and abstraction of this theme by removing Composer and some of the App logic. This provides a quick set up for someone wanting to just work with the basics.

Reproduced at https://asuh.local/laravel-blade-php/