HackerTrans
TopNewTrendsCommentsPastAskShowJobs

worx

no profile record

comments

worx
·5 mesi fa·discuss
And let big tech keep researching and using hostile psychological patterns in their services? Nobody wants overregulation and over control, but there's gotta be a line somewhere, and when corporations are deliberately exploiting addiction for profits (including with children), we're way past the line in my book
worx
·2 anni fa·discuss
I tried it and it's pretty cool, I might introduce it in our company project. I did notice one problem/caveat: It doesn't play nice with dynamic imports. Our project has a few files being lazily imported and the tool seems to think that those files are unused, which is not true, they're just imported with the `import('./file')` syntax.

But other than that it's pretty nice, I might look into the code to see if I can help with that small bug.
worx
·2 anni fa·discuss
Could you provide examples of such risks? Because in my understanding, if some function/constant is exported but never imported anywhere, then it must be dead code and never run. And if it was reachable, then TypeScript would fail the compilation. As such, it sounds reasonably safe to me to remove it.

I only see these potential risks:

1. Using a mix of TS/JS and having some blind spots where we could accidentally delete non-dead code without the compiler noticing.

2. Having and relying on side effects. For example, `export const foobar = thisFnWillDoSthImportant()` and then, yes, removing that would break things.

3. Having separate projects/libs where some consumer might be accessing your exports directly.

Do you see other risks than those?