From bcbd3385f473de0a81df83f631048dbfa8f7eab9 Mon Sep 17 00:00:00 2001 From: Eryn Lynn Date: Tue, 2 Jun 2020 00:54:36 -0400 Subject: [PATCH] Update docs --- .vuepress/config.js | 3 ++- CHANGELOG.md | 55 +++++++++++++++++++++++++++------------------ lib/README.md | 8 +++---- rotriever.toml | 2 +- 4 files changed, 40 insertions(+), 28 deletions(-) diff --git a/.vuepress/config.js b/.vuepress/config.js index c67aa9b..9cbcfcc 100644 --- a/.vuepress/config.js +++ b/.vuepress/config.js @@ -44,7 +44,8 @@ module.exports = { '/lib/WhyUsePromises', '/lib/Tour', '/lib/Examples', - '/lib/', + '/CHANGELOG', + '/lib/' ] } } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ecb6d5b..25b4efb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,25 +1,36 @@ -# Next +# Changelog +## [3.0.0] - 2020-06-02 +### Changed - Runtime errors are now represented by objects. You must call tostring on rejection values before assuming they are strings (this was always good practice, but is required now). -- New Promise Error class is exposed at `Promise.Error`, which includes helpful static methods like `Promise.Error.is`. -- Yielding is now allowed in Promise.new, andThen, and Promise.try executors. -- Errors now have much better stack traces due to using xpcall internally instead of pcall. -- Stack traces now be more direct and not include as many internal calls within the Promise library. -- Chained promises from resolve() or returning from andThen now have improved rejection messages for debugging. -- Promises now have a __tostring metamethod, which returns `Promise(Resolved)` or whatever the current status is. -- Promise.async has been renamed to Promise.defer (Promise.async references same function for compatibility) -- Improve test coverage for asynchronous and time-driven functions -- Change Promise.is to be safe when dealing with tables that have an `__index` metamethod that creates an error. -- Let Promise:expect() throw rejection objects -- Add Promise:now() (#23) -- Promise:timeout() now rejects with a `Promise.Error(Promise.Error.Kind.TimedOut)` object. (Formerly rejected with the string "Timed out") -- Attaching a handler to a cancelled Promise now rejects with a `Promise.Error(Promise.Error.Kind.AlreadyCancelled)`. (Formerly rejected with the string "Promise is cancelled") +- Yielding is now allowed in `Promise.new`, `andThen`, and `Promise.try` executors. +- Errors now have much better stack traces due to using `xpcall` internally instead of `pcall`. +- Stack traces will now be more direct and not include as many internal calls within the Promise library. +- Chained promises from `resolve()` or returning from andThen now have improved rejection messages for debugging. +- `Promise.async` has been renamed to `Promise.defer` (`Promise.async` references same function for compatibility) +- Promises now have a `__tostring` metamethod, which returns `Promise(Resolved)` or whatever the current status is. +- `Promise:timeout()` now rejects with a `Promise.Error(Promise.Error.Kind.TimedOut)` object. (Formerly rejected with the string `"Timed out"`) +- Attaching a handler to a cancelled Promise now rejects with a `Promise.Error(Promise.Error.Kind.AlreadyCancelled)`. (Formerly rejected with the string `"Promise is cancelled"`) +- Let `Promise:expect()` throw rejection objects -# 2.5.1 +### Added + +- New Promise Error class is exposed at `Promise.Error`, which includes helpful static methods like `Promise.Error.is`. +- Added `Promise:now()` (#23) +- Added `Promise.each` (#21) +- Added `Promise.retry` (#16) +- Added `Promise.fromEvent` (#14) +- Improved test coverage for asynchronous and time-driven functions + +### Fixed +- Changed `Promise.is` to be safe when dealing with tables that have an `__index` metamethod that creates an error. +- `Promise.delay` resolve value (time passed) is now more accurate (previously passed time based on when we started resuming threads instead of the current time. This is a very minor difference.) + +## [2.5.1] - Fix issue with rejecting with non-string not propagating correctly. -# 2.5.0 +## [2.5.0] - Add Promise.tap - Fix bug with C functions not working when passed to andThen @@ -36,31 +47,31 @@ - Add `Promise.allSettled` - `Promise.all` and `Promise.race` are now cancellable. -# 2.4.0 +## [2.4.0] - `Promise.is` now only checks if the object is "andThennable" (has an `andThen` method). -# 2.3.1 +## [2.3.1] - Make unhandled rejection warning trigger on next Heartbeat -# 2.3.0 +## [2.3.0] - Remove `Promise.spawn` from the public API. - `Promise.async` still inherits the behavior from `Promise.spawn`. - `Promise.async` now wraps the callback in `pcall` and rejects if an error occurred. - `Promise.new` has now has an explicit error message when attempting to yield inside of it. -# 2.2.0 +## [2.2.0] - `Promise.promisify` now uses `coroutine.wrap` instead of `Promise.spawn` -# 2.1.0 +## [2.1.0] - Add `finallyCall`, `andThenCall` - Add `awaitValue` -# 2.0.0 +## [2.0.0] - Add Promise.race - Add Promise.async diff --git a/lib/README.md b/lib/README.md index 126ac1b..c4fa0e8 100644 --- a/lib/README.md +++ b/lib/README.md @@ -84,7 +84,7 @@ docs: desc: "Returns `true` if the Promise was already cancelled at the time of calling `onCancel`." returns: Promise - name: defer - since: 2.0.0 + since: 3.0.0 desc: | The same as [[Promise.new]], except execution begins after the next `Heartbeat` event. @@ -287,7 +287,7 @@ docs: static: true - name: each - since: 2.0.0 + since: 3.0.0 desc: | Iterates serially over the given an array of values, calling the predicate callback on each value before continuing. @@ -351,7 +351,7 @@ docs: static: true - name: retry - since: 2.0.0 + since: 3.0.0 desc: | Repeatedly calls a Promise-returning function up to `times` number of times, until the returned Promise resolves. @@ -372,7 +372,7 @@ docs: static: true - name: fromEvent - since: 2.0.0 + since: 3.0.0 desc: | Converts an event into a Promise which resolves the next time the event fires. diff --git a/rotriever.toml b/rotriever.toml index a62514c..7b4fa52 100644 --- a/rotriever.toml +++ b/rotriever.toml @@ -1,6 +1,6 @@ [package] name = "roblox-lua-promise" -version = "2.4.1" +version = "3.0.0-rc.1" author = "evaera" content_root = "lib"