Skip to content

Conversation

@robmen
Copy link
Contributor

@robmen robmen commented Feb 7, 2025

Description (required)

The Cloudflare example using astro;env did not work because it was missing the context. Adding /server fixed it for me, so I thought I'd send the change your way. If there is a better fix, please feel free to close this PR with a better one. 😄

Related issues & labels (optional)

  • Closes #
  • Suggested label:

@netlify
Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 3fe1d3b
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/67e5f13032762f000891be8a
😎 Deploy Preview https://deploy-preview-10913--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@astrobot-houston
Copy link
Contributor

astrobot-houston commented Feb 7, 2025

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/reference/modules/astro-env.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@astrobot-houston
Copy link
Contributor

Hello! Thank you for opening your first PR to Astro’s Docs! 🎉

Here’s what will happen next:

  1. Our GitHub bots will run to check your changes.
    If they spot any broken links you will see some error messages on this PR.
    Don’t hesitate to ask any questions if you’re not sure what these mean!

  2. In a few minutes, you’ll be able to see a preview of your changes on Netlify 🥳.

  3. One or more of our maintainers will take a look and may ask you to make changes.
    We try to be responsive, but don’t worry if this takes a few days.

@sarah11918
Copy link
Member

Thanks for this @robmen ! I suspect this is exactly the change needed, but I'll tag @florian-lefebvre in to also confirm whether we should be updating this reference page/example so that we're always importing from either /client or /server everywhere we show it!

Copy link
Member

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

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

Perfect thanks!

@florian-lefebvre
Copy link
Member

florian-lefebvre commented Feb 7, 2025

Yes the reference should be updated too, to use astro:env/server

@sarah11918
Copy link
Member

Thanks Florian!

@robmen Would you be able to also add the change to the reference page I linked above in my last comment?

@robmen
Copy link
Contributor Author

robmen commented Mar 12, 2025

It took me a while to get back to this but I finally made the other requested update.

@robmen robmen requested a review from florian-lefebvre March 12, 2025 18:28

## Imports from `astro:env`

```js
Copy link
Member

Choose a reason for hiding this comment

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

@sarah11918 I wonder if should remove this codeblock entirely. There's another one below that is more useful

Copy link
Member

Choose a reason for hiding this comment

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

I'll ask @ArmandPhilippot to confirm, but normally this section is "everything available to import from the module". Where I guess it's a bit odd is that a user can configure other things that get imported from here, but we obviously can't know them ahead of time.

I would say we would typically keep this, to show the API. Do you agree Armand?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, this module is a bit special because it only has getSecret and we can import other "unfrozen" things... But, yes, I agree I think we should stay consistent with the other modules. When navigating from page to page within the same set, I think it can be helpful to keep the same structure.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you! Then I say let's get that money!!

@sarah11918 sarah11918 added the improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) label Mar 20, 2025
@sarah11918 sarah11918 added the Merge Queue Approved and ready to be merged (wait for feature release if also labelled M-O-R)! label Mar 28, 2025
@sarah11918
Copy link
Member

Well, we let this PR sit so long that we actually fixed the Cloudflare limitation! 😅

But, we still have the other /server to add, so thank you, Rob! 🫡

@sarah11918 sarah11918 merged commit 1101076 into withastro:main Mar 28, 2025
10 checks passed
ArmandPhilippot added a commit to ArmandPhilippot/astro-docs that referenced this pull request Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) Merge Queue Approved and ready to be merged (wait for feature release if also labelled M-O-R)!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants