typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

Reorganize fileLoader, make it lock-free via SyncMaps

Open jakebailey opened this issue 8 months ago • 1 comments

I'm currently modifying this to work on JSX stuff; sending this refactor in early.

I'm going to add more stuff to the file loader for JSX, so converting its return into a struct will make a future PR simpler.

Additionally, there's no real need to use full locks here; sync maps are sufficient for all uses, so we can do everything in the loader lock-free (more or less).

jakebailey avatar Apr 09 '25 01:04 jakebailey

Bug in the lint rule, nice.

EDIT: I can't fix it without https://github.com/golang/go/issues/73278 or a bunch of finagling to fix up the CFG, so I'll just rename the var to make the lint rule happy.

jakebailey avatar Apr 09 '25 01:04 jakebailey

Realized that none of this even needs to be locked; we can just put the info onto the tasks, which we collect later anyway.

jakebailey avatar Apr 09 '25 18:04 jakebailey