Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
## 2025-03-25 - [Vue Computed Search Optimizations]
**Learning:** Reactive computed loops that filter over arrays on every keystroke in Vue (like search) can cause unnecessary CPU overhead and garbage collection pressure due to repeatedly calling `.toLowerCase()` and allocating new strings.
**Action:** Use Nuxt's `useFetch` `transform` option to pre-compute and store these derived strings (e.g., `_searchName`) when the data is initially fetched, so the reactive filter only does simple substring checks.

## 2025-05-23 - [Vue Map Iteration Optimizations]
**Learning:** In the Nuxt environment, looking up items in a `Map` by converting the entire map to an array using `Array.from(map.entries()).find(...)` is highly inefficient and creates O(N) intermediate array allocations per lookup.
**Action:** Always use a `for...of` loop over `map.entries()` when performing lookups to avoid intermediate array allocations and improve memory usage.
22 changes: 16 additions & 6 deletions pages/builder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,14 @@ const validateFiles = async () => {
} else {
error.value = null;
// Parse appinfo.spixi
const appInfoFile = Array.from(filesMap.value.entries()).find(
([path]) => path.toLowerCase() === 'appinfo.spixi'
)?.[1];
// ⚑ Bolt Optimization: Replace Array.from() with for...of to avoid O(N) memory allocation and improve performance
let appInfoFile: File | undefined;
for (const [path, file] of filesMap.value.entries()) {
if (path.toLowerCase() === 'appinfo.spixi') {
appInfoFile = file;
break;
}
}

if (appInfoFile) {
const text = await appInfoFile.text();
Expand Down Expand Up @@ -220,9 +225,14 @@ const packApp = async () => {
success.value = false;

try {
const iconFile = Array.from(filesMap.value.entries()).find(
([path]) => path.toLowerCase() === 'icon.png'
)?.[1];
// ⚑ Bolt Optimization: Replace Array.from() with for...of to avoid O(N) memory allocation and improve performance
let iconFile: File | undefined;
for (const [path, file] of filesMap.value.entries()) {
if (path.toLowerCase() === 'icon.png') {
iconFile = file;
break;
}
}

// Use data from form
const appInfo = appFormData.value;
Expand Down