laravel / folio

Page based routing for Laravel.
MIT License
568 stars 46 forks source link

Sane Errors #91

Closed inmanturbo closed 1 year ago

inmanturbo commented 1 year ago

The three main struggles with folio (and volt) are intellisense, static analysis and error reporting.

The first two depend on your dev environment, and ide's and lsp's are continuing to evolve to help with that.

Error reporting is still a problem though. Errors often aren't caught before the blade view is compiled, and errors aren't caught at "compile time" (I'm referring to the blade compiler here).

If the error occurs in the template, we often have no idea where in the template it occurred. I find myself struggling to get good reporting and spending a lot of time in tools like spatie/ray or just ddd()ing all the time to figure things out.

It's nice to have a quick feedback loop, but how can we improve the quality of the feedback? Are there some best practices that might be useful to have in the docs? Can we pass some kind of debug flags to the blade compiler from folio views, maybe send line numbers through for the @php code blocks?

PS: I know that a fair answer to this is: "If you want better stack trace and language support use a psr-4 controller instead of folio, and do exhaustive error checking before returning your view". I'm just shaking the tree here to see if anything good or helpful falls out.

nunomaduro commented 1 year ago

Thank you for creating this issue. I believe that the improvements to Folio's and Volt's IntelliSense and static analysis will simply come with time and usage. As these tools gain traction, the community will naturally improve this aspect.

Regarding error reporting, we are open to pull requests for it.