Skip to content

Refactor internal request handling into a functional core - #17636

Open
matthewp wants to merge 13 commits into
mainfrom
fetch-refactor-2
Open

Refactor internal request handling into a functional core#17636
matthewp wants to merge 13 commits into
mainfrom
fetch-refactor-2

Conversation

@matthewp

@matthewp matthewp commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Primary purpose of this pull-request is to refactor internal requests to get rid of the Pipeline and App classes as used internally. These were essentially "god objects" that held state related to the server-side app.
  • The problem with these objects were that there was no way to pass them into FetchState when access from outside of the App class. For example in Cloudflare you can create a custom worker which is the entrypoint to the application.
  • I realized that the manifest is the one true god-object in SSR, and we could simply derive all state from that. So this new architecture is much more functional. Derived state is created as createManifestMemo and createAsyncManifestMemo which are keyed on the manifest. Anything that needs this state can simply import it now.
  • Everything else in this PR is just conforming to the above.
  • App remains as its the external API for adapters, but mostly just defers to the functional approach now.

Fixes #17591

Testing

  • Mostly refactored existing tests which relied in the Pipeline.

Docs

  • N/A, just a refactor

Replace the App/Pipeline god objects with pure functions drawing static
data from the manifest (the only permitted ambient source of truth):

- All internal handler classes (AstroHandler, PagesHandler, AstroMiddleware,
  CacheHandler, ActionHandler, I18n, Rewrites, TrailingSlashHandler, error
  handlers, session provider) are now module functions rooted in FetchState.
- FetchState constructs from (manifest, request, options?, hooks?); the
  public one-arg new FetchState(request) works from a bare Request by
  reaching the manifest module directly (ambient), with no app handle.
- Symbol.for('astro.app') and Symbol.for('astro.pipeline') are deleted;
  nothing static rides the request. Render options carry only render()
  inputs.
- Environment differences (prod SSR, dev runnable/non-runnable, build,
  container) are per-manifest RenderEnvironment records composed at
  entrypoint time; production is the zero-setup default.
- Process-lifetime derivations (route table, middleware, actions, session
  driver, cache provider, logger, renderers) are WeakMap memos keyed by
  the manifest in their owning modules.
- App and NodeApp remain public facades with unchanged signatures; every
  method delegates to the functional core. app.pipeline survives as a
  stateless compat shim. Pipeline base and all subclasses are deleted.
- Dev HMR route updates are now atomic (fixes stale-router split-brain).

No public API changes. All suites green: unit, full integration,
@astrojs/node, @astrojs/cloudflare (workerd), dev/HMR.
@changeset-bot

changeset-bot Bot commented Aug 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e4ce203

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 419 packages
Name Type
astro Patch
@astrojs/node Patch
@e2e/astro-linked-lib Patch
@e2e/actions-blog Patch
@e2e/actions-react-19 Patch
@e2e/astro-component Patch
@e2e/astro-envs Patch
@e2e/astro-island-hydration-error Patch
@test/astro-cloudflare-node-prerender-mdx Patch
@test/astro-cloudflare Patch
@e2e/content-collections Patch
@e2e/csp-server-islands Patch
@e2e/css Patch
@test/custom-client-directives Patch
@e2e/dev-toolbar Patch
@e2e/error-cyclic Patch
@e2e/error-sass Patch
@e2e/errors Patch
@e2e/hydration-race Patch
@e2e/i18n Patch
@test/nested-style-bug-e22e Patch
@e2e/preact-compat-component Patch
@e2e/preact-component Patch
@e2e/preact-lazy-component Patch
@e2e/prefetch Patch
@e2e/react-component Patch
@e2e/server-islands-key Patch
@e2e/server-islands Patch
@e2e/solid-circular Patch
@e2e/solid-component Patch
@e2e/solid-recurse Patch
@e2e/svelte-component Patch
@e2e/e2e-tailwindcss Patch
@e2e/ts-resolution Patch
@e2e/view-transitions Patch
@e2e/vue-component Patch
@performance/md Patch
@performance/mdoc Patch
@performance/mdx Patch
@test/0-css Patch
fake-astro-library Patch
@test/actions Patch
@test/alias-css-url-data-uri Patch
@test/alias-css-url Patch
@test/alias-path-alias-style Patch
@test/ts-paths-no-baseurl Patch
@test/aliases-tsconfig Patch
@test/aliases Patch
@test/api-routes Patch
@test/asset-query-params-chunks Patch
@test/asset-url-base Patch
@test/astro-pages Patch
@test/astro-assets-prefix Patch
@test/astro-assets Patch
@test/astro-basic Patch
@test/astro-check-errors Patch
@test/astro-check-no-errors Patch
@test/astro-check-watch Patch
@test/astro-children Patch
@test/astro-client-only Patch
@test/astro-component-bundling Patch
@test/astro-component-code Patch
@test/astro-css-bundling Patch
@test/astro-dev-headers Patch
@test/astro-dev-http2 Patch
@test/astro-doctype Patch
@test/astro-dynamic Patch
@test/astro-env-content-collections Patch
@test/astro-env-required-public Patch
@test/astro-env-server-fail Patch
@test/astro-env-server-secret Patch
@test/astro-env Patch
@test/astro-envs Patch
@test/astro-expr Patch
@test/astro-get-static-paths Patch
@test/astro-head Patch
@test/astro-manifest-client-script Patch
@test/astro-manifest-invalid Patch
@test/astro-manifest Patch
@test/astro-markdown-frontmatter-injection Patch
@test/astro-markdown-plugins Patch
@test/astro-markdown-remarkRehype Patch
@test/astro-markdown-skiki-default-color Patch
@test/astro-markdown-skiki-langs Patch
@test/astro-markdown-skiki-themes-custom Patch
@test/astro-markdown-skiki-themes-integrated Patch
@test/astro-markdown-skiki-wrap-false Patch
@test/astro-markdown-skiki-wrap-null Patch
@test/astro-markdown-skiki-wrap-true Patch
@test/astro-markdown-url Patch
@test/astro-markdown Patch
@test/astro-mode Patch
@test/astro-page-directory-url Patch
@test/astro-partial-html Patch
@test/astro-preview-allowed-hosts Patch
@test/astro-preview-headers Patch
@test/astro-public Patch
@test/astro-script-template-dedup Patch
@test/astro-scripts Patch
@test/astro-slots-nested Patch
@test/concurrency Patch
@test/build-readonly-file Patch
@test/cache-memory-query-include Patch
@test/cache-memory-query Patch
@test/client-address-node Patch
@test/client-only-child-styles Patch
@test/client-only-css-chunk-leak Patch
@test/code-component Patch
@test/component-library Patch
@test/config-vite-css-target-no-minify Patch
@test/config-vite-css-target Patch
@test/config-vite Patch
@test/react-container Patch
@test/content-with-spaces-in-folder-name Patch
@test/content-collection-picture-render Patch
@example/content-collection-references Patch
@test/content-collection-tla-svg Patch
@test/content-collections-base Patch
@test/content-collections-empty-dir Patch
@test/content-collections-empty-md-file Patch
@test/content-collections-image-hmr Patch
@test/content-collections-mutation Patch
@test/content-collections-number-id Patch
@test/content-collections-type-inference Patch
@test/content-collections-with-config-mjs Patch
@test/content-collections Patch
@test/content-frontmatter Patch
@test/content-intellisense Patch
@test/content-layer-loader-schema-function Patch
@test/content-layer-remark-plugins Patch
@test/content-layer Patch
@test/content-ssr-integration Patch
@test/content-static-paths-integration Patch
@test/content Patch
@test/core-image-data-url Patch
@test/core-image-deletion-ssr Patch
@test/core-image-deletion Patch
@test/core-image-errors Patch
@test/core-image-fs-config Patch
@test/core-image-remark-infersize Patch
@test/core-image-layout Patch
@test/core-image-picture-emit-file Patch
@test/core-image-remark-imgattr Patch
@test/core-image-ssg Patch
@test/core-image-ssr Patch
@test/core-image-svg-in-client Patch
@test/core-image-svg Patch
@test/core-image-unconventional-settings Patch
@test/core-image Patch
@test/csp-adapter Patch
@test/csp-fonts Patch
@test/csp Patch
@test/css-assets Patch
@test/css-dangling-references Patch
@test/css-deduplication Patch
@test/css-double-bundle Patch
@test/css-dynamic-import-dev Patch
@test/css-import-as-inline Patch
@test/css-inline-stylesheets Patch
@test/css-no-code-split Patch
@test/css-path-case Patch
@test/css-pure-chunk-query-params Patch
@test/css-server-output-dedup Patch
@test/custom-404-injected-from-dep Patch
@test/custom-404-pkg Patch
custom-fetch-error-pages Patch
@test/custom-renderer Patch
@test/data-collections-schema Patch
@test/data-collections Patch
@test/debug-component Patch
@test/dev-container Patch
@test/dev-render Patch
@test/dev-request-url Patch
@test/dynamic-endpoint-collision Patch
@test/dynamic-route-build-file Patch
@test/endpoint-routing Patch
@test/error-bad-js Patch
@test/error-build-location Patch
@test/error-non-error Patch
@test/extension-matching Patch
@test/fetch Patch
@test/fonts Patch
@test/astro-fontsource-package Patch
@test/get-static-paths-pages Patch
@test/glob-pages-css Patch
@test/head-propagation-prerender-env Patch
@test/hmr-markdown Patch
@test/hmr-middleware Patch
@test/hmr-new-page Patch
@test/hmr-slots-render Patch
@test/hoisted-imports Patch
@test/html-component Patch
@test/html-escape Patch
@test/html-page Patch
@test/html-slots Patch
@test/hydration-race Patch
@test/i18n-client-import Patch
@test/i18n-css-leak-basic Patch
@test/import-ts-with-js Patch
@test/impostor-md-file Patch
@test/incremental-build-client-only Patch
@test/incremental-build-concurrency Patch
@test/incremental-build-content Patch
@test/incremental-build-drop-key Patch
@test/incremental-build-dynamic-import Patch
@test/incremental-build-headers Patch
@test/incremental-build-images Patch
@test/incremental-build-islands Patch
@test/incremental-build-no-output Patch
@test/incremental-build-script Patch
@test/incremental-build Patch
@test/integration-add-page-extension Patch
@test/integration-server-setup Patch
@test/jsx-queue-rendering Patch
@test/large-array-solid Patch
@test/legacy-collections-backwards-compat Patch
@test/lightningcss-css-modules-content Patch
@test/lightningcss-scoped-nesting Patch
@test/live-loaders Patch
@test/markdown Patch
@test/middleware-dev Patch
@test/middleware-full-ssr Patch
@test/middleware-no-user-middlewaqre Patch
@test/middleware-tailwind Patch
@test/minification-html-default Patch
@test/minification-html-jsx Patch
@test/minification-html Patch
@test/non-ascii-path Patch
@test/non-html-pages Patch
@test/page-format Patch
@test/page-level-styles Patch
@test/parallel-components Patch
@test/partials-css-boundary Patch
@test/partials Patch
@test/passthrough-image-service Patch
@test/postcss Patch
@test/preact-compat-component Patch
@test/preact-component Patch
@test/remote-css Patch
@test/request-signal Patch
@test/reuse-injected-entrypoint Patch
@test/root-srcdir-css Patch
@test/scoped-style-strategy Patch
@test/server-entry-fake-adapter Patch
@test/server-entry Patch
@test/server-islands-hybrid Patch
@test/server-islands-ssr Patch
@test/session-false Patch
@test/session-tree-shake Patch
@test/sessions Patch
@test/slots-preact Patch
@test/slots-react Patch
@test/slots-solid Patch
@test/slots-svelte Patch
@test/slots-vue Patch
@test/solid-component Patch
@test/sourcemap Patch
@test/space-in-folder-name Patch
@test/special-chars-in-component-imports Patch
@test/ssr-assets Patch
@test/ssr-dynamic Patch
@test/ssr-partytown Patch
@test/ssr-prerender-get-static-paths Patch
@test/ssr-prerender Patch
@test/ssr-preview Patch
@test/ssr-renderers-static-vue Patch
@test/ssr-request Patch
@test/ssr-hoisted-script Patch
@test/ssr-scripts Patch
@test/static-build-code-component Patch
@test/static-build-dir Patch
@test/static-build-frameworks Patch
@test/static-build-page-url-format Patch
@test/static-build-ssr Patch
@test/static-build Patch
@test/static-redirect Patch
@test/svelte-component Patch
@test/svg-deduplication Patch
@test/tailwindcss Patch
@e2e/third-party-astro Patch
@test/url-import-suffix Patch
@test/view-transitions Patch
@test/virtual-astro-file Patch
@test/vite-virtual-modules Patch
@test/vitest Patch
@test/vue-component Patch
@test/vue-with-multi-renderer Patch
@test/alpinejs-basics Patch
@test/alpinejs-directive Patch
@test/alpinejs-plugin-script-import Patch
@test/astro-cloudflare-allowed-hosts Patch
@test/astro-cloudflare-astro-dev-platform Patch
@test/astro-cloudflare-astro-env Patch
@test/astro-cloudflare-binding-image-cache Patch
@test/astro-cloudflare-binding-image-service Patch
@test/astro-cloudflare-cache-provider-wait-until Patch
@test/astro-cloudflare-cache-provider Patch
@test/astro-cloudflare-client-address Patch
@test/astro-cloudflare-compile-custom-image-service Patch
@test/astro-cloudflare-compile-image-service Patch
@test/astro-cloudflare-custom-entryfile-fetch-state Patch
@test/astro-cloudflare-custom-entryfile Patch
@test/astro-cloudflare-custom-image-service Patch
@test/astro-cloudflare-dev-image-endpoint Patch
@test/astro-cloudflare-external-image-service Patch
@test/astro-cloudflare-external-redirects Patch
@test/cloudflare-incremental-images Patch
@test/astro-cloudflare-internal-redirects Patch
@test/astro-cloudflare-no-output Patch
@test/astro-cloudflare-prerender-node-env Patch
@test/astro-cloudflare-prerender-queue-consumers Patch
@test/astro-cloudflare-prerender-styles Patch
@test/astro-cloudflare-prerenderer-errors Patch
@test/astro-cloudflare-prerenderer-render-error Patch
@test/routing-priority-cloudflare Patch
@test/cf-server-entry Patch
@test/astro-cloudflare-server-island-prerender-framework Patch
@test/astro-cloudflare-sql-import Patch
@test/cf-ssr-deps Patch
@test/astro-cloudflare-static Patch
@test/astro-cloudflare-svelte-rune-deps Patch
@test/astro-cloudflare-top-level-return Patch
@test/cf-user-optimize-deps Patch
@test/astro-cloudflare-vite-plugin Patch
@test/astro-cloudflare-with-base Patch
@test/astro-cloudflare-with-react Patch
@test/astro-cloudflare-with-solid-js Patch
@test/astro-cloudflare-with-svelte Patch
@test/astro-cloudflare-with-vue Patch
@test/astro-cloudflare-wrangler-preview-platform Patch
@test/markdoc-content-collections Patch
@test/content-layer-markdoc Patch
@test/headings-custom Patch
@test/headings Patch
@test/image-assets-custom Patch
@test/image-assets Patch
@test/markdoc-propagated-assets Patch
@test/markdoc-render-with-space Patch
@test/markdoc-render-html Patch
@test/markdoc-render-null Patch
@test/markdoc-render-partials Patch
@test/markdoc-render-simple Patch
@test/markdoc-render-table-attrs Patch
@test/markdoc-render-this-context Patch
@test/markdoc-render-typographer Patch
@test/markdoc-render-with-components Patch
@test/markdoc-render-with-config Patch
@test/markdoc-render-with-extends-components Patch
@test/markdoc-render-with-indented-components Patch
@test/markdoc-render-with-transform Patch
@test/markdoc-variables Patch
@test/content-layer-rendering Patch
@test/mdx-css-head-mdx Patch
@test/image-remark-imgattr Patch
@test/mdx-astro-container-escape Patch
@test/mdx-frontmatter-injection Patch
@test/netlify-skew-protection Patch
@test/netlify-hosted-astro-project Patch
@test/nodejs-api-route Patch
@test/nodejs-badurls Patch
@test/nodejs-encoded Patch
@test/nodejs-errors Patch
@test/nodejs-headers Patch
@test/nodejs-image Patch
@test/locals Patch
@test/node-middleware Patch
@test/nodejs-prerender-404-500 Patch
@test/nodejs-prerender Patch
@test/nodejs-prerendered-error-page-fetch Patch
@test/nodejs-preview-headers Patch
@test/redirects Patch
@test/node-sessions Patch
@test/ssr-assets-middleware Patch
@test/node-static-headers Patch
@test/node-trailingslash Patch
@test/url Patch
@test/well-known-locations Patch
@test/react-component Patch
@test/sitemap-chunks Patch
@test/sitemap-dynamic Patch
@test/sitemap-i18n-fallback Patch
@test/sitemap-ssr Patch
@test/sitemap-static Patch
@test/sitemap-trailing-slash Patch
async-rendering Patch
conditional-rendering Patch
@test/empty-class Patch
svelte-prop-types Patch
@test/astro-vercel-basic Patch
@test/astro-vercel-image Patch
@test/astro-vercel-integration-assets Patch
@test/vercel-isr Patch
@test/vercel-max-duration Patch
@test/vercel-edge-middleware-with-edge-file Patch
@test/vercel-edge-middleware-without-edge-file Patch
@test/astro-vercel-no-output Patch
@test/astro-vercel-prerendered-error-pages Patch
@test/astro-vercel-redirects-serverless Patch
@test/astro-vercel-redirects Patch
@test/vercel-server-islands Patch
@test/astro-vercel-serverless-prerender Patch
@test/astro-vercel-serverless-with-dynamic-routes Patch
@test/astro-vercel-static-assets Patch
@test/vercel-static-headers Patch
@test/astro-vercel-static Patch
@test/vercel-streaming Patch
@test/astro-vercel-with-web-analytics-enabled-output-as-static Patch
vercel-hosted-astro-project Patch
@test/vue-app-entrypoint-async Patch
@test/vue-app-entrypoint-css Patch
@test/vue-app-entrypoint-no-export-default Patch
@test/vue-app-entrypoint-relative Patch
@test/vue-app-entrypoint-src-absolute Patch
@test/vue-app-entrypoint Patch
@test/vue-basics Patch
vue-prop-types Patch
astro-benchmark Patch
@benchmark/adapter Patch
@benchmark/timer Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions Bot added the pkg: astro Related to the core `astro` package (scope) label Aug 8, 2026
@codspeed-hq

codspeed-hq Bot commented Aug 8, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 21 untouched benchmarks


Comparing fetch-refactor-2 (e4ce203) with main (630b833)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (d081033) during the generation of this report, so 630b833 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Comment thread .changeset/fix-rewrite-composable-helpers.md Outdated
Comment thread .changeset/fix-dev-hmr-route-updates.md Outdated
Comment thread .changeset/functional-request-core.md Outdated
Comment thread packages/astro/src/actions/runtime/entrypoints/server.ts Outdated
Comment thread packages/astro/src/core/fetch/features.ts Outdated
Rewrites the three changesets to describe user-facing behavior instead of
internals, removes all references to internal planning documents from code
comments, and rewrites comments that described pre-refactor behavior to
describe how the code currently works.
@matthewp matthewp changed the title Internal request refactor Refactor internal request handling into a functional core Aug 10, 2026
Covers the documented advanced pattern from #17591: a custom wrangler
entryfile that builds its own state with `new FetchState(request)` from a
bare workerd request, serves assets through `cf()`, and renders with
`astro(state)`.
The method had no callers — BaseApp.render constructs the FetchState
itself and generated builds only use the fetch member. Also rewrites the
constructor comment to describe the current contract.
@github-actions github-actions Bot added the pkg: integration Related to any renderer integration (scope) label Aug 10, 2026
@matthewp
matthewp marked this pull request as ready for review August 10, 2026 21:51
@florian-lefebvre

Copy link
Copy Markdown
Member

One thing I wanted to do is access the logger outside the request (and the pipeline), for example within getCollection() instead of using console.warn(). Does this PR make it possible/easier?

@ematipico ematipico added pr: astro-review Triggers a bot to do an automated review and removed pr: astro-review Triggers a bot to do an automated review labels Aug 11, 2026
@matthewp matthewp added pr: astro-review Triggers a bot to do an automated review and removed pr: astro-review Triggers a bot to do an automated review labels Aug 11, 2026

@astro-review astro-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a large but well-scoped internal refactor that replaces the monolithic Pipeline and App class hierarchy with a manifest-keyed functional core. The change correctly preserves external API behavior while enabling new FetchState(request) to work inside custom worker entrypoints.

Overall assessment: The implementation is careful and thorough. State is correctly partitioned into per-request (FetchState), per-manifest (createManifestMemo), and per-environment (RenderEnvironment) layers. Backward-compatibility shims (AppPipeline) cover all previously exposed surface area. New unit tests and a Cloudflare integration regression test cover the motivating use case and the new memoization/registry primitives.

Specific notes:

  • The functional error dispatch (renderErrorPagerenderDefaultError / renderDevError / renderBuildError) preserves the old strategy selection.
  • The AppPipeline shim reproduces every old Pipeline member that was reachable from app.pipeline, with identical semantics.
  • Request-reconstruction during rewrites and forwarded-header application correctly drops the removed appSymbol/pipelineSymbol because request-bound state is now captured on FetchState itself.
  • Dev HMR wiring now targets the single per-manifest route table atomically, which fixes the stale-route issue described in one of the changesets.

One actionable issue found: BuildApp inadvertently passes streaming = true into the AppPipeline shim instead of the old manifest.serverLike value, making the backward-compatibility app.pipeline.streaming property incorrect for SSG builds.

This review was made by an LLM. The analysis may be wrong, and reports might be incorrect.

Comment thread packages/astro/src/core/build/app.ts
@matthewp

Copy link
Copy Markdown
Contributor Author

@florian-lefebvre yes, we can now get a logger keyed by the manifest. I can create a helper for this like we have for actions and some of the other things that hang off of the manifest.

The last surviving Pipeline: app.pipeline was undocumented, so the
stateless compat shim is gone entirely. The node adapter uses the new
public app.getLogger() to wait for the configured log destination, and
BuildApp carries the routeCache/getComponentByRoute accessors StaticPaths
needs across the prerender bundle boundary. The internal PipelineFeatures
bit flags are renamed to FetchFeatures, and @astrojs/node now requires
the astro version that ships app.getLogger().
Replaces resolveLoggerDestination's hand-rolled WeakMap with a
getResolvedLogger accessor built on the shared async manifest memo. The
derivation never rejects: a custom log destination that fails to load is
reported through the console logger and the request proceeds, instead of
failing the first request.
@florian-lefebvre

Copy link
Copy Markdown
Member

Amazing thanks!

@matthewp matthewp added pr: astro-review Triggers a bot to do an automated review and removed pr: astro-review Triggers a bot to do an automated review labels Aug 11, 2026

@astro-review astro-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed the functional request-core refactor from 630b833 through 8a164e6. This is a large, mostly mechanical refactor that removes the Pipeline/AppPipeline classes in favor of manifest-keyed functional helpers (RenderEnvironment, manifest memos, and the ambient manifest). It preserves the public App and astro/fetch APIs, adds a regression test for bare new FetchState(request) usage in the Cloudflare custom-worker pattern, and includes changesets for both astro and @astrojs/node.

No correctness or security blockers were found. Two optional items are noted: a missing error handler on the new dev-server body-stream collection that can leave a request hanging, and a small type-contract mismatch in the dev facade override of devMatch. The five changesets cover the user-visible facets of the refactor.

This review was made by an LLM. The analysis may be wrong, and reports might be incorrect.

Comment thread packages/astro/src/vite-plugin-app/handle-request.ts Outdated
Comment thread packages/astro/src/core/app/dev-facade.ts Outdated
Reject the dev body-buffering promise on stream error so an aborted or
malformed upload surfaces through runWithErrorHandling instead of hanging
the request, and make DevFacadeApp.devMatch's pathname optional to match
the BaseApp contract.
@matthewp matthewp added pr: astro-review Triggers a bot to do an automated review and removed pr: astro-review Triggers a bot to do an automated review labels Aug 11, 2026

@astro-review astro-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a large internal refactor that replaces the Pipeline/AppPipeline classes with a manifest-keyed functional core. The reviewed diff looks architecturally sound: per-manifest WeakMaps carry derived state, the ambient-manifest subpath allows new FetchState(request) to work without an app handle, and the environment record cleanly separates dev/build/container/production behavior. The test updates and the new Cloudflare custom-entryfile integration test cover the motivating issue. Changeset coverage is appropriate (astro and @astrojs/node). I found one packaging issue in the new imports mapping. No project code, tests, builds, or checks were run; the review was based entirely on the provided PR diff and repository reads.

This review was made by an LLM. The analysis may be wrong, and reports might be incorrect.

Comment thread packages/astro/package.json
The #astro-internal/ambient-manifest types condition points at the src
stub, which was not in the files list — nothing consults the path in the
published package today, but shipping the file keeps the condition
resolvable if a future declaration ever references the specifier.
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) pr: astro-review Triggers a bot to do an automated review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom worker entrypoint returns 500: FetchState(request) called on a request without an attached app

3 participants