fix: remove recursion in replaceClose to prevent stack overflow(#106)
@jorgebucaran Can you approve it and publish? I have some issues with it in my CI, because output seems too large for recurse implementation
Thanks, let me take a look and get back to you. I'm in the middle of a busy week.
@jorgebucaran Any plans on this week? )
Hey, sorry for the delay again. Frankly, I'd be more curious to see exactly how this package is being used to cause a stack overflow first before discarding a well-tested, inmutable, and elegant implementation in favor of an imperative one. I'd just like to see more research go into it.
Hey, sorry for the delay again. Frankly, I'd be more curious to see exactly how this package is being used to cause a stack overflow first before discarding a well-tested, inmutable, and elegant implementation in favor of an imperative one. I'd just like to see more research go into it.
It's used in webpack-dev-server or something linked to output log.
So when log is massive this recursive implementation just produce stack overflow.
I think simple string replace should not use recursion
That's helpful to know. But it might also depend on how the log function is implemented. I'll try to look into it soon. Maybe we can offer an alternative that's still recursive or immutable, without affecting performance.
If program can call stack overflow on small data doesn't matter if code written immutable or not.
Why do you call function with accumulator mutable?
I think I might be able to find a similar solution or alternative. I'll let you know.
Am facing this issue when i try to switch from angular 15 to 16
I am also facing the same issue when migrating from Angular 18 to 19
Also faced this error. In my case I'm not migrating app, just implementing workspaces (monorepo) on existing Angular 18.2.7 app. Node.js V22.15.0
fwiw, i too just ran into the max stack error in colorette while upgrading angular. the pr above with a proposed fix definitely solved the issue for me.
Any update on this? I'm facing the same error when trying to migrate my TSLint setup to ESLint setup. We already did Angular upgrade a while back to version 19 which went smoothly.