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

Split support in the Vercel Serverless adapter #7514

Merged
merged 6 commits into from
Jun 29, 2023
Merged

Split support in the Vercel Serverless adapter #7514

merged 6 commits into from
Jun 29, 2023

Conversation

matthewp
Copy link
Contributor

Changes

  • This adds support for build.split: true in the Vercel adapter. Similar to cloudflare, a new function folder is created for each one.

Testing

Manually testing.

Docs

TBD

@changeset-bot
Copy link

changeset-bot bot commented Jun 28, 2023

🦋 Changeset detected

Latest commit: 7c58693

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 the pkg: integration Related to any renderer integration (scope) label Jun 28, 2023
@matthewp matthewp requested a review from JuanM04 June 28, 2023 20:20
@matthewp
Copy link
Contributor Author

!vercel-split

Copy link
Contributor

@JuanM04 JuanM04 left a comment

Choose a reason for hiding this comment

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

Hey, there! This change is quite nice, should bring high performance benefits. I'm quite out of touch with the codebase, but these changes seems ok. I don't know what route.pattern.source outputs, but make sure it's Vercel-complainant (they can be very tricky, I hate them).

@matthewp
Copy link
Contributor Author

!preview vercel-split

@github-actions
Copy link
Contributor

 > [email protected] release /home/runner/work/astro/astro > pnpm run build && changeset publish "--tag" "next--vercel-split" > [email protected] build /home/runner/work/astro/astro > turbo run build --filter=astro --filter=create-astro --filter="@astrojs/*" --filter="@benchmark/*" �[2m• Packages in scope: @astrojs/alpinejs, @astrojs/cloudflare, @astrojs/deno, @astrojs/image, @astrojs/internal-helpers, @astrojs/lit, @astrojs/markdoc, @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/underscore-redirects, @astrojs/vercel, @astrojs/vue, @astrojs/webapi, @benchmark/timer, astro, create-astro�[0m �[2m• Running�[0m �[2m�[1mbuild�[0m�[0m �[2min 31 packages�[0m �[2m• Remote caching enabled�[0m �[35m@astrojs/webapi:build: �[0mcache hit, suppressing logs �[2m5022b9b22168006a�[0m �[33mcreate-astro:build: �[0mcache hit, suppressing logs �[2m85e7229e73b93747�[0m �[32m@astrojs/telemetry:build: �[0mcache hit, suppressing logs �[2m1bc6b4ad7d3d128f�[0m �[34m@astrojs/internal-helpers:build: �[0mcache hit, suppressing logs �[2m5a30529ab66446c3�[0m �[36m@astrojs/prism:build: �[0mcache hit, suppressing logs �[2m424b38cc1c7e8039�[0m �[35m@astrojs/markdown-remark:build: �[0mcache hit, suppressing logs �[2m8340413bc418f7d3�[0m �[32mastro:build: �[0mcache miss, executing �[2mda55a135788fcee9�[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> [email protected] build /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> pnpm run prebuild && astro-scripts build "src/**/*.{ts,js}" && tsc && pnpm run postbuild �[32mastro:build: �[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> [email protected] 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 �[32mastro:build: �[0m �[32mastro:build: �[0m> [email protected] postbuild /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> astro-scripts copy "src/**/*.astro" && astro-scripts copy "src/**/*.wasm" �[32mastro:build: �[0m �[33m@astrojs/react:build: �[0mcache miss, executing �[2m8025f9eea1f734da�[0m �[32m@astrojs/underscore-redirects:build: �[0mcache miss, executing �[2m85591cf78b6c57ee�[0m �[33m@astrojs/image:build: �[0mcache miss, executing �[2mdfb27e6f3a82d395�[0m �[32m@astrojs/vercel:build: �[0mcache miss, executing �[2mf643d5c0ce63af43�[0m �[35m@astrojs/node:build: �[0mcache miss, executing �[2m25e3e30505127e82�[0m �[34m@astrojs/turbolinks:build: �[0mcache miss, executing �[2ma979ff07de13d38f�[0m �[34m@astrojs/solid-js:build: �[0mcache miss, executing �[2mfe99177c54d2a007�[0m �[35m@astrojs/deno:build: �[0mcache miss, executing �[2m56775ff1052f539a�[0m �[36m@astrojs/prefetch:build: �[0mcache miss, executing �[2m97424193c3f75023�[0m �[36m@astrojs/partytown:build: �[0mcache miss, executing �[2m58b6d3dc9c99202f�[0m �[33m@astrojs/react:build: �[0m �[33m@astrojs/react:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/react �[33m@astrojs/react:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/react:build: �[0m �[33m@astrojs/image:build: �[0m �[33m@astrojs/image:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/image �[33m@astrojs/image:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/image:build: �[0m �[35m@astrojs/node:build: �[0m �[35m@astrojs/node:build: �[0m> @astrojs/[email protected] 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/vercel:build: �[0m �[32m@astrojs/vercel:build: �[0m> @astrojs/[email protected] 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 �[34m@astrojs/turbolinks:build: �[0m �[34m@astrojs/turbolinks:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/turbolinks �[34m@astrojs/turbolinks:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/turbolinks:build: �[0m �[32m@astrojs/underscore-redirects:build: �[0m �[32m@astrojs/underscore-redirects:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/underscore-redirects �[32m@astrojs/underscore-redirects:build: �[0m> astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json �[32m@astrojs/underscore-redirects:build: �[0m �[35m@astrojs/deno:build: �[0m �[35m@astrojs/deno:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/deno �[35m@astrojs/deno:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/deno:build: �[0m �[36m@astrojs/partytown:build: �[0m �[36m@astrojs/partytown:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/partytown �[36m@astrojs/partytown:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/partytown:build: �[0m �[36m@astrojs/prefetch:build: �[0m �[36m@astrojs/prefetch:build: �[0m> @astrojs/[email protected] 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 �[34m@astrojs/solid-js:build: �[0m �[34m@astrojs/solid-js:build: �[0m> @astrojs/[email protected] 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 �[33m@astrojs/tailwind:build: �[0mcache miss, executing �[2m323a93a453d6553d�[0m �[34m@astrojs/vue:build: �[0mcache miss, executing �[2ma72666406690f70c�[0m �[36m@astrojs/mdx:build: �[0mcache miss, executing �[2m365385295187a438�[0m �[35m@astrojs/markdoc:build: �[0mcache miss, executing �[2m9e1ba3b8596f5a4a�[0m �[32m@astrojs/preact:build: �[0mcache miss, executing �[2m70ad6049f6846788�[0m �[33m@astrojs/rss:build: �[0mcache miss, executing �[2m8ad526cbdb8ba5b4�[0m �[33m@astrojs/tailwind:build: �[0m �[33m@astrojs/tailwind:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/tailwind �[33m@astrojs/tailwind:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/tailwind:build: �[0m �[34m@astrojs/lit:build: �[0mcache miss, executing �[2m3e8ab28718034628�[0m �[36m@benchmark/timer:build: �[0mcache miss, executing �[2m0bc25633582e9eb4�[0m �[35m@astrojs/alpinejs:build: �[0mcache miss, executing �[2m206d5574e01cb6ee�[0m �[34m@astrojs/vue:build: �[0m �[34m@astrojs/vue:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/vue �[34m@astrojs/vue:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[34m@astrojs/vue:build: �[0m �[36m@astrojs/mdx:build: �[0m �[36m@astrojs/mdx:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/mdx �[36m@astrojs/mdx:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/mdx:build: �[0m �[33m@astrojs/rss:build: �[0m �[33m@astrojs/rss:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/astro-rss �[33m@astrojs/rss:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/rss:build: �[0m �[35m@astrojs/markdoc:build: �[0m �[35m@astrojs/markdoc:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/markdoc �[35m@astrojs/markdoc:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/markdoc:build: �[0m �[32m@astrojs/preact:build: �[0m �[32m@astrojs/preact:build: �[0m> @astrojs/[email protected] 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 �[34m@astrojs/lit:build: �[0m �[34m@astrojs/lit:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/lit �[34m@astrojs/lit:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/lit:build: �[0m �[36m@benchmark/timer:build: �[0m �[36m@benchmark/timer:build: �[0m> @benchmark/[email protected] build /home/runner/work/astro/astro/benchmark/packages/timer �[36m@benchmark/timer:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@benchmark/timer:build: �[0m �[35m@astrojs/alpinejs:build: �[0m �[35m@astrojs/alpinejs:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/alpinejs �[35m@astrojs/alpinejs:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/alpinejs:build: �[0m �[32m@astrojs/svelte:build: �[0mcache miss, executing �[2m8f4763a37c9afd8f�[0m �[33m@astrojs/cloudflare:build: �[0mcache miss, executing �[2mef47c8a99d0bfdb0�[0m �[32m@astrojs/svelte:build: �[0m �[32m@astrojs/svelte:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/svelte �[32m@astrojs/svelte:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[32m@astrojs/svelte:build: �[0m �[33m@astrojs/cloudflare:build: �[0m �[33m@astrojs/cloudflare:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/cloudflare �[33m@astrojs/cloudflare:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/cloudflare:build: �[0m �[36m@astrojs/sitemap:build: �[0mcache miss, executing �[2ma1ed9942231f1c6e�[0m �[34m@astrojs/netlify:build: �[0mcache miss, executing �[2m4d4562be2603a210�[0m �[36m@astrojs/sitemap:build: �[0m �[36m@astrojs/sitemap:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/sitemap �[36m@astrojs/sitemap:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/sitemap:build: �[0m �[34m@astrojs/netlify:build: �[0m �[34m@astrojs/netlify:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/netlify �[34m@astrojs/netlify:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/netlify:build: �[0m Tasks: 30 successful, 30 total Cached: 6 cached, 30 total Time: 1m26.164s 🦋 �[33mwarn�[39m �[31m===============================IMPORTANT!===============================�[39m 🦋 �[33mwarn�[39m Packages will be released under the next--vercel-split 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/markdoc 🦋 �[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/internal-helpers 🦋 �[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/underscore-redirects 🦋 �[36minfo�[39m npm info @astrojs/webapi 🦋 �[36minfo�[39m astro is being published because our local version (0.0.0-vercel-split-20230629135007) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/prism is not being published because version 2.1.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/rss is not being published because version 2.4.3 is already published on npm 🦋 �[33mwarn�[39m create-astro is not being published because version 3.1.8 is already published on npm 🦋 �[33mwarn�[39m @astrojs/alpinejs is not being published because version 0.2.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/cloudflare is not being published because version 6.5.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/deno is not being published because version 4.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/image is not being published because version 0.17.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/lit is not being published because version 2.1.0 is already published on npm 🦋 �[36minfo�[39m @astrojs/markdoc is being published because our local version (0.0.0-vercel-split-20230629135007) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/mdx is not being published because version 0.19.7 is already published on npm 🦋 �[33mwarn�[39m @astrojs/netlify is not being published because version 2.3.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/node is not being published because version 5.3.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/partytown is not being published because version 1.2.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/preact is not being published because version 2.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/prefetch is not being published because version 0.2.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/react is not being published because version 2.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/sitemap is not being published because version 1.3.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/solid-js is not being published because version 2.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/svelte is not being published because version 3.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/tailwind is not being published because version 4.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/turbolinks is not being published because version 0.2.2 is already published on npm 🦋 �[36minfo�[39m @astrojs/vercel is being published because our local version (0.0.0-vercel-split-20230629135007) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/vue is not being published because version 2.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/internal-helpers is not being published because version 0.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-component is not being published because version 1.0.5 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-remark is not being published because version 2.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/telemetry is not being published because version 2.1.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/underscore-redirects is not being published because version 0.1.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/webapi is not being published because version 2.2.0 is already published on npm 🦋 �[36minfo�[39m Publishing �[36m"astro"�[39m at �[32m"0.0.0-vercel-split-20230629135007"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/markdoc"�[39m at �[32m"0.0.0-vercel-split-20230629135007"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/vercel"�[39m at �[32m"0.0.0-vercel-split-20230629135007"�[39m 🦋 �[32msuccess�[39m packages published successfully: 🦋 [email protected] 🦋 @astrojs/[email protected] 🦋 @astrojs/[email protected] 🦋 Creating git tags... 🦋 New tag: [email protected] 🦋 New tag: @astrojs/[email protected] 🦋 New tag: @astrojs/[email protected]

@matthewp
Copy link
Contributor Author

Tested with an example app and everything seems to be working.

@matthewp matthewp marked this pull request as ready for review June 29, 2023 19:36
@matthewp matthewp requested a review from a team as a code owner June 29, 2023 19:36
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.

Code LGTM! Super excited for this!

@matthewp matthewp merged commit 154af8f into main Jun 29, 2023
@matthewp matthewp deleted the vercel-split branch June 29, 2023 20:18
@astrobot-houston astrobot-houston mentioned this pull request Jun 29, 2023
matthewp added a commit that referenced this pull request Jul 11, 2023
* start of vercel split support

* Split Mode with the Vercel Adapter

* Write routes into the config.json

* Add a changeset

* Add docs

* Better changeset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants