[pull] main from withastro:main - #682
Merged
Merged
Conversation
…hing (#17630) * fix(build): avoid repeated content graph hashing * chore: add incremental build changeset * fix(build): hash incremental page graphs once * test(build): cover shared graphs with integration tests * test(build): update chunked content fixture path --------- Co-authored-by: Matthew Phillips <matthewphillips@cloudflare.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Refactor request handling into a purely functional core
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.
* Remove stray compiled artifacts of components/index.ts
* Make error-strategy switch exhaustive for lint
* Address review: user-facing changesets, standalone comments
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.
* Add regression test for FetchState in a custom Cloudflare worker
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)`.
* Remove unused DefaultFetchHandler.renderWithOptions
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.
* Remove AppPipeline and the app.pipeline property
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().
* Memoize the resolved logger with createAsyncManifestMemo
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.
* Remove AppPipeline from the benchmark adapter
* Address review-bot findings in the dev request path
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.
* Ship the ambient-manifest stub in the publish tarball
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.
* Clarify the type-only FetchState import comment
* Rewrite the RenderEnvironment doc comment in plain language
* Make NoManifestAvailableError a documented error with an actionable hint
* Update the FetchState no-manifest test for the new error message
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )