dprint-plugin-typescript icon indicating copy to clipboard operation
dprint-plugin-typescript copied to clipboard

Memory consumption on huge JS files

Open alexkuz opened this issue 2 years ago • 0 comments

Hello, I wrote a simple wrapper with bindings for Python where I'm using format_text function to format potentially big JS files (1MB or more): https://github.com/alexkuz/python-rust-dprint. Unfortunately it gets stuck on ./test/node_modules.js file in that repo, allocating a lot of memory. Here's a call:

https://github.com/alexkuz/python-rust-dprint/blob/ffac9f632b070729e0847742afad2bf759a8e420/src/lib.rs#L30

Interestingly, CLI version of dprint works fine on that file. I would appreciate if you could point on what could be a problem here (it could be that I'm using format_text or Rust itself wrong, I don't have much knowledge of it)

dprint-plugin-typescript version: 0.67.0

alexkuz avatar Apr 16 '22 08:04 alexkuz