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

Add the output option #4015

Merged
merged 22 commits into from
Jul 25, 2022
Merged

Add the output option #4015

merged 22 commits into from
Jul 25, 2022

Conversation

matthewp
Copy link
Contributor

@matthewp matthewp commented Jul 21, 2022

Changes

  • Adds the new config option output: 'static' | 'server'
  • This opens up the ability for Adapters to add special support for static mode.
  • This API is used instead of the presence of an adapter to enable SSR features.
  • If an adapter is omitted and output === 'server' we through an error during build.

Testing

  • Tests added

Docs

@changeset-bot
Copy link

changeset-bot bot commented Jul 21, 2022

🦋 Changeset detected

Latest commit: 3d179ab

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

This PR includes changesets to release 19 packages
Name Type
astro Minor
@astrojs/cloudflare Minor
@astrojs/deno Minor
@astrojs/image Minor
@astrojs/netlify Minor
@astrojs/node Minor
@astrojs/sitemap Minor
@astrojs/vercel Minor
@e2e/astro-component Patch
@e2e/error-react-spectrum Patch
@e2e/error-sass Patch
@e2e/errors Patch
@e2e/lit-component Patch
@e2e/preact-component Patch
@e2e/react-component Patch
@e2e/solid-component Patch
@e2e/svelte-component Patch
@e2e/e2e-tailwindcss Patch
@e2e/ts-resolution 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 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) labels Jul 21, 2022
@natemoo-re natemoo-re mentioned this pull request Jul 21, 2022
20 tasks
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 so far!

force people to rename adapter to deploy or stay back-compat with adapter and a deprecation notice?

I'd lean for back-compat + deprecation notice. It's cheap to do a config rename like that inside of validateConfig() iirc.

examples/basics/astro.config.mjs Outdated Show resolved Hide resolved
@matthewp
Copy link
Contributor Author

matthewp commented Jul 22, 2022

TODO:

  • - Update adapters to throw when attempted to use with mode: 'static'.

@matthewp matthewp marked this pull request as ready for review July 22, 2022 16:05
@matthewp matthewp self-assigned this Jul 22, 2022
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.

Blocking this PR. There is an ongoing discussion on Discord about overloading the name mode which is a well-defined Vite-ism.

As soon as that's resolved, I'm totally on board with the core changes here.

@matthewp matthewp changed the title Add the mode option Add the output option Jul 22, 2022
'@astrojs/vercel': minor
---

New `mode` configuration option
Copy link
Member

Choose a reason for hiding this comment

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

Changeset needs to be updated to refer to output

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.

Thanks for helping to get this over the line @matthewp. I took a quick pass to clean this up for you so that we can merge in time for the RC. Here's a summary of the changes made on top of your PR:

  • cleaned up some of the auto-doc generation types.
  • cleaned up some of the old code from my original PR that had made its way into this one (old changesets, old "exports' entry, etc)
  • Kept the config output and the term "output target"/"output mode" used to describe it.
  • Reverted the deploy change to keep it as adapter for now. I'm glad that we experimented with a new name here but after trying a few out first-hand I wasn't happy with anything to the point that it would be worth the switch and increased migration cost of the more important output change. Let's keep it as "adapter" for now and can revisit later if user feedback is that the word "adapter" is still too vague.

@FredKSchott FredKSchott merged commit 6fd161d into main Jul 25, 2022
@FredKSchott FredKSchott deleted the new-adapter-api-2 branch July 25, 2022 04:18
@astrobot-houston astrobot-houston mentioned this pull request Jul 25, 2022
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants