Skip to content

Deprecate Oxygen.env in favor of Hydrogen.env#2150

Open
blittle wants to merge 3 commits into
v1.x-2022-07from
bl-hydrogen-env
Open

Deprecate Oxygen.env in favor of Hydrogen.env#2150
blittle wants to merge 3 commits into
v1.x-2022-07from
bl-hydrogen-env

Conversation

@blittle

@blittle blittle commented Sep 16, 2022

Copy link
Copy Markdown
Contributor

Description

Oxygen.env is now deprecated in favor of Hydrogen.env. Access environment variables within your server components on Hydrogen.env. We hope this will make more sense when deploying to non-Oxygen environments.

Additional context

Part of Shopify/hydrogen#1879


Before submitting the PR, please make sure you do the following:

  • Read the Contributing Guidelines
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123)
  • Update docs in this repository according to your change
  • Run yarn changeset add if this PR cause a version bump based on Keep a Changelog and adheres to Semantic Versioning

description: Learn how to store sensitive information in your Hydrogen project.
---

Environment variables, also known as secrets, allow you to load different values in your app depending on the running environment. This guide describes how to store environment variables in your Hydrogen project.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rennyG I rewrote some of this documentation in a way I hope will be less confusing. Let me know if you'd like to sync up and go over it together.

@frandiox I'd love your thoughts on this as well

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still thinking if we should provide Hydrogen.env in the browser with all the public variables... other than that, I think this is clear since now we don't have a distinction between public and private variables anymore.

Comment thread .changeset/dry-rabbits-tell.md

@cartogram cartogram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs and code changes make sense 👍

@frandiox frandiox left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks good, thanks! I was worried about the behavior around PUBLIC_ but I see it was already changed in Shopify/hydrogen@7f97229 👍

@rennyG rennyG left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content looks good, just a couple suggestions

Comment thread docs/framework/environment-variables.md Outdated
Comment thread docs/framework/environment-variables.md Outdated
Comment thread docs/framework/environment-variables.md Outdated
Comment thread docs/framework/environment-variables.md Outdated
Comment thread docs/framework/environment-variables.md Outdated
@rennyG

rennyG commented Sep 21, 2022

Copy link
Copy Markdown
Contributor

@blittle make sure you tophat this on .dev before shipping

@rennyG rennyG closed this Sep 21, 2022
@rennyG rennyG reopened this Sep 21, 2022
Co-authored-by: Ren Chaturvedi <63201605+rennyG@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants