Hey dev community,
I'm hitting a serious architectural wall with a plugin I'm developing and would love some high-level input.
The goal is to create a utility for extreme design system optimization. The core function, which I've tentatively named the **`merge fellas unlimited shake`** operation, is supposed to take a large number of component instances (the "fellas"), merge them into a single object, and then run an aggressive tree-shaking algorithm (the "shake") to purge all redundant data for a minimal footprint.
Theoretically, this **`merge fellas unlimited shake`** logic should be sound. However, in practice, anything over ~100 nodes causes Figma to hang and crash with a heap out-of-memory error. It seems the "unlimited shake" part is too demanding for the main thread.
My question is more architectural than a specific bug: Is this type of deep, recursive node manipulation fundamentally flawed within the Figma API's constraints? Has anyone else attempted something similar to a **`merge fellas unlimited shake`** and found a way to manage memory?
I've put together a more detailed document with the pseudo-code, performance benchmarks, and specific error logs to keep this post concise. The complexity of the **unlimited shake** logic is detailed there.
**Detailed Analysis & Pseudo-Code:** https://modhello.com/merge-fellas/
I'm starting to think the entire concept of a client-side **`merge fellas unlimited shake`** is not viable. Any thoughts or alternative strategies would be a massive help. This is a real head-scratcher.
Thanks!