-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INN-2754 Add support for INNGEST_DEV
#488
Conversation
🦋 Changeset detectedLatest commit: bc74a5a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
A user has added the prerelease/inngest label, so this PR will be published to npm with the tag You can install this prerelease version with: npm install inngest@pr-488 The last release was built and published from bc74a5a. |
LGTM, but the combination of the 2 modes + explicit/implicit is a bit of a mind f 😄 |
One additional thought: the |
Yeah, I was thinking of this too. There are so many ways to configure it at this point, though; I'm worried about perpetually making this more and more complex.
TypeScript also has to perform most of these checks twice, as environment variables can sometimes be delayed and given in request args instead of in the actual environment. tbh the end result is that (mostly) the user only has to care about a single environment variable. I doubt that the ordering of these will be much of a consideration/issue for most. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Looks good. I left a few suggestions on language but I'm approving already.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## inngest@3.15.0 ### Minor Changes - [#488](#488) [`3d2429d`](3d2429d) Thanks [@jpwilliams](https://github.com/jpwilliams)! - INN-2754 Add support for `INNGEST_DEV` and the `isDev` option, allowing a devleoper to explicitly set either Cloud or Dev mode ### Patch Changes - [#498](#498) [`7c5b92e`](7c5b92e) Thanks [@sylwiavargas](https://github.com/sylwiavargas)! - Add keywords to the npm package Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Summary
Adds support for
INNGEST_DEV
and a newisDev
option on the client.This lightly refactors the current checks based around
isProd
andskipDevServer()
, which were getting a little difficult to read."dev"
and"cloud"
.v3.x.x
) version of the SDK can make a decision to attempt to contact the Dev Server. Future versions will remove this and default to"cloud"
mode.INNGEST_DEV
environment variable or theisDev
client option explicitly sets the mode to either"cloud"
or"dev"
.INNGEST_DEV
accepts some sensible defaults. We'll recommend1
to explicitly set"dev"
mode and0
to explicitly set"cloud"
mode, though it also accepts"true"
,"y"
,"no"
, etc.INNGEST_BASE_URL
,INNGEST_API_BASE_URL
, andINNGEST_EVENT_API_BASE_URL
.Note
To support many runtimes and environments, environment variables are not always accessible a) at all times, and b) on
process.env
. Sometimes environment variables are accessed via different global objects, or sometimes runtime objects that are passed to requests.For this reason, handling environment variables is more complex and relies on making best guesses during instantiation, then later making another decision when we have access to the environment.
Supersedes both #424 and #425.
Checklist
Related
INNGEST_DEV
andisDev
website#679