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

feat(env): server/public variables #10881

Merged
merged 48 commits into from May 6, 2024

Conversation

florian-lefebvre
Copy link
Member

Depends on #10848

Changes

  • Handles the server module id
  • Throws if module is imported client-side

Testing

  • Adds a fixture and some tests

Docs

N/A

Copy link

changeset-bot bot commented Apr 25, 2024

⚠️ No Changeset found

Latest commit: fccfc35

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) docs pr A PR that includes documentation for review labels Apr 25, 2024
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Should we have some test case for output: "hybrid" with prerendered pages (opt-in and opt-out)?

Comment on lines +1171 to +1179
/**
* @docs
* @description
* Module is only available server-side
*/
export const EnvServerOnlyModule = {
name: 'EnvServerOnlyModule',
title: 'Module is only available server-side',
message: (name: string) => `The "${name}" module is only available server-side.`,
Copy link
Member

Choose a reason for hiding this comment

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

Some thoughts for myself: I know we have a few virtual modules that currently only meant to work in the server-side only. Maybe we can consider making this more generic later. We don't have to change this now.

@florian-lefebvre florian-lefebvre merged commit 87ea8ab into feat/astro-env May 6, 2024
14 checks passed
@florian-lefebvre florian-lefebvre deleted the feat/astro-env-server-public branch May 6, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs pr A PR that includes documentation for review pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants