@quenty/promise 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.1.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/promise@5.0.0...@quenty/promise@5.1.0) (2022-07-31)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Promise uses task.defer() instead of Heartbeat ([0ae1e7a](https://github.com/Quenty/NevermoreEngine/commit/0ae1e7aa92543bf220ebd594772dea9b6b586612))
12
+ * Replace coroutine.resume in favor of task.spawn ([#260](https://github.com/Quenty/NevermoreEngine/issues/260)) ([3686a1e](https://github.com/Quenty/NevermoreEngine/commit/3686a1e7926c0c5d116bd51843a95a5bb4e33743))
13
+
14
+
15
+
16
+
17
+
6
18
  # [5.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/promise@4.2.0...@quenty/promise@5.0.0) (2022-05-21)
7
19
 
8
20
  **Note:** Version bump only for package @quenty/promise
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/promise",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "Promise implementation for Roblox",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -27,10 +27,10 @@
27
27
  "dependencies": {
28
28
  "@quenty/deferred": "^2.1.0",
29
29
  "@quenty/loader": "^5.0.0",
30
- "@quenty/maid": "^2.3.0"
30
+ "@quenty/maid": "^2.4.0"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "9f7eaea7543c33c89d2e32c38491b13f9271f4f7"
35
+ "gitHead": "e31b3a35aa475bb5699a24898a8639e107165b36"
36
36
  }
@@ -6,8 +6,6 @@
6
6
  @class Promise
7
7
  ]=]
8
8
 
9
- local RunService = game:GetService("RunService")
10
-
11
9
  -- Turns out debug.traceback() is slow
12
10
  local ENABLE_TRACEBACK = false
13
11
  local _emptyRejectedPromise = nil
@@ -324,11 +322,9 @@ function Promise:_reject(values, valuesLength)
324
322
 
325
323
  -- Check for uncaught exceptions
326
324
  if self._unconsumedException and self._valuesLength > 0 then
327
- coroutine.resume(coroutine.create(function()
325
+ task.defer(function()
328
326
  -- Yield to end of frame, giving control back to Roblox.
329
327
  -- This is the equivalent of giving something back to a task manager.
330
- RunService.Heartbeat:Wait()
331
-
332
328
  if self._unconsumedException then
333
329
  if ENABLE_TRACEBACK then
334
330
  warn(("[Promise] - Uncaught exception in promise\n\n%q\n\n%s")
@@ -338,7 +334,7 @@ function Promise:_reject(values, valuesLength)
338
334
  :format(tostring(self._rejected[1])))
339
335
  end
340
336
  end
341
- end))
337
+ end)
342
338
  end
343
339
  end
344
340