commits
* Upgrade packages
* Replace makeTrampoline with fromArray in takeLast
* Remove makeTrampoline helper
* Replace Curry helpers with transpilation step
* Update yarn.lock
* Fix bind naming in Babel transform
* Fix curry arguments being pushed to parent scope instead of current
* Upgrade to upcoming bs-platform version
* Prevent transformer to create local variable if that's unnecessary
- add an initialValue to the TypeScript `scan` example
* Update sources.md
Capitalization Typo in cods.
* Update sources.md
Fix fromDomEvent example so compiles.
```ocaml
This has type:
option(Dom.element)
But somewhere wanted:
Dom.element (defined as
Dom.eventTarget_like(Dom._node(Dom._element(Dom._baseClass))))
```
* Fix switchMap and concatMap not forwarding Push before Start
This is technically incorrect, but a lot of asynchronous
sources will Push eagerly, which means Start doesn't
always get to talk first.
* Readd state.innerActive guard to switchMap
* Update esy.json and wonka.opam files
* Fix dune copy_files
This reverts commit 071101e34c790a3ef9589eb78b814f151ee5ebbb.
Since these are side-effects that may be used
to reinsert more signals into the source chain,
through subjects for instance, they need to
protect themselves from dangerous signal loops.
* Fix synchronous make Close signal
* Continue allowing Pull/Close/Push on inner mergeMap sources
* Continue allowing Pull/Close/Push on switchMap's inner source
* Continue allowing Pull/Close/Push on concatMap's inner source
* Fix missing Pull in mergeMap and add merge source test
* Implement alternative passesSourcePushThenEnd suite
This is for eager operators that send an additional
Pull signal when they're not expecting one to come
in from the sink. All {merge,switch,concat}Map operators
need to pass this instead of passSourceEnd.
* Add active pulling to sample
sample needs to also actively send Pull signals as
it may not forward any that will cause Pull signals.
* Add active pulling to buffer
* Add active pulling to takeUntil
* Ensure merge sources are instantiated first
Ensure that all merge sources are eagerly pulled
and started without hanging and waiting for the
first source.
Before `merge` and `mergeMap` would behave like
`concat` and `concatMap` when the first source
wouldn't push or end.
* Fix timing of eager pull in mergeMap
* Add test for interval source to merge source
* Revert change to make teardown
* Remove captureTalkback from filter operator
* Remove captureTalkback from skip operator
* Remove captureTalkback from skipWhile operator
* Refactor takeLast, add tests, and remove captureTalkback
* Delete captureTalkback helper
Delay does not have to pass `passesStrictEnd`,
since it's idempotent.
* Remove strict end test from map operator
The map operator doesn't need to guard
against signals after End since it's a
safe and repeatable effect.
* Remove strict end guard from onEnd operator
The onEnd operator does run a side-effect, but
it can rely on the convention of no signals being
emitted after End/Close.
* Add Close guards to all sources
Since we now assume that sources behave
well and operators don't have to guard
Close events, unless they're dealing with
multiple sources and side-effects, the
sources can be amended instead.
* Rename gotSignal to pulled in skipUntil
* Fix pulling behaviour of skipUntil
* Close source when notifier will never emit
When the notifier ends before it emits any value
it's safe to close the source as it can never emit
any values anymore.
* Fix active pushing
Pull from notifier source on start so it has a chance
to send a value before the source pushes its first value.
* Fix switchMap pulling for cold sources
The pulling behaviour wouldn't take cold sources
into account, which could lead to values being accepted
in the incorrect order.
* Fix passesActivePush for switchMap
* Fix mergeMap pulling for cold sources
* Fix state.ended being set for Close in mergeMap
* Fix concatMap pulling for cold sources
* Remove redundant state.closed from concatMap
* Fix passesPassivePull for buffer operator
* Fix passesSinkClose and passesStrictEnd for buffer operator
* Fix passesActivePush and passesSourceEnd for buffer operator
When two sources are passed two combine of which
one is hot (actively sends Push signals without Pull
talkback signals) and one is cold (only sends Push
signals with Pull talkback signals) the combine
operator stalls.
It will receive a value from the hot source, but
wait for the cold source's value forever.
To prevent this, when no Pull talkback signal has
been received, one is sent to the other (presumably cold)
source proactively.
* Fix debounce emitting End after Close
Since there was no difference between "ended"
and "closed" in the debounce operator, after
the timeout completed it would emit an End
event even if the source has been closed.
* Add test for debounced End
This fixes the delay operator by removing an unnecessary
End event being sent when Close is received.
It also fixes a potential duplicate End signal and renames
`gotEndSignal` to `ended`.
* Fix take operator with max <= 0
* Fix passesSinkClose for take operator
The take operator needs to keep track of ended
actively to avoid confusion with the state.taken
number and the max <= 0 case.
* Add !state.ended condition to take's Push signal
* Fix takeWhile emitting two Start signals
* Remove ref usage from takeWhile
* Upgrade dependencies
* Upgrade to bs-platform 7.0.2-dev.1
* Add gentype
* Switch to genType TypeScript codegen
* Migrate all operators to genType
* Migrate all sinks to genType
* Migrate sources to genType
* Migrate web to genType
* Delete obsolete .d.ts signature files
* Clean up main folder structure
* Add new main src/wonka.ts entrypoint
* Combine all separate granular files
* Remove fromListener
* Add missing shims
* Move include folder to src
* Convert pipe helper to pipe.ts with overloads
* Fix build output
* Update flow typegeneration
* Fix missing Js.shim.ts types
* Refactor tasks
* Add unwrapStatePlugin to optimise size
Unwraps all `let state` usages across all
operators, since internally this will not
change any functionality while optimising for
output size.
* Unwrap refs using unwrapStatePlugin
Also unwrap all ref types which are output
as objects of the shape: { contents: T }
* Fix forEach types not being generated
* Add full clean script
* Simplify pipe overload typings
* Add initial operator spec tests
* Add test for delay/debounce/throttle using fake timers
* Add additional initial unit tests to all operators
* Collect coverage from non-generated / non-helpers files
* Add spec test for single Start signal
Verify that each operator only sends a single
Start event
* Add spec test for closing operators End/Close
Verify that closing operators send the Close
talkback signal upwards and the End signal
downwards.
* Add sync tests for mergeMap, switchMap & concatMap
* Add stricter ending criteria
Check that Close and End aren't duplicated
* Add test for strict end
Some operators stop forwarding signals when the
source has ended. This is not strictly necessary,
but this test may highlight some other edge cases
and bugs, but it may also become necessary for
sources that aren't well behaved.
* Add additional async sequence test
* Add tests for combine operator
* Add asynchronous tests for switchMap, mergeMap & concatMap
* Add initial tests for Wonka sources
* Add more sources to tests
* Ignore wonka.bs.js/wonka.ts in coverage report
* Add source tests for cold Pull waiting
* Revert changes to Wonka_observable implementation
* Add tests for fromObservable
* Fix genType codegen for Callbags
* Add tests for fromCallbag
* Add tests for cancellation of sources
* Replace publish with subscribe with noop fn
* Add tests for Wonka sinks
* Update package.json and README.md
* Fix coverage and add test for publish
* Remove obsolete TODO comments
* Replace Sail CI with Travis
* Replace babel-jest with custom script
* Test makeSubject after complete has been called
* Add missing tests for interval and fromDomEvent
* Remove obsolete .jest.coverage.json
* Add old TypeScript types for various opaque genTypes
Add old definitions for talkbackT, signalT, observableSubscriptionT,
observableObserverT, observableT, and callbagT.
This will provide more backwards compatibility.
* Update .travis.yml command for codecov
* Add Closure Compiler to compilation
* Unwrap state generated by BuckleScript
* Upgrade packages
* Replace makeTrampoline with fromArray in takeLast
* Remove makeTrampoline helper
* Replace Curry helpers with transpilation step
* Update yarn.lock
* Fix bind naming in Babel transform
* Fix curry arguments being pushed to parent scope instead of current
* Upgrade to upcoming bs-platform version
* Prevent transformer to create local variable if that's unnecessary
* Fix synchronous make Close signal
* Continue allowing Pull/Close/Push on inner mergeMap sources
* Continue allowing Pull/Close/Push on switchMap's inner source
* Continue allowing Pull/Close/Push on concatMap's inner source
* Fix missing Pull in mergeMap and add merge source test
* Implement alternative passesSourcePushThenEnd suite
This is for eager operators that send an additional
Pull signal when they're not expecting one to come
in from the sink. All {merge,switch,concat}Map operators
need to pass this instead of passSourceEnd.
* Add active pulling to sample
sample needs to also actively send Pull signals as
it may not forward any that will cause Pull signals.
* Add active pulling to buffer
* Add active pulling to takeUntil
* Ensure merge sources are instantiated first
Ensure that all merge sources are eagerly pulled
and started without hanging and waiting for the
first source.
Before `merge` and `mergeMap` would behave like
`concat` and `concatMap` when the first source
wouldn't push or end.
* Fix timing of eager pull in mergeMap
* Add test for interval source to merge source
* Revert change to make teardown
* Remove strict end test from map operator
The map operator doesn't need to guard
against signals after End since it's a
safe and repeatable effect.
* Remove strict end guard from onEnd operator
The onEnd operator does run a side-effect, but
it can rely on the convention of no signals being
emitted after End/Close.
* Add Close guards to all sources
Since we now assume that sources behave
well and operators don't have to guard
Close events, unless they're dealing with
multiple sources and side-effects, the
sources can be amended instead.
* Rename gotSignal to pulled in skipUntil
* Fix pulling behaviour of skipUntil
* Close source when notifier will never emit
When the notifier ends before it emits any value
it's safe to close the source as it can never emit
any values anymore.
* Fix active pushing
Pull from notifier source on start so it has a chance
to send a value before the source pushes its first value.
* Fix switchMap pulling for cold sources
The pulling behaviour wouldn't take cold sources
into account, which could lead to values being accepted
in the incorrect order.
* Fix passesActivePush for switchMap
* Fix mergeMap pulling for cold sources
* Fix state.ended being set for Close in mergeMap
* Fix concatMap pulling for cold sources
* Remove redundant state.closed from concatMap
When two sources are passed two combine of which
one is hot (actively sends Push signals without Pull
talkback signals) and one is cold (only sends Push
signals with Pull talkback signals) the combine
operator stalls.
It will receive a value from the hot source, but
wait for the cold source's value forever.
To prevent this, when no Pull talkback signal has
been received, one is sent to the other (presumably cold)
source proactively.
* Upgrade dependencies
* Upgrade to bs-platform 7.0.2-dev.1
* Add gentype
* Switch to genType TypeScript codegen
* Migrate all operators to genType
* Migrate all sinks to genType
* Migrate sources to genType
* Migrate web to genType
* Delete obsolete .d.ts signature files
* Clean up main folder structure
* Add new main src/wonka.ts entrypoint
* Combine all separate granular files
* Remove fromListener
* Add missing shims
* Move include folder to src
* Convert pipe helper to pipe.ts with overloads
* Fix build output
* Update flow typegeneration
* Fix missing Js.shim.ts types
* Refactor tasks
* Add unwrapStatePlugin to optimise size
Unwraps all `let state` usages across all
operators, since internally this will not
change any functionality while optimising for
output size.
* Unwrap refs using unwrapStatePlugin
Also unwrap all ref types which are output
as objects of the shape: { contents: T }
* Fix forEach types not being generated
* Add full clean script
* Simplify pipe overload typings
* Add initial operator spec tests
* Add test for delay/debounce/throttle using fake timers
* Add additional initial unit tests to all operators
* Collect coverage from non-generated / non-helpers files
* Add spec test for single Start signal
Verify that each operator only sends a single
Start event
* Add spec test for closing operators End/Close
Verify that closing operators send the Close
talkback signal upwards and the End signal
downwards.
* Add sync tests for mergeMap, switchMap & concatMap
* Add stricter ending criteria
Check that Close and End aren't duplicated
* Add test for strict end
Some operators stop forwarding signals when the
source has ended. This is not strictly necessary,
but this test may highlight some other edge cases
and bugs, but it may also become necessary for
sources that aren't well behaved.
* Add additional async sequence test
* Add tests for combine operator
* Add asynchronous tests for switchMap, mergeMap & concatMap
* Add initial tests for Wonka sources
* Add more sources to tests
* Ignore wonka.bs.js/wonka.ts in coverage report
* Add source tests for cold Pull waiting
* Revert changes to Wonka_observable implementation
* Add tests for fromObservable
* Fix genType codegen for Callbags
* Add tests for fromCallbag
* Add tests for cancellation of sources
* Replace publish with subscribe with noop fn
* Add tests for Wonka sinks
* Update package.json and README.md
* Fix coverage and add test for publish
* Remove obsolete TODO comments
* Replace Sail CI with Travis
* Replace babel-jest with custom script
* Test makeSubject after complete has been called
* Add missing tests for interval and fromDomEvent
* Remove obsolete .jest.coverage.json
* Add old TypeScript types for various opaque genTypes
Add old definitions for talkbackT, signalT, observableSubscriptionT,
observableObserverT, observableT, and callbagT.
This will provide more backwards compatibility.
* Update .travis.yml command for codecov