-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
## Summary <!-- Succinctly describe your change, providing context, what you've changed, and why. --> Adds support for `INNGEST_DEV` and a new `isDev` option on the client. This lightly refactors the current checks based around `isProd` and `skipDevServer()`, which were getting a little difficult to read. - The SDK now has two "modes:" `"dev"` and `"cloud"`. - Each mode is either **explicit** or **inferred**. An inferred mode means that the current (`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. - Setting the `INNGEST_DEV` environment variable or the `isDev` client option **explicitly** sets the mode to either `"cloud"` or `"dev"`. - `INNGEST_DEV` accepts some sensible defaults. We'll recommend `1` to explicitly set `"dev"` mode and `0` to explicitly set `"cloud"` mode, though it also accepts `"true"`, `"y"`, `"no"`, etc. - Explicitly setting either mode also sets the event ingestion and syncing URLs. They continue to be further overwritten by passing `INNGEST_BASE_URL`, `INNGEST_API_BASE_URL`, and `INNGEST_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 <!-- Tick these items off as you progress. --> <!-- If an item isn't applicable, ideally please strikeout the item by wrapping it in "~~"" and suffix it with "N/A My reason for skipping this." --> <!-- e.g. "- [ ] ~~Added tests~~ N/A Only touches docs" --> - [x] Added a [docs PR](https://github.com/inngest/website) documenting these modes and the new environment variables that references this PR - [x] Added unit/integration tests - [x] Added changesets if applicable - [x] Push env-related changes to the OS SDK Spec ## Related <!-- A space for any related links, issues, or PRs. --> <!-- Linear issues are autolinked. --> <!-- e.g. - INN-123 --> <!-- GitHub issues/PRs can be linked using shorthand. --> <!-- e.g. "- inngest/inngest#123" --> <!-- Feel free to remove this section if there are no applicable related links.--> - INN-2754 - Supersedes #424 - Supersedes #425 - inngest/website#679
- Loading branch information
1 parent
2e267dc
commit 3d2429d
Showing
9 changed files
with
390 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"inngest": minor | ||
--- | ||
|
||
INN-2754 Add support for `INNGEST_DEV` and the `isDev` option, allowing a devleoper to explicitly set either Cloud or Dev mode |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.