igniteui-react-optimize-bundle-size — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited igniteui-react-optimize-bundle-size (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
This skill helps users minimize their React application's bundle size when using Ignite UI for React by importing only the components they need, leveraging tree-shaking, and applying lazy loading strategies.
igniteui-react-grids if you only use core UI componentsReact.lazy + Suspense for grids, charts, and other large componentsOnly install the packages you actually use:
| Package | Contains | Install only if you need… |
|---|---|---|
igniteui-react | Buttons, inputs, dialogs, calendars, lists, etc. | Core UI components |
igniteui-react + igniteui-grid-lite | Lightweight grid (IgrGridLite from igniteui-react/grid-lite) | Simple tabular data (MIT, requires both packages) |
igniteui-react-grids | DataGrid, TreeGrid, PivotGrid, HierarchicalGrid | Advanced data grids (commercial) |
igniteui-react-charts | Category, Pie, Financial, Scatter charts | Charts and data visualization (commercial) |
igniteui-react-maps | Geographic maps | Map visualizations (commercial) |
igniteui-react-gauges | Radial and linear gauges | Gauge indicators (commercial) |
# Only install what you need:
npm install igniteui-react # Core UI only
npm install igniteui-react-grids # Only if you need advanced grids
npm install igniteui-react-charts # Only if you need charts// DON'T DO THIS — imports everything from the package
import * as IgniteUI from 'igniteui-react';
function App() {
return <IgniteUI.IgrButton>Click</IgniteUI.IgrButton>;
}Impact: Tree-shaking cannot eliminate unused components.
// DO THIS — import only what you use
import { IgrButton, IgrInput, IgrCard } from 'igniteui-react';
function App() {
return (
<div>
<IgrInput label="Name" />
<IgrButton><span>Submit</span></IgrButton>
<IgrCard>Content</IgrCard>
</div>
);
}Impact: Bundle includes only the three components and their dependencies. Tree-shaking removes everything else.
React.lazy + SuspenseCode-split heavy components behind lazy imports to reduce initial bundle size.
import { lazy, Suspense, useState } from 'react';
// Lazy load the dialog component
const IgrDialog = lazy(() =>
import('igniteui-react').then(module => ({ default: module.IgrDialog }))
);
function App() {
const [showDialog, setShowDialog] = useState(false);
return (
<>
<button onClick={() => setShowDialog(true)}>Open Dialog</button>
{showDialog && (
<Suspense fallback={<div>Loading...</div>}>
<IgrDialog open title="Hello">
<p>Lazy loaded dialog content</p>
</IgrDialog>
</Suspense>
)}
</>
);
}This is the recommended approach for code-splitting: wrap entire page components that use heavy Ignite UI components.
// App.tsx
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import { lazy, Suspense } from 'react';
const HomePage = lazy(() => import('./pages/Home'));
const DashboardPage = lazy(() => import('./pages/Dashboard'));
const AnalyticsPage = lazy(() => import('./pages/Analytics'));
function App() {
return (
<BrowserRouter>
<Suspense fallback={<div>Loading...</div>}>
<Routes>
<Route path="/" element={<HomePage />} />
<Route path="/dashboard" element={<DashboardPage />} />
<Route path="/analytics" element={<AnalyticsPage />} />
</Routes>
</Suspense>
</BrowserRouter>
);
}// pages/Dashboard.tsx — only loaded when navigating to /dashboard
import { IgrGrid, IgrColumn } from 'igniteui-react-grids';
import 'igniteui-react-grids/grids/themes/light/bootstrap.css';
export default function Dashboard() {
return (
<IgrGrid data={data} autoGenerate={false}>
<IgrColumn field="name" header="Name" />
<IgrColumn field="value" header="Value" />
</IgrGrid>
);
}// pages/Analytics.tsx — only loaded when navigating to /analytics
import { IgrCategoryChart, IgrCategoryChartModule } from 'igniteui-react-charts';
IgrCategoryChartModule.register();
export default function Analytics() {
return <IgrCategoryChart dataSource={data} width="100%" height="500px" />;
}Result: The grid and chart bundles are only downloaded when the user navigates to those routes.
npm install --save-dev rollup-plugin-visualizer// vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { visualizer } from 'rollup-plugin-visualizer';
export default defineConfig({
plugins: [
react(),
visualizer({
open: true,
gzipSize: true,
brotliSize: true,
})
]
});npm run build
# Opens stats.html automatically — inspect which igniteui-react modules are includednpm install --save-dev webpack-bundle-analyzer// webpack.config.js (or CRA with react-app-rewired)
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
module.exports = {
plugins: [
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false,
reportFilename: 'bundle-report.html'
})
]
};npm install --save-dev source-map-explorer{
"scripts": {
"analyze": "source-map-explorer 'dist/**/*.js'"
}
}npm run build
npm run analyzeWhat to look for: Check if igniteui-react-grids or igniteui-react-charts appear in the initial bundle even though they're only used on specific routes.
# Search for Igr component usage in your source files
grep -roh "Igr[A-Z][a-zA-Z]*" src/ --include="*.tsx" --include="*.ts" | sort | uniq
# Example output:
# IgrButton
# IgrCard
# IgrInput# Find all import statements from igniteui-react packages
grep -r "from 'igniteui-react" src/ --include="*.tsx" --include="*.ts"// Before: 5 components imported
import { IgrButton, IgrInput, IgrCard, IgrSelect, IgrCombo } from 'igniteui-react';
// After audit: only 3 are actually used in JSX
import { IgrButton, IgrInput, IgrCard } from 'igniteui-react';// vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
build: {
minify: 'terser',
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true
}
},
rollupOptions: {
output: {
manualChunks: {
'igniteui-core': ['igniteui-react'],
// Only include if you use these packages:
// 'igniteui-grids': ['igniteui-react-grids'],
// 'igniteui-charts': ['igniteui-react-charts'],
}
}
},
chunkSizeWarningLimit: 600,
},
optimizeDeps: {
include: ['igniteui-react']
}
});// webpack.config.js
module.exports = {
optimization: {
splitChunks: {
chunks: 'all',
cacheGroups: {
igniteui: {
test: /[\\/]node_modules[\\/]igniteui-react[\\/]/,
name: 'igniteui',
priority: 20,
},
igniteuiGrids: {
test: /[\\/]node_modules[\\/]igniteui-react-grids[\\/]/,
name: 'igniteui-grids',
priority: 20,
}
}
},
minimize: true,
},
mode: 'production',
};igniteui-react-grids if you only use buttons and inputsimport { IgrButton } from 'igniteui-react', not import * asigniteui-react wrappersReact.lazy + Suspense for grids, charts, and dialogsInvestigate:
igniteui-webcomponents instead of igniteui-reactimport * as)igniteui-react-grids are in the initial bundle instead of being lazy loadedSolution: Preload the component on hover or route prefetch:
const DashboardPage = lazy(() => import('./pages/Dashboard'));
// Preload on hover
function NavLink() {
const preload = () => { import('./pages/Dashboard'); };
return <a href="/dashboard" onMouseEnter={preload}>Dashboard</a>;
}Cause: Using require() instead of import, or a build tool that doesn't support ES module tree-shaking.
Solution: Ensure your project uses ES modules:
// tsconfig.json
{
"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler"
}
}After optimization, you should see:
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.