MartinMalinda / vue-concurrency

A library for encapsulating asynchronous operations and managing concurrency for Vue and Composition API.
https://vue-concurrency.netlify.app/
MIT License
352 stars 15 forks source link

./types is not included in dist folder #77

Closed TRScheel closed 2 years ago

TRScheel commented 2 years ago

Targeting vue-concurrency@4.0.0-7

The folder ./types is not included in the 'dist' folder. This causes some type checking issues downstream.

Take this example line:

const testFunc = useTask(function*(signal) { return "test value" });

Because ./types is not exported into the 'dist' folder, parameter 'signal' implicitly has an 'any' type as does the resulting value of 'testFunc'

The fix is to append "include": ["src/**/*.ts", "src/**/*.d.ts"], to the 'tsconfig.json' compilerOptions

MartinMalinda commented 2 years ago

Something must have broken here recently. Signal was definitely typed before. Thanks for reporting this.

TRScheel commented 2 years ago

I didn't dig into the history to see when it broke but I noticed some circular dependencies in those files as well. I suspect those circular dependencies might be causing some issues with the tree shaking that is performed on build. Just a shot in the dark though without evidence.

MartinMalinda commented 2 years ago

Yeah, that in combination with some TS and Microbundle updates probably. I hope to switch the build to Vite at some point.

I hope to release this week 🙏