@@ -11,22 +11,29 @@ export function initMigrationGuide() {
1111 if ( ! migrationContainer ) return ;
1212
1313 migrationContainer . innerHTML = `
14- <div class="migration-nav">
15- <button class="migration-nav-btn active" data-section="overview">Overview</button>
16- <button class="migration-nav-btn" data-section="mapping">Function Mapping</button>
17- <button class="migration-nav-btn" data-section="steps">Migration Steps</button>
18- </div>
14+ <div class="bundle-size-container">
15+ <h2>Migration Guide</h2>
16+ <p class="intro">
17+ Migrate from lodash or underscore to nano-string-utils and reduce your bundle size by up to 88% while maintaining functionality.
18+ </p>
19+
20+ <div class="migration-nav">
21+ <button class="migration-nav-btn active" data-section="overview">Overview</button>
22+ <button class="migration-nav-btn" data-section="mapping">Function Mapping</button>
23+ <button class="migration-nav-btn" data-section="steps">Migration Steps</button>
24+ </div>
1925
20- <div class="migration-content">
21- <section id="overview" class="migration-panel active">
22- ${ renderOverview ( ) }
23- </section>
24- <section id="mapping" class="migration-panel">
25- ${ renderMappingTable ( ) }
26- </section>
27- <section id="steps" class="migration-panel">
28- ${ renderMigrationSteps ( ) }
29- </section>
26+ <div class="migration-content">
27+ <section id="overview" class="migration-panel active">
28+ ${ renderOverview ( ) }
29+ </section>
30+ <section id="mapping" class="migration-panel">
31+ ${ renderMappingTable ( ) }
32+ </section>
33+ <section id="steps" class="migration-panel">
34+ ${ renderMigrationSteps ( ) }
35+ </section>
36+ </div>
3037 </div>
3138 ` ;
3239
@@ -89,29 +96,50 @@ export function initMigrationGuide() {
8996
9097function renderOverview ( ) {
9198 return `
99+ <div class="bundle-summary">
100+ <div class="summary-stats">
101+ <div class="stat-card">
102+ <div class="stat-value">58</div>
103+ <div class="stat-label">Functions Available</div>
104+ </div>
105+ <div class="stat-card nano-win">
106+ <div class="stat-value">88%</div>
107+ <div class="stat-label">Smaller Bundle</div>
108+ </div>
109+ <div class="stat-card">
110+ <div class="stat-value">0</div>
111+ <div class="stat-label">Dependencies</div>
112+ </div>
113+ <div class="stat-card nano-win">
114+ <div class="stat-value">~9KB</div>
115+ <div class="stat-label">Total Size (brotli)</div>
116+ </div>
117+ </div>
118+ </div>
119+
92120 <div class="comparison-section">
93121 <h2>Why Migrate?</h2>
94122 <div class="size-comparison">
95123 <div class="size-bars">
96124 <div class="size-bar">
97125 <span class="size-label">lodash (full)</span>
98- <div class="size-bar-fill" style="width: 100%; background: #e74c3c ;">
126+ <div class="size-bar-fill" style="width: 100%; background: linear-gradient(90deg, #ef4444, #dc2626) ;">
99127 <span class="size-value">${
100128 bundleSizeComparison . lodash . full
101129 } </span>
102130 </div>
103131 </div>
104132 <div class="size-bar">
105133 <span class="size-label">lodash (string only)</span>
106- <div class="size-bar-fill" style="width: 34%; background: #f39c12 ;">
134+ <div class="size-bar-fill" style="width: 34%; background: linear-gradient(90deg, #f59e0b, #f97316) ;">
107135 <span class="size-value">${
108136 bundleSizeComparison . lodash . string
109137 } </span>
110138 </div>
111139 </div>
112140 <div class="size-bar">
113141 <span class="size-label">nano-string-utils</span>
114- <div class="size-bar-fill" style="width: max(9 %, 60px ); background: #27ae60 ;">
142+ <div class="size-bar-fill" style="width: max(12 %, 80px ); background: linear-gradient(90deg, #34d399, #10b981) ;">
115143 <span class="size-value">${
116144 bundleSizeComparison . nanoStringUtils . full
117145 } </span>
@@ -120,8 +148,8 @@ function renderOverview() {
120148 </div>
121149
122150 <div class="size-summary">
123- <span class="size-reduction">96 % smaller</span>
124- <span class="size-details">than lodash • Zero dependencies</span>
151+ <span class="size-reduction">88 % smaller</span>
152+ <span class="size-details">than lodash • Zero dependencies • Tree-shakeable </span>
125153 </div>
126154 </div>
127155
@@ -158,11 +186,11 @@ function renderMappingTable() {
158186 const mappings = [ ...migrationMappings ] ;
159187
160188 return `
161- <h2 >Function Mapping Reference</h2 >
162- <p>Find the nano-string-utils equivalent for your lodash/underscore functions:</p>
189+ <h3 style="margin-bottom: 1rem; color: var(--color-text);" >Function Mapping Reference</h3 >
190+ <p style="color: var(--color-text-secondary); margin-bottom: 2rem;" >Find the nano-string-utils equivalent for your lodash/underscore functions:</p>
163191
164- <div class="mapping-filter ">
165- <input type="text" id="mapping-search" placeholder="Search functions..." />
192+ <div class="bundle-controls" style="margin-bottom: 1.5rem; ">
193+ <input type="text" id="mapping-search" placeholder="Search functions..." class="search-input" />
166194 <div class="filter-tags">
167195 <button class="filter-tag active" data-filter="all">All</button>
168196 <button class="filter-tag" data-filter="direct">Direct Replacement</button>
@@ -171,29 +199,29 @@ function renderMappingTable() {
171199 </div>
172200 </div>
173201
174- <div class="mapping- table-container">
175- <table class="mapping -table">
202+ <div class="table-container">
203+ <table class="bundle -table">
176204 <thead>
177205 <tr>
178- <th>lodash/underscore</th>
179- <th>nano-string-utils</th>
180- <th>Notes</th>
206+ <th><span class="th-text"> lodash/underscore</span> </th>
207+ <th><span class="th-text"> nano-string-utils</span> </th>
208+ <th><span class="th-text"> Notes</span> </th>
181209 </tr>
182210 </thead>
183211 <tbody>
184212 ${ mappings
185213 . map (
186214 ( m ) => `
187215 <tr data-type="${ getFilterType ( m ) } ">
188- <td><code>${ m . lodash } </code></td>
189- <td>
216+ <td class="function-name" ><code>${ m . lodash } </code></td>
217+ <td class="size-cell" >
190218 ${
191219 m . nano
192- ? `<code class="highlight-green ">${ m . nano } </code>`
193- : '<span class="text-muted ">—</span>'
220+ ? `<code style="color: var(--color-success); font-weight: 600; ">${ m . nano } </code>`
221+ : '<span class="no-data ">—</span>'
194222 }
195223 </td>
196- <td>${ m . notes || "Direct replacement" } </td>
224+ <td style="color: var(--color-text-secondary); font-size: 0.875rem;" >${ m . notes || "Direct replacement" } </td>
197225 </tr>
198226 `
199227 )
@@ -208,8 +236,8 @@ function renderMigrationSteps() {
208236 const steps = getMigrationSteps ( ) ;
209237
210238 return `
211- <h2 >Step-by-Step Migration</h2 >
212- <p>Follow these steps to migrate your project:</p>
239+ <h3 style="margin-bottom: 1rem; color: var(--color-text);" >Step-by-Step Migration</h3 >
240+ <p style="color: var(--color-text-secondary); margin-bottom: 2rem;" >Follow these steps to migrate your project:</p>
213241
214242 <div class="migration-steps">
215243 ${ steps
@@ -229,20 +257,21 @@ function renderMigrationSteps() {
229257 . join ( "" ) }
230258 </div>
231259
232- <div class="migration-tips ">
260+ <div class="footer-note ">
233261 <h3>💡 Pro Tips</h3>
234262 <ul>
235263 <li>Start with a single file or module to test the migration</li>
236264 <li>Use your test suite to verify functionality after each change</li>
237265 <li>Consider using the automated script below for large codebases</li>
238266 <li>Check the bundle size improvement with your build tools</li>
267+ <li>Use tree-shaking to ensure only used functions are bundled</li>
239268 </ul>
240269 </div>
241270
242- <div class="codemod-section ">
271+ <div class="footer-note" style="margin-top: 2rem; ">
243272 <h3>Automated Migration Script</h3>
244273 <p>For large codebases, use this simple Node.js script to automate common replacements:</p>
245- <pre><code class="language-javascript">${ generateCodemodScript ( ) } </code></pre>
274+ <pre style="background: #0f172a; border: 1px solid rgba(148, 163, 184, 0.1); border-radius: var(--radius); padding: 1.5rem; margin: 1rem 0; overflow-x: auto;" ><code class="language-javascript">${ generateCodemodScript ( ) } </code></pre>
246275 <button class="btn-secondary" id="copy-codemod">📋 Copy Script</button>
247276 </div>
248277 ` ;
@@ -256,7 +285,7 @@ function filterMappingTable() {
256285 const searchTerm = searchInput ?. value . toLowerCase ( ) || "" ;
257286 const filterType = ( activeFilter as HTMLElement ) ?. dataset . filter || "all" ;
258287
259- const rows = document . querySelectorAll ( ".mapping -table tbody tr" ) ;
288+ const rows = document . querySelectorAll ( ".bundle -table tbody tr" ) ;
260289
261290 rows . forEach ( ( row ) => {
262291 const text = ( row as HTMLElement ) . textContent ?. toLowerCase ( ) || "" ;
0 commit comments