Skip to content

Conversation

@ematipico
Copy link
Member

Changes

We need the App to be fully extendable and more flexible, so it can be used in other environments that aren't Node.js. At the moment it is exclusively used inside adapters, however, we foresee its usage in dev and the possibility of build too.

This PR creates a new abstract BaseApp that implements all the methods inside the App class. The only method that must be implemented is createPipeline.

The function AppPipeline.create has been dramatically simplified, since many of the arguments that we were passing can be computed from the manifest, and some other values were hardcoded. AppPipeline is also exposed because the creation of new "Apps" that extend App requires the implementation of cratePipeline. I didn't create a default implementation of createPipeline because of P and AppPipeline (TypeScript doesn't like it). If you know how to fix it, please let me know how.

The method AppPipeline.getModuleForRoute has been moved inside BasePipeline. There's a chance we could reuse it.

Testing

This is a refactor, so the entire CI should stay green

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Aug 7, 2025

⚠️ No Changeset found

Latest commit: 5038e54

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 7, 2025
@ematipico ematipico changed the title refactor: use environments to load modules (#14191) refactor: make App more extensible using BaseApp Aug 8, 2025
@ematipico ematipico merged commit f323dfc into feat/environment-api Aug 11, 2025
25 of 26 checks passed
@ematipico ematipico deleted the env-api/create-abstract-class branch August 11, 2025 12:03
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