0no-co / wonka

🎩 A tiny but capable push & pull stream library for TypeScript and Flow
MIT License
709 stars 29 forks source link

Upgrade to BuckleScript v7 with genType based TS codegen #44

Closed kitten closed 4 years ago

kitten commented 4 years ago

This upgrades Wonka to use BuckleScript v7. Some other significant changes have been made to go alongside this upgrade.

This opportunity has also been used to move all TypeScript types from being manually authored to being generated by genType. The Flow types are still generated from the TypeScript types, but this process is now 100% automated. This has caused some ripple-changes throughout the repository.

The build process has also been changed and BuckleScript is now set up to only build files in-place.

Due to the BuckleScript v7 upgrade this is a breaking change for Js/Flow/TS since all records are now compiled to objects, for instance:

// this:
const [unsubscribe] = Wonka.subscribe(fn)(source);
// becomes:
const { unsubscribe } = Wonka.subscribe(fn)(source);

All operators, sources, and sinks have been moved back to combined files. All tests have been rewritten (in TypeScript for simplicity's sake) to have unified test suites that comply with the Wonka/Callbag spec.

TODO comments have been left where some operators don't comply to the spec!

Another todo is checking whether Dune and bsb-native compilation still work...