几天内即可获得 Laravel 代码审查方面的专家指导

Generate Livewire Skeleton Placeholders Automatically with Wirebones

最后更新于 经过

Generate Livewire Skeleton Placeholders Automatically with Wirebones image

Wirebones 经过 Felipe Martins loads your real page in headless Chromium, traces the rendered layout, and writes a matching skeleton Blade file that Livewire serves while the lazy component boots.

Wirebones-generated skeleton placeholder rendering on the sales
  dashboard demo before the real Livewire component loads
The Wirebones sales dashboard demo mid-load

Because the source of truth is the rendered component instead of a parallel template, redesigns don't silently rot the placeholder — you just rebuild. The author has a 现场演示 with Kanban, sales dashboard, and inbox examples — reload any of them to watch the bones flash before the real markup snaps in.

  • Capture from the real DOM — skeleton markup is generated from the rendered component, not hand-authored
  • Responsive output — capture multiple viewport breakpoints in one build
  • Vite auto-rebuild — file watcher rebuilds only affected skeletons during vite serve
  • Authenticated routes supported — Laravel guard auth, browser cookies, headers, or Playwright storage_state
  • Drop-in to Livewire — works with lazy , defer , 和 lazy.bundle
  • Laravel Boost skill included — AI agents using Boost pick up the conventions automatically

Marking a component is a single attribute pointing at a route where it's already rendered:

使用 Livewire\组件 ;
使用 MrFelipeMartins\Wirebones\Attributes\Wirebone ;
#[ Wirebone 路线 : '/仪表板' )]
班级 收入 延伸 成分
{
民众 功能 使成为 ()
{
返回 看法 'livewire.revenue' (英文):
}
}

Then lazy-mount it as usual and run php artisan wirebones:build :

< livewire:revenue 懒惰的 />

#[Wirebone] attribute also takes a few capture options — viewport widths to snapshot, how long to wait after page load, and selectors to ignore:

#[ Wirebone
路线 : '/仪表板' ,
breakpoints :[ 375 , 768 , 1280 ],
等待 : 800 ,
excludeSelectors :[ '[data-no-wirebone]' ],
)]

Chromium is only used at build time to generate the skeleton Blade files, not at runtime. Once wirebones:build writes the placeholders to disk, Livewire serves them like any other Blade view — your production servers don't need Playwright or Chromium installed.

You can find Wirebones on GitHub and the live demo at wirebones.laravel.cloud

保罗·雷德蒙德照片

Laravel News 特约撰稿人。全栈 Web 开发人员兼作家。

归档于:
立方体

Laravel 时事通讯

加入超过 4 万名开发者的行列,不错过任何新的技巧、教程等内容。

图像
了解软科技

以每小时 20 美元的价格聘请具备人工智能专业知识的 Laravel 开发人员。48 小时内即可开始工作。

访问 Acquaint Softtech
SaaSykit:Laravel SaaS 入门套件徽标

SaaSykit:Laravel SaaS 入门套件

SaaSykit 是一个多租户 Laravel SaaS 入门套件,包含运行现代 SaaS 所需的所有功能,例如支付、美观的结账界面、管理面板、用户仪表盘、身份验证、现成组件、统计数据、博客、文档等等。

SaaSykit:Laravel SaaS 入门套件
Lucky Media 标志

幸运传媒

Get Lucky Now——拥有十余年经验的 Laravel 开发理想之选!

幸运传媒
了解 Softtech 的标志

了解软科技

Acquaint Softtech 提供 AI 就绪的 Laravel 开发人员,48 小时内即可上手,每月费用为 3000 美元,没有冗长的销售流程,并提供 100% 退款保证。

了解软科技
PhpStorm 标志

PhpStorm

首选的 PHP IDE,对 Laravel 及其生态系统提供广泛的开箱即用支持。

PhpStorm
Shift 标志

转移

还在运行旧版本的 Laravel?立即实现 Laravel 自动升级和代码现代化,让您的应用程序保持最新状态。

转移
几天内即可获得 Laravel 代码审查徽标的专家指导

几天内即可获得 Laravel 代码审查方面的专家指导

专家级代码审查!两位拥有 10 年以上 Laravel 开发经验的开发者将为您提供清晰、实用的反馈,帮助团队构建更优质的应用程序。

几天内即可获得 Laravel 代码审查方面的专家指导
Laravel Cloud 标志

Laravel 云

轻松创建和管理服务器,并在几秒钟内部署 Laravel 应用程序。

Laravel 云
Kirschbaum 标志

樱桃树

提供创新和稳定性,确保您的Web应用程序取得成功。

樱桃树
Tinkerwell 徽标

廷克威尔

Laravel 开发者必备的代码运行器。可在本地和生产环境中体验 AI、自动补全和即时反馈功能。

廷克威尔
鱼叉:新一代时间跟踪和发票标志

Harpoon:新一代时间跟踪和发票系统

新一代时间跟踪和计费软件,帮助您的机构规划和预测盈利的未来。

Harpoon:新一代时间跟踪和发票系统
SerpApi logo

SerpApi

Access real-time search engine results through a simple API—no more scraping headaches! Use it for AI applications, SEO tools, product research, travel information, and more

SerpApi
Laravel ClickHouse: A Full-Featured ClickHouse Driver for Laravel image

Laravel ClickHouse: A Full-Featured ClickHouse Driver for Laravel

阅读文章
Laravel Installer Now Returns JSON When Running Inside an AI Agent image

Laravel Installer Now Returns JSON When Running Inside an AI Agent

阅读文章
Queue-Wide Inspection Methods in Laravel 13.8.0 image

Queue-Wide Inspection Methods in Laravel 13.8.0

阅读文章
Verifiable Audit Logging with Laravel Chronicle image

Verifiable Audit Logging with Laravel Chronicle

阅读文章
Ship AI with Laravel: Search Entire PDFs with Zero Search Logic image

Ship AI with Laravel: Search Entire PDFs with Zero Search Logic

阅读文章
Personalized Content Delivery System: Building an AI-powered recommendation engine with Laravel and MongoDB image

Personalized Content Delivery System: Building an AI-powered recommendation engine with Laravel and MongoDB

阅读文章