Skip to content

refactor: use ssr environment to load modules#14191

Merged
ematipico merged 12 commits intofeat/environment-apifrom
env-api/ssr-environment
Aug 7, 2025
Merged

refactor: use ssr environment to load modules#14191
ematipico merged 12 commits intofeat/environment-apifrom
env-api/ssr-environment

Conversation

@ematipico
Copy link
Copy Markdown
Member

Changes

This PR removes the use of ssrLoadModule in favour of the new way: pulling a runnable environment and use the function runner.import. Here's the docs: https://vite.dev/guide/api-environment-frameworks.html#runnabledevenvironment

Unfortunately there are few places where we pass the instances of the server, so for my next PR I will refactor those places to accept an environment instead of the instance of the server.

Testing

Current tests should pass

Docs

N/A

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Aug 6, 2025

⚠️ No Changeset found

Latest commit: b5e35ad

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 the pkg: astro Related to the core `astro` package (scope) label Aug 6, 2025
@ematipico ematipico force-pushed the env-api/ssr-environment branch from 09f001e to f1e9743 Compare August 6, 2025 09:32
@ematipico ematipico changed the title chore: use ssr environment to load modules refactor: use ssr environment to load modules Aug 6, 2025
@ematipico ematipico force-pushed the env-api/ssr-environment branch from f1e9743 to 5223cb9 Compare August 6, 2025 11:12
@ematipico ematipico force-pushed the env-api/ssr-environment branch from 5223cb9 to 3bee8e9 Compare August 6, 2025 11:32
@ematipico ematipico force-pushed the env-api/ssr-environment branch from 3bee8e9 to 4cd8c3e Compare August 6, 2025 12:14
@ematipico ematipico force-pushed the env-api/ssr-environment branch from 644d10f to cb5103a Compare August 6, 2025 13:10
@ematipico ematipico merged commit 8e76060 into feat/environment-api Aug 7, 2025
25 of 26 checks passed
@ematipico ematipico deleted the env-api/ssr-environment branch August 7, 2025 12:30
ematipico added a commit that referenced this pull request Sep 3, 2025
* refactor: use environments to load modules (#14191)

* refactor: make `App` more extensible using `BaseApp` (#14197)

* refactor: App to extends the new BaseApp (#14213)

* refactor: manifest as virtual module (#14298)

* refactor: create `generate` when needed

* fix type

* remove type

* fix types

* fix breakage of code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants