Skip to content
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

Docs: Minor updates to the Environment variables docs #23605

Merged
merged 3 commits into from
Jul 25, 2023

Conversation

jonniebigodes
Copy link
Contributor

With this pull request, the Environment variables documentation was updated to factor in some information about Vite and how to obtain environment variables specific to this builder.

What was done:

  • Minor wording tweaks
  • Consolidated the snippets to become framework agnostic to reduce the maintenance cost
  • Introduced conditional rendering of the documentation to avoid confusion

Closes #23528

@IanVS, when you have a moment, can you take a look and let me know of any feedback you have? Appreciate it

How to test

  1. Follow the steps in the contributing instructions for this branch, chore_env_vars_tweaks.

  2. Open the relevant documentation, and for Vite frameworks, you should see a similar section added to the documentation

framework-conditional-render-vite-support

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli/src/sandbox-templates.ts
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "build", "documentation", "maintenance", "dependencies", "other"]

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

@jonniebigodes jonniebigodes added documentation patch:yes Bugfix & documentation PR that need to be picked to main branch ci:normal labels Jul 25, 2023
@jonniebigodes jonniebigodes requested a review from IanVS July 25, 2023 16:31
@jonniebigodes jonniebigodes self-assigned this Jul 25, 2023
docs/configure/environment-variables.md Outdated Show resolved Hide resolved

### Environment variables are not working

If you're trying to use framework-specific environment variables (e.g.,`VUE_APP_`), you may run into issues primarily due to the fact that Storybook and your framework may have specific configurations and may not be able to recognize and use those environment variables. If you run into a similar situation and are interested in helping us improving support for this feature, we encourage you to reach out to the maintainers using the default communication channels (e.g., [Discord server](https://discord.com/channels/486522875931656193/570426522528382976), [GitHub issues](https://github.com/storybookjs/storybook/issues)).
Copy link
Member

Choose a reason for hiding this comment

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

Storybook and your framework may have specific configurations and may not be able to recognize and use those environment variables.

This is where envPrefix can be used, right? Is that worth mentioning here instead of making it seem like there is no solution?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a great catch, and we can pivot the documentation toward it and provide a workaround for this for now. I'll update it shortly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@IanVS just updated this based on your suggestion. Let me know, and we'll go from there.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, I think this is good. For some reason I thought that envPrefix was a storybook option, but you're right it's in Vite. I believe we do read that option though when deciding which env variables to expose to stories. So, ideally environment variables should "just work" from Storybook's perspective. But doesn't hurt to point it out and give folks the option to contact us if something wonky is happening.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem. Appreciate you taking the time to review it and point me in that direction 🙇 .

Copy link
Member

@IanVS IanVS left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for the updates!

@jonniebigodes jonniebigodes merged commit 265f214 into next Jul 25, 2023
15 checks passed
@jonniebigodes jonniebigodes deleted the chore_env_vars_tweaks branch July 25, 2023 20:16
storybook-bot pushed a commit that referenced this pull request Jul 25, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
Copy link
Contributor

@kylegach kylegach left a comment

Choose a reason for hiding this comment

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

Thanks for these updates! I'm good with merging this as-is for now, but we should consider restructuring this page to divide it into process.env and import.meta.env sections.

@jonniebigodes
Copy link
Contributor Author

I'm aware of this, I just wanted to get the information in for now, so that we flush it out later on in more detail later on.

storybook-bot pushed a commit that referenced this pull request Jul 26, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
@github-actions github-actions bot mentioned this pull request Jul 26, 2023
30 tasks
storybook-bot pushed a commit that referenced this pull request Jul 26, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Jul 26, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Jul 26, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Jul 26, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Jul 26, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Jul 27, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Jul 27, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Jul 27, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Jul 28, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Jul 28, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Jul 28, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Jul 31, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Jul 31, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 1, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 1, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 1, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 1, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 1, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 2, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 2, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 2, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 2, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 3, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
@github-actions github-actions bot mentioned this pull request Aug 3, 2023
32 tasks
storybook-bot pushed a commit that referenced this pull request Aug 4, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 7, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 7, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 7, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 7, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 8, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 9, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 9, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
storybook-bot pushed a commit that referenced this pull request Aug 9, 2023
Docs: Minor updates to the Environment variables docs
(cherry picked from commit 265f214)
@kasperpeulen kasperpeulen removed the patch:yes Bugfix & documentation PR that need to be picked to main branch label Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Documentation]: Extend the Environment variables documentation for VITE_ environment variables docs
4 participants