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

feat: Vercel adapter #2915

Merged
merged 26 commits into from
Apr 3, 2022
Merged

feat: Vercel adapter #2915

merged 26 commits into from
Apr 3, 2022

Conversation

JuanM04
Copy link
Contributor

@JuanM04 JuanM04 commented Mar 28, 2022

Changes

Adds the Vercel adapter that works with Vercel's Files System API.

Testing

TBD

Docs

TBD

@changeset-bot
Copy link

changeset-bot bot commented Mar 28, 2022

🦋 Changeset detected

Latest commit: bf2199e

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

This PR includes changesets to release 1 package
Name Type
@astrojs/vercel 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 Mar 28, 2022
@JuanM04
Copy link
Contributor Author

JuanM04 commented Mar 28, 2022

.output folder works without any configuration in Vercel but ENABLE_FILE_SYSTEM_API=1. API Routes are still in progress.

I've created @juanm04/astro and @juanm04/astro-vercel for testing, and I'm doing pnpm add astro@npm:@juanm04/astro in the starter template

@JuanM04
Copy link
Contributor Author

JuanM04 commented Mar 28, 2022

Perfect, I've made it work somehow. It turned out the Node.js helpers Vercel gives you (like res.query or res.send()) didn't work — the handler gets a plain Node HTTP Request. But it works!

@JuanM04
Copy link
Contributor Author

JuanM04 commented Mar 30, 2022

I had a lot of trouble generating the pages statically and converting the endpoints to API Routes. So, I took a similar approach to what the Netlify adapter does. Nonetheless, I'm waiting to #2937 to get mergerd.

In the future I could do a PR that lets you generate statically all the pages for both Netlify and Vercel

@matthewp
Copy link
Contributor

@JuanM04 Our SSR implementation is currently designed to be SSR-only, not a mixture of static + SSR. Something we might change in the future.

@JuanM04 JuanM04 marked this pull request as ready for review March 31, 2022 18:26
@JuanM04 JuanM04 changed the title feat: Vercel integration feat: Vercel adapter Mar 31, 2022
@tony-sull tony-sull merged commit dff89a0 into main Apr 3, 2022
@JuanM04 JuanM04 deleted the feat/vercel-adapter branch April 3, 2022 18:43
@github-actions github-actions bot mentioned this pull request Apr 3, 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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants