inngest@3.42.0
Minor Changes
-
#920
0da1995Thanks @jpwilliams! - AddedisInngest,isInngestFunction, andisInngestMiddleware, runtime helpers to check if a given object is the expected type.import { isInngest, isInngestFunction, isInngestMiddleware } from "inngest"; const objIsInngest = isInngest(someObj); const objIsInngestFunction = isInngestFunction(someObj); const objIsInngestMiddleware = isInngestMiddleware(someObj);
-
#920
0da1995Thanks @jpwilliams! - Add support for Standard Schema when specifying event types.import { EventSchemas } from "inngest"; import { z } from "zod"; const schemas = new EventSchemas().fromSchema({ "demo/event.sent": z.object({ username: z.string(), }), });
This entrypoint can be used for both Zod v3 and v4 schemas, as well as a multitude of others.
.fromZod()is still available, which provides some more nuanced use cases but will is deprecated in favor of.fromSchema().
Patch Changes
-
#920
0da1995Thanks @jpwilliams! - Dropped support for Node 14, 16, and 18, as they are out of LTS -
#920
0da1995Thanks @jpwilliams! -inngestno longer requires an earlier version ofzod@3.22.0as a peer dependency -
#920
0da1995Thanks @jpwilliams! - Now builds separate EJS and CSM packages, which should alleviate some issues attempting to get the current single build to satisfy all conditions.Most notably, pure ESM consumers should now have a significantly easier time using the library.
-
#920
0da1995Thanks @jpwilliams! - UseSymbol.toStringTagfor*.Liketypes, making them much more reliable across versions.This means you can check for the type of value against Inngset values much more easily:
type IsInngest<T> = T extends Inngest.Like ? true : false; type IsInngestFunction = T extends InngestFunction.Like ? true : false; type IsInngestMiddleware = T extends InngestMiddleware.Like ? true : false;
In addition, logged objects that are these types now show the type instead of just
[object Object], e.g.[object Inngest.App]. -
#920
0da1995Thanks @jpwilliams! - Middleware now runs like onion layers. For example{ middleware: [foo, bar] }now runs:foo.transformInputbar.transformInputfoo.beforeMemoizationbar.beforeMemoizationbar.afterMemoizationfoo.afterMemoizationfoo.beforeExecutionbar.beforeExecutionbar.afterExecutionfoo.afterExecutionbar.transformOutputfoo.transformOutputfoo finishedbar finishedfoo beforeResponsebar beforeResponse
This should enable middleware to behave correctly when it has to wrap other middleware.
-
#920
0da1995Thanks @jpwilliams! - Drop support for TypeScript 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6 and 5.7