Skip to content

Releases: inngest/envelop-plugin-inngest

inngest-setup-redwoodjs@1.0.0

21 Jun 16:03
1689faf
Compare
Choose a tag to compare

Major Changes

  • #153
    6026af1
    Thanks @dthyresson! - Updates to Inngest SDK v2

    Breaking Changes

    Inngest SDK v2 has some breaking changes that will require some manual code change to existing
    apps.

    Logging

    Logging has changed in v2. See: https://www.inngest.com/docs/guides/logging.

    It is now set in the client and used as part of Inngest's middleware. The plugin will try to use
    the Inngest client's logger first and then this logger setting.

    // api/src/lib/inngest.ts
    import { Inngest } from 'inngest';
    import { logger } from './logger';
    
    export const INNGEST_APP_NAME = 'Redwood_Inngest';
    
    export const inngest = new Inngest({
      /**
       * The name of this instance, most commonly the name of the application it
       * resides in.
       */
      name: INNGEST_APP_NAME,
      /**
       * Inngest event key, used to send events to Inngest Cloud. If not provided,
       * will search for the `INNGEST_EVENT_KEY` environment variable. If neither
       * can be found, however, a warning will be shown and any attempts to send
       * events will throw an error.
       */
      eventKey: 'YOUR_INNGEST_EVENT_KEY',
      /**
       * Use the api logger for Inngest function logging, useful in scheduled functions
       */
      logger: logger,
      logLevel: 'info',
    });

    Delayed Functions

    In addition to delaying via a sleep duration, you can now sleepUntil a timestamp or a variable
    in event data:

      async ({ event, step }) => {
         await step.sleep('5s')
    
         // You can run jobs at a specific time using the step.sleepUntil() utility:
         // await step.sleepUntil("2023-04-01T12:30:00");
    
         // You can also sleep until a timestamp within the event data.  This lets you
         // pass in a time for you to run the job:
         // await step.sleepUntil(event.data.run_at) // Assuming event.data.run_at is a timestamp.

    Scheduled Functions

    A scheduled function now uses the logger to output success rather than a payload message.

    Note that one can access Inngest's logger set on the client from the event:

      async (event) => {
         const payload = {
           message: `Scheduled ${humanizedName} function ran.`,
           runAt: Date.now().toString(),
         }
         event.logger.debug(payload, `${humanizedName} function ran.`)
       }
     )

    RedwoodJS

    1. The api/src/functions/inngest.ts function has several changes:
    • In the serve handler, instead of the INNGEST_APP_NAME now one passes the complete inngest
      client.
    // Serve your Inngest functions
    export const handler = serve(inngest, inngestFunctions,

    This name is still defined in api/src/lib/inngest.ts:

    export const INNGEST_APP_NAME = 'Redwood_Inngest'
    
    export const inngest = new Inngest({
      /**
       * The name of this instance, most commonly the name of the application it
       * resides in.
       */
      name: INNGEST_APP_NAME,
    1. RedwoodJS v6 canary builds may need the serve path to be
      servePath: '/.redwood/functions/inngest' instead of simply /inngest.

    One you then start the Inngest dev server as:

    npx inngest-cli@latest dev -u http://localhost:8910/.redwood/functions/inngest

envelop-plugin-inngest@1.0.0

21 Jun 16:03
1689faf
Compare
Choose a tag to compare

Major Changes

  • #153
    6026af1
    Thanks @dthyresson! - Updates to Inngest SDK v2

    Breaking Changes

    Inngest SDK v2 has some breaking changes that will require some manual code change to existing
    apps.

    Logging

    Logging has changed in v2. See: https://www.inngest.com/docs/guides/logging.

    It is now set in the client and used as part of Inngest's middleware. The plugin will try to use
    the Inngest client's logger first and then this logger setting.

    // api/src/lib/inngest.ts
    import { Inngest } from 'inngest';
    import { logger } from './logger';
    
    export const INNGEST_APP_NAME = 'Redwood_Inngest';
    
    export const inngest = new Inngest({
      /**
       * The name of this instance, most commonly the name of the application it
       * resides in.
       */
      name: INNGEST_APP_NAME,
      /**
       * Inngest event key, used to send events to Inngest Cloud. If not provided,
       * will search for the `INNGEST_EVENT_KEY` environment variable. If neither
       * can be found, however, a warning will be shown and any attempts to send
       * events will throw an error.
       */
      eventKey: 'YOUR_INNGEST_EVENT_KEY',
      /**
       * Use the api logger for Inngest function logging, useful in scheduled functions
       */
      logger: logger,
      logLevel: 'info',
    });

    Delayed Functions

    In addition to delaying via a sleep duration, you can now sleepUntil a timestamp or a variable
    in event data:

      async ({ event, step }) => {
         await step.sleep('5s')
    
         // You can run jobs at a specific time using the step.sleepUntil() utility:
         // await step.sleepUntil("2023-04-01T12:30:00");
    
         // You can also sleep until a timestamp within the event data.  This lets you
         // pass in a time for you to run the job:
         // await step.sleepUntil(event.data.run_at) // Assuming event.data.run_at is a timestamp.

    Scheduled Functions

    A scheduled function now uses the logger to output success rather than a payload message.

    Note that one can access Inngest's logger set on the client from the event:

      async (event) => {
         const payload = {
           message: `Scheduled ${humanizedName} function ran.`,
           runAt: Date.now().toString(),
         }
         event.logger.debug(payload, `${humanizedName} function ran.`)
       }
     )

    RedwoodJS

    1. The api/src/functions/inngest.ts function has several changes:
    • In the serve handler, instead of the INNGEST_APP_NAME now one passes the complete inngest
      client.
    // Serve your Inngest functions
    export const handler = serve(inngest, inngestFunctions,

    This name is still defined in api/src/lib/inngest.ts:

    export const INNGEST_APP_NAME = 'Redwood_Inngest'
    
    export const inngest = new Inngest({
      /**
       * The name of this instance, most commonly the name of the application it
       * resides in.
       */
      name: INNGEST_APP_NAME,
    1. RedwoodJS v6 canary builds may need the serve path to be
      servePath: '/.redwood/functions/inngest' instead of simply /inngest.

    One you then start the Inngest dev server as:

    npx inngest-cli@latest dev -u http://localhost:8910/.redwood/functions/inngest

inngest-setup-redwoodjs@0.4.5

18 Jun 16:04
85628cb
Compare
Choose a tag to compare

Patch Changes

envelop-plugin-inngest@0.5.5

18 Jun 16:03
85628cb
Compare
Choose a tag to compare

Patch Changes

envelop-plugin-inngest@0.5.4

14 May 00:27
8e9f797
Compare
Choose a tag to compare

Patch Changes

envelop-plugin-inngest@0.5.3

13 May 23:09
8783ce6
Compare
Choose a tag to compare

Patch Changes

inngest-setup-redwoodjs@0.4.4

09 May 22:24
378ad15
Compare
Choose a tag to compare

Patch Changes

envelop-plugin-inngest@0.5.2

09 May 22:24
378ad15
Compare
Choose a tag to compare

Patch Changes

inngest-setup-redwoodjs@0.4.3

08 May 17:53
3569318
Compare
Choose a tag to compare

Patch Changes

inngest-setup-redwoodjs@0.4.2

08 May 16:18
7f5b3ba
Compare
Choose a tag to compare

Patch Changes

  • #108
    ae31562
    Thanks @dthyresson! - Improves the way RedwoodJS integrates its
    experimental setup cli command.