Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quality of life updates for the node adapter #9582

Merged
merged 12 commits into from
Jan 12, 2024

Conversation

lilnasy
Copy link
Contributor

@lilnasy lilnasy commented Jan 2, 2024

Changes

  • Depends on quality of life updates for App #9579.
  • createOutgoingHeaders is moved into NodeApp - its logic was duplicated between node and vercel.
  • the entrypoint is now called server-entrypoint.ts (previously "server.ts")
  • the part responsible for serving static files is now called serve-static.ts (previously "http-server.ts").
  • the part responsible for serving on-demand rendered pages is now in serve-app.ts (previously http-server.ts and nodeMiddleware.ts)
  • the part responsible for gathering local and remote network addresses for logging is now exclusively in log-listening-on.ts (previously get-network-address.ts, standalone.ts, and preview.ts)
  • the part responsible for creating an express compatible middleware is now called middleware.ts (previously nodeMiddleware.ts)

Testing

No new functionality is introduced. Existing tests should pass.

Docs

Does not affect behavior.

Copy link

changeset-bot bot commented Jan 2, 2024

🦋 Changeset detected

Latest commit: 1a3883b

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

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 pkg: integration Related to any renderer integration (scope) pkg: astro Related to the core `astro` package (scope) labels Jan 2, 2024
@lilnasy lilnasy changed the base branch from main to adapter-enhancements January 8, 2024 14:02
@github-actions github-actions bot added pr: docs A PR that includes documentation for review and removed pkg: astro Related to the core `astro` package (scope) labels Jan 8, 2024
@lilnasy lilnasy marked this pull request as ready for review January 8, 2024 14:53
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Refactors look great! A few nits on naming

packages/integrations/node/package.json Outdated Show resolved Hide resolved
packages/integrations/node/src/preview-entrypoint.ts Outdated Show resolved Hide resolved
packages/integrations/node/src/preview-entrypoint.ts Outdated Show resolved Hide resolved
packages/integrations/node/src/standalone.ts Outdated Show resolved Hide resolved
@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jan 8, 2024
@sarah11918 sarah11918 removed the pr: docs A PR that includes documentation for review label Jan 9, 2024
@Fryuni
Copy link
Member

Fryuni commented Jan 11, 2024

There is a bug-fix in here now. Maybe mention it on the changeset?

The race condition bug and silent error happens when calling preview with the Node adapter.
This is used in the tests for the adapter itself but is public for any project to use so its not just internal

packages/integrations/node/src/serve-app.ts Show resolved Hide resolved
packages/integrations/node/src/serve-static.ts Outdated Show resolved Hide resolved
packages/integrations/node/src/serve-static.ts Outdated Show resolved Hide resolved
packages/integrations/node/src/preview.ts Show resolved Hide resolved
.changeset/weak-apes-add.md Outdated Show resolved Hide resolved
@lilnasy lilnasy merged commit 3285dad into withastro:adapter-enhancements Jan 12, 2024
13 checks passed
@lilnasy lilnasy deleted the node branch January 12, 2024 16:32
ematipico added a commit that referenced this pull request Jan 17, 2024
* quality of life updates for `App` (#9579)

* feat(app): writeResponse for node-based adapters

* add changeset

* Apply suggestions from code review

Co-authored-by: Emanuele Stoppa <[email protected]>

* Apply suggestions from code review

Co-authored-by: Emanuele Stoppa <[email protected]>

* add examples for NodeApp static methods

* unexpose createOutgoingHttpHeaders from public api

* move headers test to core

* clientAddress test

* cookies test

* destructure renderOptions right at the start

---------

Co-authored-by: Emanuele Stoppa <[email protected]>

* Fallback node standalone to localhost (#9545)

* Fallback node standalone to localhost

* Update .changeset/tame-squids-film.md

* quality of life updates for the node adapter (#9582)

* descriptive names for files and functions

* update tests

* add changeset

* appease linter

* Apply suggestions from code review

Co-authored-by: Nate Moore <[email protected]>

* `server-entrypoint.js` -> `server.js`

* prevent crash on stream error (from PR 9533)

* Apply suggestions from code review

Co-authored-by: Luiz Ferraz <[email protected]>

* `127.0.0.1` -> `localhost`

* add changeset for fryuni's fix

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Emanuele Stoppa <[email protected]>

---------

Co-authored-by: Nate Moore <[email protected]>
Co-authored-by: Luiz Ferraz <[email protected]>
Co-authored-by: Emanuele Stoppa <[email protected]>

* chore(vercel): delete request response conversion logic (#9583)

* refactor

* add changeset

* bump peer dependencies

* unexpose symbols (#9683)

* Update .changeset/tame-squids-film.md

Co-authored-by: Sarah Rainsberger <[email protected]>

---------

Co-authored-by: Arsh <[email protected]>
Co-authored-by: Bjorn Lu <[email protected]>
Co-authored-by: Nate Moore <[email protected]>
Co-authored-by: Luiz Ferraz <[email protected]>
Co-authored-by: Sarah Rainsberger <[email protected]>
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.

5 participants