igniteui-cli 15.5.1 → 15.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/package.json +4 -4
  2. package/templates/blazor/igb/projects/ai-config/files/skills/AGENTS.md +6 -3
  3. package/templates/blazor/igb/projects/ai-config/files/skills/README.md +30 -45
  4. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/SKILL.md +48 -96
  5. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/charts.md +61 -238
  6. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/data-display.md +60 -193
  7. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/feedback.md +36 -92
  8. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/form-controls.md +66 -224
  9. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout-manager.md +39 -88
  10. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout.md +75 -152
  11. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/setup.md +40 -149
  12. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/SKILL.md +58 -243
  13. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/references/component-mapping.md +89 -280
  14. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/references/gotchas.md +143 -431
  15. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/SKILL.md +91 -157
  16. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/data-operations.md +50 -228
  17. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/editing.md +61 -222
  18. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/features.md +67 -360
  19. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/grid-migration.md +55 -236
  20. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/paging-remote.md +53 -202
  21. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/sizing.md +31 -232
  22. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/state.md +27 -119
  23. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/structure.md +88 -363
  24. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/types.md +87 -415
  25. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-lite-testing/SKILL.md +8 -4
  26. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-lite-testing/references/interop-contracts.md +42 -6
  27. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/SKILL.md +83 -211
  28. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/references/common-patterns.md +93 -184
  29. package/templates/react/igr-ts/avatar/default/files/src/app/__path__/__filePrefix__.tsx +3 -3
  30. package/templates/react/igr-ts/avatar/default/files/src/app/__path__/style.module.css +9 -0
  31. package/templates/react/igr-ts/button/default/files/src/app/__path__/__filePrefix__.tsx +1 -1
  32. package/templates/react/igr-ts/button/default/files/src/app/__path__/style.module.css +3 -0
  33. package/templates/react/igr-ts/icon/default/files/src/app/__path__/__filePrefix__.tsx +2 -2
  34. package/templates/react/igr-ts/icon/default/files/src/app/__path__/style.module.css +3 -0
  35. package/templates/react/igr-ts/icon-button/default/files/src/app/__path__/__filePrefix__.tsx +1 -1
  36. package/templates/react/igr-ts/icon-button/default/files/src/app/__path__/style.module.css +3 -0
  37. package/templates/react/igr-ts/pivot-grid/basic/files/src/app/__path__/__filePrefix__.tsx +3 -4
  38. package/templates/react/igr-ts/projects/_base/files/package.json +1 -0
  39. package/templates/react/igr-ts/projects/ai-config/files/skills/README.md +30 -83
  40. package/templates/react/igr-ts/projects/ai-config/files/skills/grid-lite-to-igr-grid-migration/SKILL.md +98 -191
  41. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/SKILL.md +38 -147
  42. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/COMPONENTS.md +65 -0
  43. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/DATAVIZ.md +90 -0
  44. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/MCP.md +43 -0
  45. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/TROUBLESHOOTING.md +17 -145
  46. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/USAGE.md +85 -0
  47. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/SKILL.md +83 -135
  48. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/CSS-THEMING.md +51 -218
  49. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/SKILL.md +58 -187
  50. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/reference/gotchas.md +55 -154
  51. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-optimize-bundle-size/SKILL.md +48 -401
  52. package/templates/webcomponents/igc-ts/avatar/default/files/src/app/__path__/__filePrefix__.ts +7 -2
  53. package/templates/webcomponents/igc-ts/button/default/files/src/app/__path__/__filePrefix__.ts +8 -3
  54. package/templates/webcomponents/igc-ts/card/default/files/src/app/__path__/__filePrefix__.ts +3 -1
  55. package/templates/webcomponents/igc-ts/constants.d.ts +5 -5
  56. package/templates/webcomponents/igc-ts/constants.js +5 -5
  57. package/templates/webcomponents/igc-ts/date-time-input/default/files/src/app/__path__/__filePrefix__.ts +8 -2
  58. package/templates/webcomponents/igc-ts/icon/default/files/src/app/__path__/__filePrefix__.ts +7 -3
  59. package/templates/webcomponents/igc-ts/icon-button/default/files/src/app/__path__/__filePrefix__.ts +8 -2
  60. package/templates/webcomponents/igc-ts/projects/_base/files/package.json +1 -1
  61. package/templates/webcomponents/igc-ts/projects/_base_with_home/files/package.json +6 -6
  62. package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/README.md +1 -0
  63. package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/login-bar/login-bar.ts +1 -1
  64. package/templates/webcomponents/igc-ts/tabs/default/files/src/app/__path__/__filePrefix__.ts +21 -15
  65. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/mcp-setup.md +0 -78
  66. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/mcp-setup.md +0 -78
  67. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/references/mcp-setup.md +0 -81
  68. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/CHARTS-GRIDS.md +0 -398
  69. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/COMPONENT-CATALOGUE.md +0 -161
  70. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/EVENT-HANDLING.md +0 -72
  71. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/INSTALLATION.md +0 -139
  72. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/JSX-PATTERNS.md +0 -187
  73. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/MCP-SERVER.md +0 -77
  74. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/REFS-FORMS.md +0 -232
  75. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/MCP-SERVER.md +0 -67
  76. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/TROUBLESHOOTING.md +0 -35
  77. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/reference/component-mapping.md +0 -132
  78. /package/templates/webcomponents/igc-ts/tabs/default/files/src/app/__path__/{__filePrefix__.test → __filePrefix__.test.ts} +0 -0
@@ -1,439 +1,86 @@
1
1
  ---
2
2
  name: igniteui-react-optimize-bundle-size
3
- description: This skill optimizes application bundle size when using Ignite UI for React and should be used when the bundle is too large, when setting up tree-shaking, or when lazy loading heavy components like grids and charts
3
+ description: Reduce bundle size in apps using Ignite UI for React — package selection, tree-shaking, and route-level code splitting of grids, charts, maps, and gauges. Use when the bundle or initial load is too large, when tree-shaking is not eliminating unused Ignite UI code, or when deciding what to lazy load.
4
4
  user-invocable: true
5
5
  ---
6
6
 
7
- # Optimize Bundle Size
7
+ # Optimizing Ignite UI for React Bundle Size
8
8
 
9
- 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.
9
+ Standard React techniques (`React.lazy` + `Suspense`, route splitting, minification, compression, bundle analyzers) apply unchanged. This skill covers only what is specific to Ignite UI.
10
10
 
11
- ## Example Usage
11
+ ## Where the weight is
12
12
 
13
- - "My bundle size is too large"
14
- - "How do I reduce the size of igniteui-react?"
15
- - "Import only the components I need"
16
- - "Tree-shake unused components"
17
- - "Optimize imports for production"
18
- - "How do I lazy load the data grid?"
13
+ `igniteui-react` is published with `"sideEffects": false` and per-component modules, so named imports tree-shake well — a handful of core components costs little. The heavy families are separate packages:
19
14
 
20
- ## Related Skills
21
-
22
- - [igniteui-react-components](../igniteui-react-components/SKILL.md) — Choose only the components you need and set up your React project
23
- - [igniteui-react-customize-theme](../igniteui-react-customize-theme/SKILL.md) — Theming after optimization
24
-
25
- ## When to Use
26
-
27
- - Application bundle size is too large
28
- - User wants to optimize for production
29
- - User is importing more components than needed
30
- - User asks about tree-shaking or optimization
31
- - User wants to improve load times
32
- - User wants to code-split heavy components like grids or charts
33
-
34
- ---
35
-
36
- ## Key Principles
37
-
38
- 1. **Install only the packages you need** — don't install `igniteui-react-grids` if you only use core UI components
39
- 2. **Use named imports** — enable tree-shaking by importing specific components
40
- 3. **Lazy load heavy components** — use `React.lazy` + `Suspense` for grids, charts, and other large components
41
- 4. **Analyze your bundle** — use tools to identify what's being included
42
-
43
- ---
44
-
45
- ## Granular Package Imports
46
-
47
- Only install the packages you actually use:
48
-
49
- | Package | Contains | Install only if you need… |
15
+ | Package | Weight | Notes |
50
16
  |---|---|---|
51
- | `igniteui-react` | Buttons, inputs, dialogs, calendars, lists, etc. | Core UI components |
52
- | `igniteui-react` + `igniteui-grid-lite` | Lightweight grid (`IgrGridLite` from `igniteui-react/grid-lite`) | Simple tabular data (MIT, requires both packages) |
53
- | `igniteui-react-grids` | DataGrid, TreeGrid, PivotGrid, HierarchicalGrid | Advanced data grids (commercial) |
54
- | `igniteui-react-charts` | Category, Pie, Financial, Scatter charts | Charts and data visualization (commercial) |
55
- | `igniteui-react-maps` | Geographic maps | Map visualizations (commercial) |
56
- | `igniteui-react-gauges` | Radial and linear gauges | Gauge indicators (commercial) |
57
-
58
- ```bash
59
- # Only install what you need:
60
- npm install igniteui-react # Core UI only
61
- npm install igniteui-react-grids # Only if you need advanced grids
62
- npm install igniteui-react-charts # Only if you need charts
63
- ```
64
-
65
- ---
66
-
67
- ## Import Strategies
68
-
69
- ### ❌ Bad: Wildcard / Barrel Imports
70
-
71
- ```tsx
72
- // DON'T DO THIS — imports everything from the package
73
- import * as IgniteUI from 'igniteui-react';
74
-
75
- function App() {
76
- return <IgniteUI.IgrButton>Click</IgniteUI.IgrButton>;
77
- }
78
- ```
79
-
80
- **Impact:** Tree-shaking cannot eliminate unused components.
81
-
82
- ### ✅ Good: Named Imports
83
-
84
- ```tsx
85
- // DO THIS — import only what you use
86
- import { IgrButton, IgrInput, IgrCard } from 'igniteui-react';
87
-
88
- function App() {
89
- return (
90
- <div>
91
- <IgrInput label="Name" />
92
- <IgrButton><span>Submit</span></IgrButton>
93
- <IgrCard>Content</IgrCard>
94
- </div>
95
- );
96
- }
97
- ```
98
-
99
- **Impact:** Bundle includes only the three components and their dependencies. Tree-shaking removes everything else.
100
-
101
- ---
102
-
103
- ## Lazy Loading with `React.lazy` + `Suspense`
17
+ | `igniteui-react` | light per component | core UI; tree-shakes cleanly |
18
+ | `igniteui-grid-lite` | small | MIT grid; far lighter than the premium grids |
19
+ | `igniteui-react-grids` | heavy | Data/Tree/Pivot/Hierarchical grid |
20
+ | `igniteui-react-charts` / `-maps` / `-gauges` | heavy | legacy DV packages, weaker tree-shaking |
104
21
 
105
- Code-split heavy components behind lazy imports to reduce initial bundle size.
22
+ Two conclusions: **install only the families you use**, and **split the heavy families out of the initial chunk**. Downgrading `IgrGrid` to `IgrGridLite` is often the single largest win when the app only displays flat, read-only data — check the feature list in [DATAVIZ.md](../igniteui-react-components/reference/DATAVIZ.md) first.
106
23
 
107
- ### Lazy Loading a Single Component
24
+ ## Import rules
108
25
 
109
26
  ```tsx
110
- import { lazy, Suspense, useState } from 'react';
111
-
112
- // Lazy load the dialog component
113
- const IgrDialog = lazy(() =>
114
- import('igniteui-react').then(module => ({ default: module.IgrDialog }))
115
- );
116
-
117
- function App() {
118
- const [showDialog, setShowDialog] = useState(false);
119
-
120
- return (
121
- <>
122
- <button onClick={() => setShowDialog(true)}>Open Dialog</button>
123
- {showDialog && (
124
- <Suspense fallback={<div>Loading...</div>}>
125
- <IgrDialog open title="Hello">
126
- <p>Lazy loaded dialog content</p>
127
- </IgrDialog>
128
- </Suspense>
129
- )}
130
- </>
131
- );
132
- }
27
+ import { IgrButton, IgrCard } from 'igniteui-react'; // ✅ tree-shakes
28
+ import * as IgniteUI from 'igniteui-react'; // ❌ defeats tree-shaking
29
+ import { IgcButtonComponent } from 'igniteui-webcomponents'; // ❌ bypasses the wrapper
133
30
  ```
134
31
 
135
- ### Lazy Loading a Heavy Page Component
136
-
137
- This is the recommended approach for code-splitting: wrap entire page components that use heavy Ignite UI components.
32
+ Never import from `igniteui-webcomponents` (or `igniteui-webcomponents-grids`) directly. It pulls a second copy of the element definitions alongside the wrappers and skips the auto-registration the wrapper performs.
138
33
 
139
- ```tsx
140
- // App.tsx
141
- import { BrowserRouter, Routes, Route } from 'react-router-dom';
142
- import { lazy, Suspense } from 'react';
34
+ ## Splitting the heavy families
143
35
 
144
- const HomePage = lazy(() => import('./pages/Home'));
145
- const DashboardPage = lazy(() => import('./pages/Dashboard'));
146
- const AnalyticsPage = lazy(() => import('./pages/Analytics'));
147
-
148
- function App() {
149
- return (
150
- <BrowserRouter>
151
- <Suspense fallback={<div>Loading...</div>}>
152
- <Routes>
153
- <Route path="/" element={<HomePage />} />
154
- <Route path="/dashboard" element={<DashboardPage />} />
155
- <Route path="/analytics" element={<AnalyticsPage />} />
156
- </Routes>
157
- </Suspense>
158
- </BrowserRouter>
159
- );
160
- }
161
- ```
36
+ Lazy-load at the **route or panel** boundary, not the component. `IgrGrid` and the DV charts are only worth splitting when the whole view that uses them is deferred.
162
37
 
163
38
  ```tsx
164
- // pages/Dashboard.tsx — only loaded when navigating to /dashboard
165
- import { IgrGrid, IgrColumn } from 'igniteui-react-grids';
166
- import 'igniteui-react-grids/grids/themes/light/bootstrap.css';
167
-
168
- export default function Dashboard() {
169
- return (
170
- <IgrGrid data={data} autoGenerate={false}>
171
- <IgrColumn field="name" header="Name" />
172
- <IgrColumn field="value" header="Value" />
173
- </IgrGrid>
174
- );
175
- }
39
+ const Dashboard = lazy(() => import('./pages/Dashboard')); // grid + its theme CSS
40
+ const Analytics = lazy(() => import('./pages/Analytics')); // charts + registration
176
41
  ```
177
42
 
178
- ```tsx
179
- // pages/Analytics.tsx — only loaded when navigating to /analytics
180
- import { IgrCategoryChart, IgrCategoryChartModule } from 'igniteui-react-charts';
181
-
182
- IgrCategoryChartModule.register();
43
+ Two Ignite-UI-specific details:
183
44
 
184
- export default function Analytics() {
185
- return <IgrCategoryChart dataSource={data} width="100%" height="500px" />;
186
- }
187
- ```
45
+ - **Keep the grid theme CSS import inside the lazy chunk** (`import 'igniteui-react-grids/grids/themes/light/bootstrap.css'` in `Dashboard.tsx`), so the grid stylesheet is not in the initial payload. The base theme CSS stays in the entry point — every page needs it.
46
+ - **Keep `.register()` calls inside the lazy chunk too.** Chart, gauge, and map modules must register at module scope of the file that uses them; hoisting the registration to the entry point pulls the whole DV package back into the initial bundle.
188
47
 
189
- **Result:** The grid and chart bundles are only downloaded when the user navigates to those routes.
48
+ For manual chunking, give each family its own chunk so a page needing charts does not download grids:
190
49
 
191
- ---
192
-
193
- ## Analyzing Your Bundle
194
-
195
- ### Using Vite's Rollup Visualizer
196
-
197
- ```bash
198
- npm install --save-dev rollup-plugin-visualizer
199
- ```
200
-
201
- ```typescript
50
+ ```ts
202
51
  // vite.config.ts
203
- import { defineConfig } from 'vite';
204
- import react from '@vitejs/plugin-react';
205
- import { visualizer } from 'rollup-plugin-visualizer';
206
-
207
- export default defineConfig({
208
- plugins: [
209
- react(),
210
- visualizer({
211
- open: true,
212
- gzipSize: true,
213
- brotliSize: true,
214
- })
215
- ]
216
- });
217
- ```
218
-
219
- ```bash
220
- npm run build
221
- # Opens stats.html automatically — inspect which igniteui-react modules are included
222
- ```
223
-
224
- ### Using Webpack Bundle Analyzer
225
-
226
- ```bash
227
- npm install --save-dev webpack-bundle-analyzer
228
- ```
229
-
230
- ```javascript
231
- // webpack.config.js (or CRA with react-app-rewired)
232
- const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
233
-
234
- module.exports = {
235
- plugins: [
236
- new BundleAnalyzerPlugin({
237
- analyzerMode: 'static',
238
- openAnalyzer: false,
239
- reportFilename: 'bundle-report.html'
240
- })
241
- ]
242
- };
243
- ```
244
-
245
- ### Using source-map-explorer
246
-
247
- ```bash
248
- npm install --save-dev source-map-explorer
249
- ```
250
-
251
- ```json
252
- {
253
- "scripts": {
254
- "analyze": "source-map-explorer 'dist/**/*.js'"
255
- }
256
- }
257
- ```
258
-
259
- ```bash
260
- npm run build
261
- npm run analyze
262
- ```
263
-
264
- **What 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.
265
-
266
- ---
267
-
268
- ## Audit Your Component Usage
269
-
270
- ### 1. Find What Components You're Actually Using
271
-
272
- ```bash
273
- # Search for Igr component usage in your source files
274
- grep -roh "Igr[A-Z][a-zA-Z]*" src/ --include="*.tsx" --include="*.ts" | sort | uniq
275
-
276
- # Example output:
277
- # IgrButton
278
- # IgrCard
279
- # IgrInput
280
- ```
281
-
282
- ### 2. Compare with Your Imports
283
-
284
- ```bash
285
- # Find all import statements from igniteui-react packages
286
- grep -r "from 'igniteui-react" src/ --include="*.tsx" --include="*.ts"
287
- ```
288
-
289
- ### 3. Remove Unused Imports
290
-
291
- ```tsx
292
- // Before: 5 components imported
293
- import { IgrButton, IgrInput, IgrCard, IgrSelect, IgrCombo } from 'igniteui-react';
294
-
295
- // After audit: only 3 are actually used in JSX
296
- import { IgrButton, IgrInput, IgrCard } from 'igniteui-react';
297
- ```
298
-
299
- ---
300
-
301
- ## Build Configuration Optimizations
302
-
303
- ### Vite Configuration
304
-
305
- ```typescript
306
- // vite.config.ts
307
- import { defineConfig } from 'vite';
308
- import react from '@vitejs/plugin-react';
309
-
310
- export default defineConfig({
311
- plugins: [react()],
312
- build: {
313
- minify: 'terser',
314
- terserOptions: {
315
- compress: {
316
- drop_console: true,
317
- drop_debugger: true
318
- }
319
- },
320
- rollupOptions: {
321
- output: {
322
- manualChunks: {
323
- 'igniteui-core': ['igniteui-react'],
324
- // Only include if you use these packages:
325
- // 'igniteui-grids': ['igniteui-react-grids'],
326
- // 'igniteui-charts': ['igniteui-react-charts'],
327
- }
328
- }
329
- },
330
- chunkSizeWarningLimit: 600,
331
- },
332
- optimizeDeps: {
333
- include: ['igniteui-react']
334
- }
335
- });
336
- ```
337
-
338
- ### Webpack Configuration
339
-
340
- ```javascript
341
- // webpack.config.js
342
- module.exports = {
343
- optimization: {
344
- splitChunks: {
345
- chunks: 'all',
346
- cacheGroups: {
347
- igniteui: {
348
- test: /[\\/]node_modules[\\/]igniteui-react[\\/]/,
349
- name: 'igniteui',
350
- priority: 20,
351
- },
352
- igniteuiGrids: {
353
- test: /[\\/]node_modules[\\/]igniteui-react-grids[\\/]/,
354
- name: 'igniteui-grids',
355
- priority: 20,
356
- }
357
- }
52
+ build: {
53
+ rollupOptions: {
54
+ output: {
55
+ manualChunks: {
56
+ 'ig-core': ['igniteui-react'],
57
+ 'ig-grids': ['igniteui-react-grids'], // only if actually installed
58
+ 'ig-charts': ['igniteui-react-charts'], // only if actually installed
59
+ },
358
60
  },
359
- minimize: true,
360
61
  },
361
- mode: 'production',
362
- };
363
- ```
364
-
365
- ---
366
-
367
- ## Best Practices Checklist
368
-
369
- - [ ] **Install only the packages you need** — don't install `igniteui-react-grids` if you only use buttons and inputs
370
- - [ ] **Use named imports** — `import { IgrButton } from 'igniteui-react'`, not `import * as`
371
- - [ ] **Don't import from `igniteui-webcomponents` directly** — use the `igniteui-react` wrappers
372
- - [ ] **Lazy load heavy components** — use `React.lazy` + `Suspense` for grids, charts, and dialogs
373
- - [ ] **Split by routes** — load component-heavy pages only when navigated to
374
- - [ ] **Audit your imports regularly** — remove unused components
375
- - [ ] **Analyze your bundle** — use bundle analyzer tools to verify tree-shaking is working
376
- - [ ] **Minify in production** — ensure build tool minification is enabled
377
- - [ ] **Use compression** — enable gzip/brotli on your server
378
-
379
- ---
380
-
381
- ## Common Issues & Solutions
382
-
383
- ### Issue: Bundle still large after using named imports
384
-
385
- **Investigate:**
386
- 1. Check if you're importing from `igniteui-webcomponents` instead of `igniteui-react`
387
- 2. Verify tree-shaking is working (check build output with a bundle analyzer)
388
- 3. Look for barrel imports (`import * as`)
389
- 4. Check if large packages like `igniteui-react-grids` are in the initial bundle instead of being lazy loaded
390
-
391
- ### Issue: Lazy loaded component flashes or shows fallback too long
392
-
393
- **Solution:** Preload the component on hover or route prefetch:
394
-
395
- ```tsx
396
- const DashboardPage = lazy(() => import('./pages/Dashboard'));
397
-
398
- // Preload on hover
399
- function NavLink() {
400
- const preload = () => { import('./pages/Dashboard'); };
401
- return <a href="/dashboard" onMouseEnter={preload}>Dashboard</a>;
402
62
  }
403
63
  ```
404
64
 
405
- ### Issue: Tree-shaking not working
406
-
407
- **Cause:** Using `require()` instead of `import`, or a build tool that doesn't support ES module tree-shaking.
408
-
409
- **Solution:** Ensure your project uses ES modules:
65
+ ## Auditing
410
66
 
411
- ```json
412
- // tsconfig.json
413
- {
414
- "compilerOptions": {
415
- "module": "esnext",
416
- "moduleResolution": "bundler"
417
- }
418
- }
67
+ ```bash
68
+ # components referenced in JSX
69
+ grep -rhoE "<Igr[A-Za-z]+" src --include="*.tsx" | sort -u
70
+ # what is imported
71
+ grep -rn "from 'igniteui-react" src --include="*.tsx" --include="*.ts"
419
72
  ```
420
73
 
421
- ---
422
-
423
- ## Expected Results
74
+ Then run any bundle analyzer and check the initial chunk for `igniteui-react-grids` / `-charts`. If either appears there while only used on secondary routes, the split is not working — usually a shared module (a barrel `index.ts`, a types file, or a hoisted `.register()` call) re-imports it eagerly.
424
75
 
425
- After optimization, you should see:
76
+ ## When tree-shaking still fails
426
77
 
427
- - **Initial load time reduced** by 40–60%
428
- - **Bundle size reduced** by 50–80% (compared to importing everything)
429
- - **Better Core Web Vitals** scores
430
- - **Faster time to interactive**
431
- - **Lower bandwidth usage** for users
78
+ 1. A wildcard or barrel import somewhere in `src`.
79
+ 2. A local barrel file re-exporting Ignite UI components — it creates one module that depends on everything.
80
+ 3. CommonJS output: set `"module": "esnext"` and `"moduleResolution": "bundler"` in `tsconfig.json`.
81
+ 4. Both `igniteui-react-grids` and `@infragistics/igniteui-react-grids` resolved at once — pick one scope.
432
82
 
433
- ## Additional Resources
83
+ ## Related skills
434
84
 
435
- - [Vite Build Optimizations](https://vitejs.dev/guide/build.html)
436
- - [React.lazy Documentation](https://react.dev/reference/react/lazy)
437
- - [Webpack Tree Shaking](https://webpack.js.org/guides/tree-shaking/)
438
- - [Web Performance Optimization](https://web.dev/fast/)
439
- - [Bundle Size Analysis Tools](https://bundlephobia.com/)
85
+ - [igniteui-react-components](../igniteui-react-components/SKILL.md) — package routing and what each family provides
86
+ - [grid-lite-to-igr-grid-migration](../grid-lite-to-igr-grid-migration/SKILL.md) — the reverse direction, when Grid Lite is not enough
@@ -1,4 +1,4 @@
1
- import { html, LitElement } from 'lit';
1
+ import { css, html, LitElement } from 'lit';
2
2
  import { customElement } from 'lit/decorators.js';
3
3
  import {
4
4
  defineComponents,
@@ -9,10 +9,15 @@ defineComponents(IgcAvatarComponent);
9
9
 
10
10
  @customElement('app-$(path)')
11
11
  export default class $(ClassName) extends LitElement {
12
+ static styles = css`
13
+ :host {
14
+ --ig-size: var(--ig-size-large);
15
+ }
16
+ `;
17
+
12
18
  render() {
13
19
  return html`
14
20
  <igc-avatar
15
- size="large"
16
21
  shape="circle"
17
22
  src="./src/assets/avatar1.jpg"
18
23
  alt="My avatar"
@@ -1,4 +1,4 @@
1
- import { html, LitElement } from 'lit';
1
+ import { css, html, LitElement } from 'lit';
2
2
  import { customElement } from 'lit/decorators.js';
3
3
  import {
4
4
  defineComponents,
@@ -9,10 +9,15 @@ defineComponents(IgcButtonComponent);
9
9
 
10
10
  @customElement('app-$(path)')
11
11
  export default class $(ClassName) extends LitElement {
12
+ static styles = css`
13
+ :host {
14
+ --ig-size: var(--ig-size-large);
15
+ }
16
+ `;
17
+
12
18
  render() {
13
19
  return html`
14
- <igc-button
15
- size='large'>
20
+ <igc-button>
16
21
  Large button
17
22
  </igc-button>
18
23
  `;
@@ -12,6 +12,9 @@ defineComponents(IgcCardComponent, IgcButtonComponent, IgcIconButtonComponent);
12
12
  @customElement('app-$(path)')
13
13
  export default class $(ClassName) extends LitElement {
14
14
  static styles = css`
15
+ igc-avatar {
16
+ --ig-size: var(--ig-size-small);
17
+ }
15
18
  igc-card {
16
19
  width: 400px;
17
20
  }
@@ -28,7 +31,6 @@ export default class $(ClassName) extends LitElement {
28
31
  <igc-card-header>
29
32
  <igc-avatar
30
33
  slot="thumbnail"
31
- size="small"
32
34
  shape="rounded"
33
35
  src="https://www.infragistics.com/angular-demos/assets/images/men/1.jpg"
34
36
  >
@@ -1,6 +1,6 @@
1
- export declare const IGNITEUI_WEBCOMPONENTS_CORE_PACKAGE = "igniteui-webcomponents-core@~7.0.0";
2
- export declare const IGNITEUI_WEBCOMPONENTS_CHARTS_PACKAGE = "igniteui-webcomponents-charts@~7.0.0";
3
- export declare const IGNITEUI_WEBCOMPONENTS_GAUGES_PACKAGE = "igniteui-webcomponents-gauges@~7.0.0";
1
+ export declare const IGNITEUI_WEBCOMPONENTS_CORE_PACKAGE = "igniteui-webcomponents-core@~7.1.0";
2
+ export declare const IGNITEUI_WEBCOMPONENTS_CHARTS_PACKAGE = "igniteui-webcomponents-charts@~7.1.0";
3
+ export declare const IGNITEUI_WEBCOMPONENTS_GAUGES_PACKAGE = "igniteui-webcomponents-gauges@~7.1.0";
4
4
  export declare const IGNITEUI_WEBCOMPONENTS_GRIDS_PACKAGE = "igniteui-webcomponents-grids@~7.2.1";
5
- export declare const IGNITEUI_WEBCOMPONENTS_INPUTS_PACKAGE = "igniteui-webcomponents-inputs@~7.0.0";
6
- export declare const IGNITEUI_WEBCOMPONENTS_LAYOUTS_PACKAGE = "igniteui-webcomponents-layouts@~7.0.0";
5
+ export declare const IGNITEUI_WEBCOMPONENTS_INPUTS_PACKAGE = "igniteui-webcomponents-inputs@~7.1.0";
6
+ export declare const IGNITEUI_WEBCOMPONENTS_LAYOUTS_PACKAGE = "igniteui-webcomponents-layouts@~7.1.0";
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IGNITEUI_WEBCOMPONENTS_LAYOUTS_PACKAGE = exports.IGNITEUI_WEBCOMPONENTS_INPUTS_PACKAGE = exports.IGNITEUI_WEBCOMPONENTS_GRIDS_PACKAGE = exports.IGNITEUI_WEBCOMPONENTS_GAUGES_PACKAGE = exports.IGNITEUI_WEBCOMPONENTS_CHARTS_PACKAGE = exports.IGNITEUI_WEBCOMPONENTS_CORE_PACKAGE = void 0;
4
- exports.IGNITEUI_WEBCOMPONENTS_CORE_PACKAGE = "igniteui-webcomponents-core@~7.0.0";
5
- exports.IGNITEUI_WEBCOMPONENTS_CHARTS_PACKAGE = "igniteui-webcomponents-charts@~7.0.0";
6
- exports.IGNITEUI_WEBCOMPONENTS_GAUGES_PACKAGE = "igniteui-webcomponents-gauges@~7.0.0";
4
+ exports.IGNITEUI_WEBCOMPONENTS_CORE_PACKAGE = "igniteui-webcomponents-core@~7.1.0";
5
+ exports.IGNITEUI_WEBCOMPONENTS_CHARTS_PACKAGE = "igniteui-webcomponents-charts@~7.1.0";
6
+ exports.IGNITEUI_WEBCOMPONENTS_GAUGES_PACKAGE = "igniteui-webcomponents-gauges@~7.1.0";
7
7
  exports.IGNITEUI_WEBCOMPONENTS_GRIDS_PACKAGE = "igniteui-webcomponents-grids@~7.2.1";
8
- exports.IGNITEUI_WEBCOMPONENTS_INPUTS_PACKAGE = "igniteui-webcomponents-inputs@~7.0.0";
9
- exports.IGNITEUI_WEBCOMPONENTS_LAYOUTS_PACKAGE = "igniteui-webcomponents-layouts@~7.0.0";
8
+ exports.IGNITEUI_WEBCOMPONENTS_INPUTS_PACKAGE = "igniteui-webcomponents-inputs@~7.1.0";
9
+ exports.IGNITEUI_WEBCOMPONENTS_LAYOUTS_PACKAGE = "igniteui-webcomponents-layouts@~7.1.0";
@@ -1,4 +1,4 @@
1
- import { html, LitElement } from 'lit';
1
+ import { css, html, LitElement } from 'lit';
2
2
  import { customElement, query } from 'lit/decorators.js';
3
3
  import {
4
4
  defineComponents,
@@ -13,6 +13,12 @@ registerIconFromText('clear', clearIcon, 'material');
13
13
 
14
14
  @customElement('app-$(path)')
15
15
  export default class $(ClassName) extends LitElement {
16
+ static styles = css`
17
+ igc-icon {
18
+ --ig-size: var(--ig-size-large);
19
+ }
20
+ `;
21
+
16
22
  @query('igc-date-time-input')
17
23
  _input!: Element
18
24
 
@@ -26,7 +32,7 @@ export default class $(ClassName) extends LitElement {
26
32
  .minValue=${new Date(2022, 6, 2, 7, 30, 0)}
27
33
  .maxValue=${new Date(2022, 6, 27, 7, 30, 0)}
28
34
  .spinDelta={date: 2, year: 10,}>
29
- <igc-icon name="clear" collection='material' size='large' slot="suffix" @click=${this.handleClear}></igc-icon>
35
+ <igc-icon name="clear" collection='material' slot="suffix" @click=${this.handleClear}></igc-icon>
30
36
  <span slot="helper-text">This is some helper text</span>
31
37
  </igc-date-time-input>
32
38
  `;
@@ -1,4 +1,4 @@
1
- import { html, LitElement } from 'lit';
1
+ import { css, html, LitElement } from 'lit';
2
2
  import { customElement } from 'lit/decorators.js';
3
3
  import {
4
4
  defineComponents,
@@ -21,6 +21,12 @@ registerIcon(
21
21
 
22
22
  @customElement('app-$(path)')
23
23
  export default class Icon extends LitElement {
24
+ static styles = css`
25
+ igc-icon {
26
+ --ig-size: var(--ig-size-large);
27
+ }
28
+ `;
29
+
24
30
  render() {
25
31
  return html`
26
32
  <div>
@@ -28,7 +34,6 @@ export default class Icon extends LitElement {
28
34
  <igc-icon
29
35
  name='search'
30
36
  collection='material'
31
- size='large'
32
37
  mirrored = false
33
38
  >
34
39
  </igc-icon>
@@ -38,7 +43,6 @@ export default class Icon extends LitElement {
38
43
  <igc-icon
39
44
  name='build'
40
45
  collection='material'
41
- size='large'
42
46
  mirrored = false
43
47
  >
44
48
  </igc-icon>
@@ -1,4 +1,4 @@
1
- import { html, LitElement } from 'lit';
1
+ import { css, html, LitElement } from 'lit';
2
2
  import { customElement } from 'lit/decorators.js';
3
3
  import {
4
4
  defineComponents,
@@ -18,9 +18,15 @@ registerIconFromText(
18
18
 
19
19
  @customElement('app-$(path)')
20
20
  export default class IconButton extends LitElement {
21
+ static styles = css`
22
+ igc-icon-button {
23
+ --ig-size: var(--ig-size-large);
24
+ }
25
+ `;
26
+
21
27
  render() {
22
28
  return html`
23
- <igc-icon-button name="thumb-up" collection="material" href="https://www.infragistics.com/support" variant="contained" size="large"></igc-icon-button>
29
+ <igc-icon-button name="thumb-up" collection="material" href="https://www.infragistics.com/support" variant="contained"></igc-icon-button>
24
30
  `;
25
31
  }
26
32
  }