[Blade] graceful failing of components #52372
Unanswered
marvinosswald
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Motivation
If i have a list of things to show on a page i don't want the entire list to fail just because one item doesn't work. I could solve this by using lazy livewire components or js rendered solutions, but think this would be nice to just have in blade as the added complexity of both other solutions isn't necessary at all.
Scenario:
I have a grid of cards being build like this:
now if one of these
x-card
components fails for any reason it's going to take down the entire site it is being rendered on with it.Idea:
Have a "graceful fail" mode for Blade, which would result in the one card not rendering but the rest untouched. The exception still should be logged and everything but i see no reason why it should fail the entire rendering process. I think logical boundaries to draw would be components and partials.
Details
Relevant code for gracefully failing Blade components:
framework/src/Illuminate/View/Concerns/ManagesComponents.php
Lines 86 to 108 in cfe5f84
Thinkable features for this:
Beta Was this translation helpful? Give feedback.
All reactions