Skip to content

Conversation

@ematipico
Copy link
Member

Changes

This PR does a bit of cleanup of the internal code, here's the list of the changes:

  • getApp is now createApp
  • createExports is now called createAstroServerApp
  • actions and middleware, in dev (when using our astro server), aren't loaded anymore using the module loader. Instead, they're injected using the same pattern we use inside createApp. loadMiddleware and loadActions are now removed
  • because of that, the RenderContext now accepts a skipMiddleware flag. We were already using the "skip middleware" concpet at "caller level", in case we need to call the middleware during the rendering. This isn't needed anymore, since the render context handles it by passing the flag. I think it's way easier this way

Testing

Middleware and actions test are still passing

Docs

@changeset-bot
Copy link

changeset-bot bot commented Oct 29, 2025

⚠️ No Changeset found

Latest commit: 07df2cf

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: integration Related to any renderer integration (scope) pkg: astro Related to the core `astro` package (scope) labels Oct 29, 2025
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.

Looks very good overall! One comment

@ematipico
Copy link
Member Author

@florian-lefebvre do you know how to tell knip that something is actually used?

Unused files (1)
packages/astro/src/vite-plugin-app/createAstroServerApp.ts

@florian-lefebvre
Copy link
Member

I think you should add the file to knip.js packages/astro entry array. Otherwise there's the @lintignore comment but it's not the thing we want here IMO

@ematipico ematipico merged commit 05b8ff9 into feat/environment-api Oct 30, 2025
7 of 17 checks passed
@ematipico ematipico deleted the env-api/cleanup-apps branch October 30, 2025 11:51
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) pkg: integration Related to any renderer integration (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants