Syntax - Tasty Web Development Treats

882: Aaron Francis is putting PHP in Your JS Files

14 snips
Mar 5, 2025
Aaron Francis, a Laravel developer and co-founder of Try Hard Studios, dives into the innovative Fusion for Laravel—an exciting way to merge PHP with JavaScript. He discusses how Fusion enhances front-end interactions and simplifies full-stack development while addressing challenges like state management and data fetching. The conversation also explores optimistic UI for smoother user experiences and hints at future collaborations between PHP and JavaScript, particularly with React support. Plus, he shares amusing stories about domain name acquisitions!
Ask episode
AI Snips
Chapters
Transcript
Episode notes
INSIGHT

Invalidation and Caching

  • Fusion for Laravel handles invalidation by syncing state between the frontend and backend via post requests.
  • Caching can be done at the backend and state updates can be synced to the front end to react accordingly.
ADVICE

Implementing Optimistic UI

  • For optimistic UI updates with Fusion for Laravel, decorate actions by wrapping the provided function.
  • This lets you handle optimistic updates and revert changes if the server request fails.
ANECDOTE

React Integration

  • Fusion for Laravel will support React, with development already underway using tagged template literals for PHP blocks.
  • The React version will differ significantly from the Vue version due to JSX and the different component structure.
Get the Snipd Podcast app to discover more snips from this episode
Get the app