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

Node.js standalone mode + support for astro preview #5056

Merged
merged 18 commits into from
Oct 12, 2022
Merged

Conversation

matthewp
Copy link
Contributor

Changes

  • This has 3 major changes
    1. A new previewEntrypoint API that adapters can support to enable astro preview.
    2. A new { mode: 'standalone' } option for the @astrojs/node adapter.
    3. The deprecation of the buildConfig option in astro:build:start in favor of moving those same options to config.build.
  • The changesets have more detail on each of these.

Testing

  • Tested via the examples/ssr example.
  • That example has been converted to use standalone mode.

Docs

  • Node.js readme updated
  • Astro's type docs updated
  • Detailed changesets

@changeset-bot
Copy link

changeset-bot bot commented Oct 11, 2022

🦋 Changeset detected

Latest commit: e7a9bd9

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: astro Related to the core `astro` package (scope) pkg: example Related to an example package (scope) pkg: integration Related to any renderer integration (scope) semver: minor Change triggers a `minor` release labels Oct 11, 2022
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@matthewp matthewp marked this pull request as ready for review October 11, 2022 21:01
@matthewp matthewp requested a review from a team as a code owner October 11, 2022 21:01
@matthewp
Copy link
Contributor Author

!preview

@github-actions
Copy link
Contributor

Invalid comment format. Expected: "!preview "

@matthewp
Copy link
Contributor Author

!preview node-standalone

@github-actions
Copy link
Contributor

 > root@0.0.0 release /home/runner/work/astro/astro > pnpm run build && changeset publish "--tag" "next--node-standalone" > root@0.0.0 build /home/runner/work/astro/astro > turbo run build --output-logs=new-only --no-deps --filter=astro --filter=create-astro --filter="@astrojs/*" �[2m• Packages in scope: @astrojs/alpinejs, @astrojs/cloudflare, @astrojs/deno, @astrojs/image, @astrojs/lit, @astrojs/markdown-component, @astrojs/markdown-remark, @astrojs/mdx, @astrojs/netlify, @astrojs/node, @astrojs/partytown, @astrojs/preact, @astrojs/prefetch, @astrojs/prism, @astrojs/react, @astrojs/rss, @astrojs/sitemap, @astrojs/solid-js, @astrojs/svelte, @astrojs/tailwind, @astrojs/telemetry, @astrojs/turbolinks, @astrojs/vercel, @astrojs/vue, @astrojs/webapi, astro, create-astro�[0m �[2m• Running�[0m �[2m�[1mbuild�[0m�[0m �[2min 27 packages�[0m �[2m• Remote computation caching enabled (experimental)�[0m �[35m@astrojs/webapi:build: �[0mcache hit, suppressing output �[2m5dda0e5e358b364e�[0m �[33m@astrojs/telemetry:build: �[0mcache hit, suppressing output �[2mab7f71f46fdce678�[0m �[36mcreate-astro:build: �[0mcache hit, suppressing output �[2mfdc180da85f91f14�[0m �[34m@astrojs/prism:build: �[0mcache hit, suppressing output �[2m7ce825ebda07229d�[0m �[35m@astrojs/markdown-remark:build: �[0mcache hit, suppressing output �[2ma8e1aee8dd1c447e�[0m �[32mastro:build: �[0mcache miss, executing �[2m373ffa8e2af8e647�[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-node-standalone-20221011210529 build /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> pnpm run prebuild && astro-scripts build "src/**/*.ts" && tsc �[32mastro:build: �[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> astro@0.0.0-node-standalone-20221011210529 prebuild /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> astro-scripts prebuild --to-string "src/runtime/server/astro-island.ts" "src/runtime/client/{idle,load,media,only,visible}.ts" �[32mastro:build: �[0m �[35m@astrojs/rss:build: �[0mcache miss, executing �[2m261ff85d8ead25de�[0m �[33m@astrojs/sitemap:build: �[0mcache miss, executing �[2mc9b6f9a756e62f8b�[0m �[33m@astrojs/mdx:build: �[0mcache miss, executing �[2m1de6566c60fe2630�[0m �[36m@astrojs/vue:build: �[0mcache miss, executing �[2m7fd13ea8f58e1c92�[0m �[32m@astrojs/preact:build: �[0mcache miss, executing �[2m4a09061ada6decc3�[0m �[36m@astrojs/image:build: �[0mcache miss, executing �[2m13031b5070a4e611�[0m �[34m@astrojs/alpinejs:build: �[0mcache miss, executing �[2m0a70a7e178b15bfa�[0m �[33m@astrojs/svelte:build: �[0mcache miss, executing �[2m35a33641a7fa3347�[0m �[32m@astrojs/vercel:build: �[0mcache miss, executing �[2m3b0f778e81c85a79�[0m �[34m@astrojs/react:build: �[0mcache miss, executing �[2m01ab6ad3c5458a65�[0m �[35m@astrojs/rss:build: �[0m �[35m@astrojs/rss:build: �[0m> @astrojs/rss@1.0.2 build /home/runner/work/astro/astro/packages/astro-rss �[35m@astrojs/rss:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/rss:build: �[0m �[33m@astrojs/sitemap:build: �[0m �[33m@astrojs/sitemap:build: �[0m> @astrojs/sitemap@1.0.0 build /home/runner/work/astro/astro/packages/integrations/sitemap �[33m@astrojs/sitemap:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/sitemap:build: �[0m �[34m@astrojs/alpinejs:build: �[0m �[34m@astrojs/alpinejs:build: �[0m> @astrojs/alpinejs@0.1.2 build /home/runner/work/astro/astro/packages/integrations/alpinejs �[34m@astrojs/alpinejs:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/alpinejs:build: �[0m �[36m@astrojs/image:build: �[0m �[36m@astrojs/image:build: �[0m> @astrojs/image@0.0.0-node-standalone-20221011210529 build /home/runner/work/astro/astro/packages/integrations/image �[36m@astrojs/image:build: �[0m> astro-scripts build "src/**/*.ts" && tsc && pnpm run postbuild �[36m@astrojs/image:build: �[0m �[36m@astrojs/vue:build: �[0m �[36m@astrojs/vue:build: �[0m> @astrojs/vue@1.1.0 build /home/runner/work/astro/astro/packages/integrations/vue �[36m@astrojs/vue:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[36m@astrojs/vue:build: �[0m �[33m@astrojs/mdx:build: �[0m �[33m@astrojs/mdx:build: �[0m> @astrojs/mdx@0.11.4 build /home/runner/work/astro/astro/packages/integrations/mdx �[33m@astrojs/mdx:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/mdx:build: �[0m �[32m@astrojs/vercel:build: �[0m �[32m@astrojs/vercel:build: �[0m> @astrojs/vercel@0.0.0-node-standalone-20221011210529 build /home/runner/work/astro/astro/packages/integrations/vercel �[32m@astrojs/vercel:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/vercel:build: �[0m �[32m@astrojs/preact:build: �[0m �[32m@astrojs/preact:build: �[0m> @astrojs/preact@1.2.0 build /home/runner/work/astro/astro/packages/integrations/preact �[32m@astrojs/preact:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/preact:build: �[0m �[33m@astrojs/svelte:build: �[0m �[33m@astrojs/svelte:build: �[0m> @astrojs/svelte@1.0.1 build /home/runner/work/astro/astro/packages/integrations/svelte �[33m@astrojs/svelte:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[33m@astrojs/svelte:build: �[0m �[34m@astrojs/react:build: �[0m �[34m@astrojs/react:build: �[0m> @astrojs/react@1.2.0 build /home/runner/work/astro/astro/packages/integrations/react �[34m@astrojs/react:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/react:build: �[0m �[34m@astrojs/partytown:build: �[0mcache miss, executing �[2m2350952c6ae113d1�[0m �[36m@astrojs/turbolinks:build: �[0mcache miss, executing �[2mdaf51a7c59090378�[0m �[34m@astrojs/partytown:build: �[0m �[34m@astrojs/partytown:build: �[0m> @astrojs/partytown@1.0.1 build /home/runner/work/astro/astro/packages/integrations/partytown �[34m@astrojs/partytown:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/partytown:build: �[0m �[35m@astrojs/cloudflare:build: �[0mcache miss, executing �[2m9b3ab4075bdae816�[0m �[32m@astrojs/tailwind:build: �[0mcache miss, executing �[2m7497455042724e75�[0m �[33m@astrojs/lit:build: �[0mcache miss, executing �[2maeccbd49eb425be3�[0m �[34m@astrojs/solid-js:build: �[0mcache miss, executing �[2m9b613eea2e67f8da�[0m �[36m@astrojs/turbolinks:build: �[0m �[36m@astrojs/turbolinks:build: �[0m> @astrojs/turbolinks@0.1.4 build /home/runner/work/astro/astro/packages/integrations/turbolinks �[36m@astrojs/turbolinks:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/turbolinks:build: �[0m �[36m@astrojs/prefetch:build: �[0mcache miss, executing �[2me1c59c386046a4ef�[0m �[35m@astrojs/node:build: �[0mcache miss, executing �[2mff6e3d587227186d�[0m �[35m@astrojs/cloudflare:build: �[0m �[35m@astrojs/cloudflare:build: �[0m> @astrojs/cloudflare@0.0.0-node-standalone-20221011210529 build /home/runner/work/astro/astro/packages/integrations/cloudflare �[35m@astrojs/cloudflare:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/cloudflare:build: �[0m �[32m@astrojs/tailwind:build: �[0m �[32m@astrojs/tailwind:build: �[0m> @astrojs/tailwind@2.0.2 build /home/runner/work/astro/astro/packages/integrations/tailwind �[32m@astrojs/tailwind:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/tailwind:build: �[0m �[33m@astrojs/lit:build: �[0m �[33m@astrojs/lit:build: �[0m> @astrojs/lit@1.0.1 build /home/runner/work/astro/astro/packages/integrations/lit �[33m@astrojs/lit:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/lit:build: �[0m �[34m@astrojs/solid-js:build: �[0m �[34m@astrojs/solid-js:build: �[0m> @astrojs/solid-js@1.1.1 build /home/runner/work/astro/astro/packages/integrations/solid �[34m@astrojs/solid-js:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/solid-js:build: �[0m �[36m@astrojs/prefetch:build: �[0m �[36m@astrojs/prefetch:build: �[0m> @astrojs/prefetch@0.0.8 build /home/runner/work/astro/astro/packages/integrations/prefetch �[36m@astrojs/prefetch:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/prefetch:build: �[0m �[35m@astrojs/node:build: �[0m �[35m@astrojs/node:build: �[0m> @astrojs/node@0.0.0-node-standalone-20221011210529 build /home/runner/work/astro/astro/packages/integrations/node �[35m@astrojs/node:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/node:build: �[0m �[32m@astrojs/deno:build: �[0mcache miss, executing �[2m82d9ee2df80418f8�[0m �[32m@astrojs/deno:build: �[0m �[32m@astrojs/deno:build: �[0m> @astrojs/deno@0.0.0-node-standalone-20221011210529 build /home/runner/work/astro/astro/packages/integrations/deno �[32m@astrojs/deno:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/deno:build: �[0m �[33m@astrojs/netlify:build: �[0mcache miss, executing �[2m3207579d55bf522c�[0m �[33m@astrojs/netlify:build: �[0m �[33m@astrojs/netlify:build: �[0m> @astrojs/netlify@0.0.0-node-standalone-20221011210529 build /home/runner/work/astro/astro/packages/integrations/netlify �[33m@astrojs/netlify:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/netlify:build: �[0m �[36m@astrojs/image:build: �[0m �[36m@astrojs/image:build: �[0m> @astrojs/image@0.0.0-node-standalone-20221011210529 postbuild /home/runner/work/astro/astro/packages/integrations/image �[36m@astrojs/image:build: �[0m> astro-scripts copy "src/**/*.wasm" �[36m@astrojs/image:build: �[0m Tasks: 26 successful, 26 total Cached: 5 cached, 26 total Time: 1m19.218s 🦋 �[33mwarn�[39m �[31m===============================IMPORTANT!===============================�[39m 🦋 �[33mwarn�[39m Packages will be released under the next--node-standalone tag 🦋 �[33mwarn�[39m �[31m----------------------------------------------------------------------�[39m 🦋 �[36minfo�[39m npm info astro 🦋 �[36minfo�[39m npm info @astrojs/prism 🦋 �[36minfo�[39m npm info @astrojs/rss 🦋 �[36minfo�[39m npm info create-astro 🦋 �[36minfo�[39m npm info @astrojs/alpinejs 🦋 �[36minfo�[39m npm info @astrojs/cloudflare 🦋 �[36minfo�[39m npm info @astrojs/deno 🦋 �[36minfo�[39m npm info @astrojs/image 🦋 �[36minfo�[39m npm info @astrojs/lit 🦋 �[36minfo�[39m npm info @astrojs/mdx 🦋 �[36minfo�[39m npm info @astrojs/netlify 🦋 �[36minfo�[39m npm info @astrojs/node 🦋 �[36minfo�[39m npm info @astrojs/partytown 🦋 �[36minfo�[39m npm info @astrojs/preact 🦋 �[36minfo�[39m npm info @astrojs/prefetch 🦋 �[36minfo�[39m npm info @astrojs/react 🦋 �[36minfo�[39m npm info @astrojs/sitemap 🦋 �[36minfo�[39m npm info @astrojs/solid-js 🦋 �[36minfo�[39m npm info @astrojs/svelte 🦋 �[36minfo�[39m npm info @astrojs/tailwind 🦋 �[36minfo�[39m npm info @astrojs/turbolinks 🦋 �[36minfo�[39m npm info @astrojs/vercel 🦋 �[36minfo�[39m npm info @astrojs/vue 🦋 �[36minfo�[39m npm info @astrojs/markdown-component 🦋 �[36minfo�[39m npm info @astrojs/markdown-remark 🦋 �[36minfo�[39m npm info @astrojs/telemetry 🦋 �[36minfo�[39m npm info @astrojs/webapi 🦋 �[36minfo�[39m astro is being published because our local version (0.0.0-node-standalone-20221011210529) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/prism is not being published because version 1.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/rss is not being published because version 1.0.2 is already published on npm 🦋 �[33mwarn�[39m create-astro is not being published because version 1.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/alpinejs is not being published because version 0.1.2 is already published on npm 🦋 �[36minfo�[39m @astrojs/cloudflare is being published because our local version (0.0.0-node-standalone-20221011210529) has not been published on npm 🦋 �[36minfo�[39m @astrojs/deno is being published because our local version (0.0.0-node-standalone-20221011210529) has not been published on npm 🦋 �[36minfo�[39m @astrojs/image is being published because our local version (0.0.0-node-standalone-20221011210529) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/lit is not being published because version 1.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/mdx is not being published because version 0.11.4 is already published on npm 🦋 �[36minfo�[39m @astrojs/netlify is being published because our local version (0.0.0-node-standalone-20221011210529) has not been published on npm 🦋 �[36minfo�[39m @astrojs/node is being published because our local version (0.0.0-node-standalone-20221011210529) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/partytown is not being published because version 1.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/preact is not being published because version 1.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/prefetch is not being published because version 0.0.8 is already published on npm 🦋 �[33mwarn�[39m @astrojs/react is not being published because version 1.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/sitemap is not being published because version 1.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/solid-js is not being published because version 1.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/svelte is not being published because version 1.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/tailwind is not being published because version 2.0.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/turbolinks is not being published because version 0.1.4 is already published on npm 🦋 �[36minfo�[39m @astrojs/vercel is being published because our local version (0.0.0-node-standalone-20221011210529) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/vue is not being published because version 1.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-component is not being published because version 1.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-remark is not being published because version 1.1.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/telemetry is not being published because version 1.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/webapi is not being published because version 1.1.0 is already published on npm 🦋 �[36minfo�[39m Publishing �[36m"astro"�[39m at �[32m"0.0.0-node-standalone-20221011210529"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/cloudflare"�[39m at �[32m"0.0.0-node-standalone-20221011210529"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/deno"�[39m at �[32m"0.0.0-node-standalone-20221011210529"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/image"�[39m at �[32m"0.0.0-node-standalone-20221011210529"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/netlify"�[39m at �[32m"0.0.0-node-standalone-20221011210529"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/node"�[39m at �[32m"0.0.0-node-standalone-20221011210529"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/vercel"�[39m at �[32m"0.0.0-node-standalone-20221011210529"�[39m 🦋 �[32msuccess�[39m packages published successfully: 🦋 astro@0.0.0-node-standalone-20221011210529 🦋 @astrojs/cloudflare@0.0.0-node-standalone-20221011210529 🦋 @astrojs/deno@0.0.0-node-standalone-20221011210529 🦋 @astrojs/image@0.0.0-node-standalone-20221011210529 🦋 @astrojs/netlify@0.0.0-node-standalone-20221011210529 🦋 @astrojs/node@0.0.0-node-standalone-20221011210529 🦋 @astrojs/vercel@0.0.0-node-standalone-20221011210529 🦋 Creating git tags... 🦋 New tag: astro@0.0.0-node-standalone-20221011210529 🦋 New tag: @astrojs/cloudflare@0.0.0-node-standalone-20221011210529 🦋 New tag: @astrojs/deno@0.0.0-node-standalone-20221011210529 🦋 New tag: @astrojs/image@0.0.0-node-standalone-20221011210529 🦋 New tag: @astrojs/netlify@0.0.0-node-standalone-20221011210529 🦋 New tag: @astrojs/node@0.0.0-node-standalone-20221011210529 🦋 New tag: @astrojs/vercel@0.0.0-node-standalone-20221011210529

@matthewp
Copy link
Contributor Author

Released a snapshot for this which can be installed with:

npm install astro@next--node-standalone @astrojs/node@next--node-standalone

Copy link
Member

@FredKSchott FredKSchott left a comment

Choose a reason for hiding this comment

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

LGTM! Flagging @withastro/maintainers-docs for a review of the types additions.


export default defineConfig({
output: 'server',
build: {
Copy link
Member

Choose a reason for hiding this comment

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

nice! This makes a lot of sense!


See the @astrojs/node documentation to learn all of the options available in standalone mode.

## Breaking change
Copy link
Member

Choose a reason for hiding this comment

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

thinking more about this, if you default to middleware and make this option required, do you still need the major version?

Copy link
Contributor Author

@matthewp matthewp Oct 11, 2022

Choose a reason for hiding this comment

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

It wouldn't be required if it had a default, no?

We could default to middleware. My thought was that these two modes are pretty significantly different and it didn't feel right to "prefer" one over the other. Kind of like Vercel serverless vs edge, just completely different things.

As far as semver, given that this is an integration I didn't think it mattered as much to do a semver major change.

But I don't feel too strongly on either of these things.

Copy link
Member

Choose a reason for hiding this comment

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

yea, agreed that because its an integration this doesn't matter as much / I'm okay with the plan for a major. And I agree it makes more sense as required, or as defaulting to standalone. Defaulting to middleware is probably the least natural of the 3...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I think we should do a major in that case and require the option. We can track usage in the future and if standalone is overwhelming (and once it becomes more stable) we can make it the default if we want to.

packages/integrations/node/README.md Outdated Show resolved Hide resolved
packages/integrations/node/README.md Show resolved Hide resolved
@FredKSchott FredKSchott requested a review from a team October 11, 2022 21:41
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Just left a few text suggestions to consider, and one other thing you might want to consider is a link or note to these new server configs around line 400ish from outputDir, to make it known that they exist in SSR mode.

packages/astro/src/@types/astro.ts Outdated Show resolved Hide resolved
* This entrypoint is usually dependent on which host you are deploying to and
* will be set by your adapter for you.
*
* Note that it is recommended that this file ends with `.mjs` so that the runtime
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Note that it is recommended that this file ends with `.mjs` so that the runtime
* Note that it is recommended that this file ends with `.mjs` so that the runtime

Just checking this is intentional, because I think I've only ever heard "runtime" as an adjective "runtime environment, runtime system, runtime library". If this is a noun, then it's fine!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've definitely heard it used as a noun. In fact, nodejs.org's <meta description> tag uses it as one! view-source:https://nodejs.org/en/

.changeset/metal-pumas-walk.md Outdated Show resolved Hide resolved
.changeset/metal-pumas-walk.md Outdated Show resolved Hide resolved
.changeset/stupid-points-refuse.md Outdated Show resolved Hide resolved
.changeset/stupid-points-refuse.md Outdated Show resolved Hide resolved
matthewp and others added 3 commits October 12, 2022 08:24
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
matthewp and others added 4 commits October 12, 2022 09:34
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

Copy link
Contributor

@tony-sull tony-sull left a comment

Choose a reason for hiding this comment

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

Nice! I've been missing astro preview support for Netlify's CLI, great to see this new API will open that door 👍

Change looks good to me, just added one note in the image integration to make sure this won't break WASM support

Comment on lines +103 to +105
if(needsBuildConfig) {
_buildConfig = buildConfig;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

_buildConfig.server is used in the astro:build:ssr step below, does it need to be updated to make sure wasm files are copied to the preview output directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, this line exists for backwards compatibility. If you are using Astro < 1.5.0 then this line will get _buildConfig from the 'astro:build:start' hook. If you are using Astro >= 1.5.0 then it will get it from the 'astro:config:done' hook here: https://github.com/withastro/astro/pull/5056/files#diff-0000f87084d8080bf428d6b3b7dc84cda4f01465d9a3e95c75bbc38b8129e1e5R99

In the future when we do a new major (or minor in the case of astro/image) we can get rid of this code and only support users of Astro >= 1.5.0

Copy link
Contributor

@tony-sull tony-sull left a comment

Choose a reason for hiding this comment

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

Lgtm

@matthewp matthewp merged commit e55af8a into main Oct 12, 2022
@matthewp matthewp deleted the preview-ssr branch October 12, 2022 21:25
@astrobot-houston astrobot-houston mentioned this pull request Oct 12, 2022
@jeff-fe
Copy link

jeff-fe commented Oct 18, 2022

Hello @matthewp, Node.js standalone mode, css resources unable to load.

pnpm run build
node ./dist/server/entry.mjs

image

image

@bluwy
Copy link
Member

bluwy commented Oct 18, 2022

@jeff-fe see #5093

romanzy313 added a commit to romanzy313/astro-fastify that referenced this pull request Jan 28, 2023
Build did not work on latest version of "create astro".

```
  "dependencies": {
    "astro": "^2.0.2"
  },
  "devDependencies": {
    "@matthewp/astro-fastify": "^2.0.3"
  }
```

Issue origin: withastro/astro#5056
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: example Related to an example package (scope) pkg: integration Related to any renderer integration (scope) semver: minor Change triggers a `minor` release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants