承接 webhubworks/inertia-props-stats 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

webhubworks/inertia-props-stats

Composer 安装命令:

composer require webhubworks/inertia-props-stats

包简介

Measures the size of InertiaJS props and provides statistics about them.

README 文档

README

A Laravel package that measures the size of InertiaJS props and provides statistics about them. This tool helps you monitor and optimize your Inertia payloads during development.

What it does

This package:

  • Measures payload size: Automatically calculates the total size of your Inertia props in KB
  • Warns about large payloads: Displays console warnings and an expandable stats panel when props exceed the configured threshold
  • Detects duplicate keys: Identifies when the same key is used in both shared and page props
  • Development-only: Only collects stats in non-production environments to avoid unnecessary overhead
  • Configurable exceptions: Control when exceptions are thrown for duplicate keys or size violations
  • Flare integration: Optionally reports large payloads to Spatie Flare for monitoring
  • Ray integration: Sends payload statistics to Ray for debugging

The package provides detailed statistics including:

  • Total payload size (shared + page props)
  • Component-specific props size
  • Configured threshold
  • Amount exceeded (if applicable)
  • Duplicate keys between shared and page props

Installation

Install the package via Composer:

composer require webhubworks/inertia-props-stats

Publish the configuration file (optional):

php artisan vendor:publish --tag="inertia-props-stats-config"

This will create a config/inertia-props-stats.php file where you can customize:

return [
    'enabled' => env('INERTIA_PAYLOAD_SIZE_MEASUREMENT_ENABLED', true),

    'payload_size' => [
        'threshold_in_kb' => (int) env('INERTIA_PAYLOAD_SIZE_THRESHOLD_IN_KB', 500),
    ],

    'throw_exception' => [
        'on_duplicate_keys' => env('INERTIA_PROPS_THROW_EXCEPTION_ON_DUPLICATE_KEYS', true),
        'when_component_props_size_exceed_total_props_size' => env('INERTIA_PROPS_THROW_WHEN_COMPONENT_PROPS_EXCEED_TOTAL_PROPS_SIZE', true),
    ],
];

Configuration options:

  • enabled: Enable/disable stats collection globally (disabled in production by default)
  • payload_size.threshold_in_kb: Size threshold in KB before warnings are shown
  • throw_exception.on_duplicate_keys: Throw an exception when duplicate keys are detected in shared and page props
  • throw_exception.when_component_props_size_exceed_total_props_size: Throw an exception when component props exceed total props size

Recommended thresholds:

  • Soft limit: 100-200KB
  • Hard limit: 500KB

Vue.js Component

An example Vue.js component is included in resources/js/components/InertiaPropsStatsPanel.vue that you can copy and paste into your main app.

This component:

  • Monitors the _inertiaPayloadTotalSizeInKb prop
  • Displays an expandable stats panel when the payload exceeds the threshold
  • Shows detailed payload statistics including size, threshold, and duplicate keys
  • Provides a cleaner UI for development environments with more detailed error messages

To use it, copy the component to your Vue.js application and include it in your main layout:

<script setup>
import InertiaPropsStatsPanel from '@/components/InertiaPropsStatsPanel.vue'
</script>

<template>
  <div>
    <InertiaPropsStatsPanel />
    <!-- Your app content -->
  </div>
</template>

Note: The component requires lucide-vue-next for icons. Install it with:

npm install lucide-vue-next

License

The MIT License (MIT). Please see the license file for more information.

webhubworks/inertia-props-stats 适用场景与选型建议

webhubworks/inertia-props-stats 是一款 基于 Vue 开发的 Composer 扩展包,目前已累计 357 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「inertia」 「inertiajs」 「Webhub」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 webhubworks/inertia-props-stats 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 webhubworks/inertia-props-stats 我们能提供哪些服务?
定制开发 / 二次开发

基于 webhubworks/inertia-props-stats 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 357
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 29
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-10