inngest 1.0.0 → 1.2.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.
Files changed (59) hide show
  1. package/README.md +48 -22
  2. package/cloudflare.d.ts.map +1 -1
  3. package/cloudflare.js +1 -0
  4. package/cloudflare.js.map +1 -1
  5. package/components/Inngest.d.ts.map +1 -1
  6. package/components/Inngest.js +1 -1
  7. package/components/Inngest.js.map +1 -1
  8. package/components/InngestCommHandler.d.ts +5 -2
  9. package/components/InngestCommHandler.d.ts.map +1 -1
  10. package/components/InngestCommHandler.js +73 -20
  11. package/components/InngestCommHandler.js.map +1 -1
  12. package/components/InngestFunction.d.ts +2 -1
  13. package/components/InngestFunction.d.ts.map +1 -1
  14. package/components/InngestFunction.js +49 -28
  15. package/components/InngestFunction.js.map +1 -1
  16. package/components/InngestStepTools.d.ts +32 -2
  17. package/components/InngestStepTools.d.ts.map +1 -1
  18. package/components/InngestStepTools.js +58 -1
  19. package/components/InngestStepTools.js.map +1 -1
  20. package/deno/fresh.d.ts.map +1 -1
  21. package/deno/fresh.js +1 -0
  22. package/deno/fresh.js.map +1 -1
  23. package/digitalocean.d.ts +1 -3
  24. package/digitalocean.d.ts.map +1 -1
  25. package/digitalocean.js +1 -0
  26. package/digitalocean.js.map +1 -1
  27. package/express.d.ts.map +1 -1
  28. package/express.js +1 -0
  29. package/express.js.map +1 -1
  30. package/helpers/ServerTiming.d.ts +37 -0
  31. package/helpers/ServerTiming.d.ts.map +1 -0
  32. package/helpers/ServerTiming.js +107 -0
  33. package/helpers/ServerTiming.js.map +1 -0
  34. package/helpers/consts.d.ts +3 -0
  35. package/helpers/consts.d.ts.map +1 -1
  36. package/helpers/consts.js +5 -1
  37. package/helpers/consts.js.map +1 -1
  38. package/helpers/promises.d.ts.map +1 -1
  39. package/helpers/promises.js +20 -8
  40. package/helpers/promises.js.map +1 -1
  41. package/landing.d.ts +1 -1
  42. package/landing.d.ts.map +1 -1
  43. package/landing.js +1 -1
  44. package/landing.js.map +1 -1
  45. package/next.d.ts.map +1 -1
  46. package/next.js +1 -0
  47. package/next.js.map +1 -1
  48. package/nuxt.d.ts.map +1 -1
  49. package/nuxt.js +1 -0
  50. package/nuxt.js.map +1 -1
  51. package/package.json +1 -1
  52. package/redwood.d.ts.map +1 -1
  53. package/redwood.js +1 -0
  54. package/redwood.js.map +1 -1
  55. package/remix.d.ts.map +1 -1
  56. package/remix.js +1 -0
  57. package/remix.js.map +1 -1
  58. package/version.d.ts +1 -1
  59. package/version.js +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/helpers/consts.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,8BAAiB,CAAA;IACjB,sCAAyB,CAAA;IACzB,kCAAqB,CAAA;AACvB,CAAC,EALW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAKpB;AAED,IAAY,OAKX;AALD,WAAY,OAAO;IACjB,6CAAkC,CAAA;IAClC,yCAA8B,CAAA;IAC9B,+CAAoC,CAAA;IACpC,iDAAsC,CAAA;AACxC,CAAC,EALW,OAAO,GAAP,eAAO,KAAP,eAAO,QAKlB;AAED,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,sCAAuB,CAAA;IACvB,0CAA2B,CAAA;IAC3B,wCAAyB,CAAA;AAC3B,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAItB;AAEY,QAAA,oBAAoB,GAAG,wBAAwB,CAAC"}
1
+ {"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/helpers/consts.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,8BAAiB,CAAA;IACjB,sCAAyB,CAAA;IACzB,kCAAqB,CAAA;AACvB,CAAC,EALW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAKpB;AAED,IAAY,OAKX;AALD,WAAY,OAAO;IACjB,6CAAkC,CAAA;IAClC,yCAA8B,CAAA;IAC9B,+CAAoC,CAAA;IACpC,iDAAsC,CAAA;AACxC,CAAC,EALW,OAAO,GAAP,eAAO,KAAP,eAAO,QAKlB;AAED,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,sCAAuB,CAAA;IACvB,0CAA2B,CAAA;IAC3B,wCAAyB,CAAA;AAC3B,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAItB;AAED,IAAY,UAEX;AAFD,WAAY,UAAU;IACpB,+CAAiC,CAAA;AACnC,CAAC,EAFW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAErB;AAEY,QAAA,oBAAoB,GAAG,wBAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"promises.d.ts","sourceRoot":"","sources":["../../src/helpers/promises.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,QAAO,QAAQ,OAAO,CAErD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAO,QAAQ,IAAI,CAalD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,QAAO,QAAQ,IAAI,CAE9C,CAAC"}
1
+ {"version":3,"file":"promises.d.ts","sourceRoot":"","sources":["../../src/helpers/promises.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,QAAO,QAAQ,OAAO,CAErD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAO,QAAQ,IAAI,CA2BlD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,QAAO,QAAQ,IAAI,CAE9C,CAAC"}
@@ -20,17 +20,29 @@ exports.createFrozenPromise = createFrozenPromise;
20
20
  * have finished, but before the next event loop tick.
21
21
  */
22
22
  const resolveAfterPending = () => {
23
- return new Promise((resolve) =>
24
23
  /**
25
- * Testing found that enqueuing a single microtask would sometimes result in
26
- * the Promise being resolved before the microtask queue was drained.
24
+ * This uses a brute force implementation that will continue to enqueue
25
+ * microtasks 1000 times before resolving. This is to ensure that the
26
+ * microtask queue is drained, even if the microtask queue is being
27
+ * manipulated by other code.
27
28
  *
28
- * Double enqueueing does not guarantee that the queue will be empty (e.g.
29
- * if a microtask enqueues another microtask as this does), but this does
30
- * ensure that step tooling that pushes to this stack intentionally will be
31
- * correctly detected and supported.
29
+ * While this still doesn't guarantee that the microtask queue is drained,
30
+ * it's our best bet for giving other non-controlled promises a chance to
31
+ * resolve before we continue without resorting to falling in to the next
32
+ * tick.
32
33
  */
33
- queueMicrotask(() => queueMicrotask(() => resolve())));
34
+ return new Promise((resolve) => {
35
+ let i = 0;
36
+ const iterate = () => {
37
+ queueMicrotask(() => {
38
+ if (i++ > 1000) {
39
+ return resolve();
40
+ }
41
+ iterate();
42
+ });
43
+ };
44
+ iterate();
45
+ });
34
46
  };
35
47
  exports.resolveAfterPending = resolveAfterPending;
36
48
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"promises.js","sourceRoot":"","sources":["../../src/helpers/promises.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACI,MAAM,mBAAmB,GAAG,GAAqB,EAAE;IACxD,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;AACtC,CAAC,CAAC;AAFW,QAAA,mBAAmB,uBAE9B;AAEF;;;GAGG;AACI,MAAM,mBAAmB,GAAG,GAAkB,EAAE;IACrD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;IAC7B;;;;;;;;OAQG;IACH,cAAc,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,CACtD,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,mBAAmB,uBAa9B;AAEF;;GAEG;AACI,MAAM,eAAe,GAAG,GAAkB,EAAE;IACjD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,E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